Actions10
Coupon → Create
AI-generatedSummary
Create a coupon via Mayar API
Inputs
- options — Additional runtime settings
- couponName (required) — Name of the coupon
- couponExpiredAt — Expiration date in ISO format
- discount — Discount configuration
- coupon — Coupon value settings (code and type)
- products — Products JSON array
Output shape
[{ json:
Debug mode attaches _meta {method, path, body} to response. On error with continueOnFail=true returns [{ error: 'Request failed' }]; otherwise throws NodeOperationError.
Examples
Example 1: Create a reusable coupon with monetary discount for a specific customer type
couponName: 'SUMMER10', couponExpiredAt: '2025-12-31T23:59:59.000Z', discount: { discountType: 'monetary', eligibleCustomerType: 'all', value: 10, totalCoupons: 5 }, coupon: { type: 'reusable' }, products: '[{quantity:2,rate:5.99,description:'T-shirt'}]'