Skip to content

API reference

Coupons

Discount codes. The code and the discount are fixed once created (orders keep what they used); every other rule can change.

Endpoints

GET/couponscoupons:read

List coupons.

Query parameters
Query parametersTypeDescription
activeType: true | falseOnly usable codes (active and not expired), or only unusable ones.
codeType: stringCode contains this text.
limitType: 1..200Page size. Default 50.
cursorType: stringnextCursor from the previous page.
curl https://api.sellhidden.com/v1/coupons \
  -H "Authorization: Bearer hsk_live_…"
200 OKjson
{ "ok": true, "coupons": [ { "id": "clx…", "code": "LAUNCH20", "type": "percent", "value": 20, "minOrderUsd": null, "maxUses": 100, "usedCount": 12, "active": true, "expiresAt": null, "createdAt": "…" } ], "nextCursor": null, "hasMore": false }

POST/couponscoupons:writeIdempotency-Key201

Create a coupon.

Body
BodyTypeDescription
coderequiredType: string2-40 characters: letters, digits, - and _. Stored upper-case.
percentOffType: 1..100Either this or amountOffUsd.
amountOffUsdType: numberFixed discount in USD.
maxUsesType: integer | nullTotal uses; null = unlimited.
perCustomerLimitType: 1..1000 | nullUses per buyer email.
firstOrderOnlyType: booleanOnly buyers who never paid here.
minOrderUsdType: number | nullSmallest cart subtotal (before the discount).
maxDiscountUsdType: number | nullCap on the discount.
startsAtType: ISO date | nullNot valid before.
expiresAtType: ISO date | nullNot valid after.
productIdsType: string[]Only these products (empty = all).
categoryIdsType: string[]Only these categories.
variantIdsType: string[]Only these variations.
paymentMethodsType: string[]"crypto", "balance" or a manual payment method id.
activeType: booleanDefault true.
curl -X POST https://api.sellhidden.com/v1/coupons \
  -H "Authorization: Bearer hsk_live_…" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "code": "LAUNCH20",
    "percentOff": 20,
    "maxUses": 100,
    "expiresAt": "2026-12-31T23:59:59Z"
  }'

GET/coupons/{id}coupons:read

Get a coupon.

curl https://api.sellhidden.com/v1/coupons/ID \
  -H "Authorization: Bearer hsk_live_…"

PATCH/coupons/{id}coupons:write

Update a coupon. Any rule except code, percentOff and amountOffUsd. null clears a limit or a date; null or [] clears a list.

Body
BodyTypeDescription
activeType: boolean
maxUsesType: integer | nullNot below the uses so far.
perCustomerLimitType: integer | null
firstOrderOnlyType: boolean
minOrderUsdType: number | null
maxDiscountUsdType: number | null
startsAtType: ISO date | null
expiresAtType: ISO date | null
productIdsType: string[] | null
categoryIdsType: string[] | null
variantIdsType: string[] | null
paymentMethodsType: string[] | null
curl -X PATCH https://api.sellhidden.com/v1/coupons/ID \
  -H "Authorization: Bearer hsk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"active":false}'

DELETE/coupons/{id}coupons:write

Delete a coupon.

curl -X DELETE https://api.sellhidden.com/v1/coupons/ID \
  -H "Authorization: Bearer hsk_live_…"

Get help

Send us the endpoint, the request or delivery id and the response you got. Security findings go through responsible disclosure. Live platform status is on the support page.

See also