cURL
curl --request POST \ --url https://api.withflex.com/v1/coupons \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "coupon": { "name": "Coupon", "applies_to": { "products": [ "<string>" ] }, "amount_off": 100, "duration": "<unknown>", "duration_in_months": null, "percent_off": 10, "max_redemptions": 100, "metadata": { "key": "value" } } } '
{ "coupon": { "coupon_id": "fcoup_1234567890", "duration": "<unknown>", "name": "<string>", "valid": true, "created_at": "<string>", "test_mode": true, "amount_off": 123, "applies_to": { "products": [ "<string>" ] }, "duration_in_months": 123, "metadata": {}, "percent_off": 123, "max_redemptions": 123, "times_redeemed": 123 } }
Create a coupon
Use a Bearer token to access this API.
Show child attributes
A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer. Coupons may be applied to subscriptions and checkout sessions.