Coupon
Private Coupon API endpoints
An API endpoint to get a paginated list of coupons.
Query parameters
idsoptionalinteger[]Filter by coupon IDs
queryoptionalstringSearch by coupon code or name
activeoptionalintegerFilter by active status (0 or 1)
Possible values: 0, 1.
trashedoptionalintegerInclude soft-deleted coupons (0 or 1)
Possible values: 0, 1.
sort[field]optionalstringSort field
Possible values: id, name.
sort[direction]optionalstringSort direction; defaults to asc.
Possible values: asc, desc.
Defaults to "asc".
pageoptionalintegerPage number
per_pageoptionalintegerItems per page
expand[]optionalstring[]List of relations to expand in the response.
Returnsobject
Coupons list response
Create a new coupon. Must include either a discount or a gift (or both).
Query parameters
expand[]optionalstring[]List of relations to expand in the response.
Request body
nameRequiredstringcoupon_codeRequiredstringUnique coupon code within the shop
durationRequiredstringPossible values: once, forever, multiple.
duration_in_monthsoptionalintegerRequired when duration is "multiple". Prohibited when duration is "once" or "forever".
remove_gifts_after_end_of_durationoptionalintegerPossible values: 0, 1.
max_redemptionsoptionalinteger | nulllimit_one_per_customeroptionalintegerPossible values: 0, 1.
redeem_byoptionalstring | nullExpiry date in Y-m-dTH:i:s format, interpreted as UTC. Must be after tomorrow.
Format: date-time.
conditionoptionalobject | nullCoupon condition. Set to null for no condition.
discountoptionalobject | nullDiscount action. Required if gift is not provided.
giftoptionalobject | nullGift action. Required if discount is not provided.
rulesoptionalobject | nullCoupon restriction rules
ReturnsCoupon
Coupon created
Get a single coupon by its ID.
Path parameters
coupon_idRequiredintegerCoupon ID
Query parameters
expand[]optionalstring[]List of relations to expand in the response.
ReturnsCoupon
Coupon object response
Partially update a coupon. All fields are optional.
Path parameters
coupon_idRequiredintegerCoupon ID
Query parameters
expand[]optionalstring[]List of relations to expand in the response.
Request body
nameoptionalstringdurationoptionalstringPossible values: once, forever, multiple.
duration_in_monthsoptionalintegerRequired when duration is "multiple". Prohibited when duration is "once" or "forever".
remove_gifts_after_end_of_durationoptionalintegerPossible values: 0, 1.
max_redemptionsoptionalinteger | nulllimit_one_per_customeroptionalintegerPossible values: 0, 1.
redeem_byoptionalstring | nullExpiry date in Y-m-dTH:i:s format, interpreted as UTC. Must be after tomorrow.
Format: date-time.
conditionoptionalobject | nullSet to null to remove the condition.
discountoptionalobject | nullUpdate discount settings.
giftoptionalobject | nullUpdate gift settings.
rulesoptionalobject | nullUpdate restriction rules. Omit a type to leave it unchanged.
ReturnsCoupon
Coupon updated
Archive (deactivate) a coupon.
Path parameters
coupon_idRequiredintegerCoupon ID
ReturnsCoupon
Coupon archived