Skip to main content
POST
Use coupon card

POST /coupon-cards

Deduct a positive amount from a coupon card. Send Authorization: Bearer YOUR_API_KEY and X-Device-ID: YOUR_DEVICE_ID. Also send X-Employee-Token: YOUR_EMPLOYEE_TOKEN. See authentication. amount is an integer in cents, from 1 to 100000 inclusive. Insufficient balance returns 400.

Card eligibility

The card must be activated, unarchived, unexpired, and valid for the API key’s location. Test cards are usable only during the test period. Inactive cards return 422, archived cards return 410, and expired or location-mismatched cards return 400. sessionToken is optional. Supply it when completing a partner payment session. The session must be pending, unexpired, and support the card type. A successful operation completes it; an unsupported type returns 400, and an unavailable session returns 410. Success messages can contain $t(...) translation expressions. Use the structured response fields to determine the outcome.

Example request

Example response

Authorizations

Authorization
string
header
required

Location API key. Also requires X-Device-ID.

X-Employee-Token
string
header
required

Employee session token from /employee/login.

Headers

X-Device-ID
string
required

Stable device identifier. API key binds to this value on first use.

Body

application/json
cardId
string
required
amount
integer
required

Cents to deduct.

Required range: 1 <= x <= 100000
sessionToken
string

Optional partner payment-session token.

Response

Success

amountLeft
integer
success
boolean
message
string