Discounts
Create a coupon
Needs the catalog:write scope, or a full-access key. About scopes
POST
/
api/v1/couponsAuthorization
AuthorizationRequiredBearer <token>
An API key: gpy_test_… or gpy_live_… (or an agent key, agk_…).
In: header
Request Body
application/jsonOptionalnameRequiredstring
Minimum length:
1Maximum length: 100percent_offAny properties in string, number
Exactly one of percent_off / amount_off_cents.
amount_off_centsstring
Fixed amount off; needs currency.
Pattern:
"^\\d+$"currencystring
Value in:
"USD" | "AUD" | "CAD" | "GBP" | "EUR" | "INR" | "NPR"durationRequiredstring
Value in:
"once" | "repeating" | "forever"duration_in_periodsinteger
applies_to_plan_idsarray<string>
max_redemptionsinteger
redeem_bystring
Format:
"date-time"activeboolean
Header Parameters
Idempotency-Keystring
A unique value for this operation, chosen by you. A retry with the same key and the same body returns the first response instead of running again. The same key with a different body answers 409 idempotency_key_reused; a key whose first request is still running answers 409 idempotency_in_progress.
The coupon.