Coupons
Create a coupon
Changed onCreate a discount coupon. Requires the coupons:write scope. Apply it with couponCode on POST /v1/payments, or let the payer type it on the hosted checkout. Coupons belong to the environment of the key: a ypk_test_ key manages sandbox coupons and a ypk_live_ key production coupons, and a payment uses only coupons of its own environment.
post/v1/coupons
Request
- Base URLhttps://api.yuvexpay.com
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
X-Idempotency-Keystring
Optional on this endpoint. When sent, a 2xx response is stored for 24 hours and replayed for a retry with the same key and body.
Request body
Response
Coupon created.
Example response
{
"coupon": {
"code": "BLACK10"
}
}Changes
- info
endpoint added
- info