Gift card issuing/Issuing API & tokens
Gift Card Issuing API
An issuing token lets your storefront or scripts create gift cards, make direct top-ups and void cards automatically, without doing it by hand on the website.
An issuing token can only create, query and void gift cards and make direct top-ups. It cannot call models, and it is not interchangeable with the API keys on the API page. You do not need one to create gift cards by hand on the website. Go to gift cards →
On this pageexpand_more
Create an issuing tokenlink
- 1
Open the Issuing tokens tab
Sign in, go to the "Gift cards & direct top-up" page, switch to the "Issuing tokens" tab and click "New issuing token".
- 2
Name it and set optional limits
The name can be up to 60 characters, such as "Card-key storefront". The IP allowlist and the daily limit are optional; leave them empty for no limit. The platform sets no defaults.
- 3
Save the token right away
The token starts with wkt_ and is shown only once. If you lose it, revoke it and create a new one. Creating a token sends an in-app notification and an email.
- Base URL
- https://wokey.ai/api/issuer/v1
- Authentication
- Send Authorization: Bearer wkt_… with every request. A signed-in website session cannot call these endpoints, and an issuing token cannot call any other endpoint.
- Requests & responses
- Bodies are JSON. Amounts in responses are strings with two decimals (for example "10.00"); times are ISO 8601 in UTC.
Quick startlink
Each time your storefront completes an order, call the create endpoint with count set to 1 and the order ID as the idempotency key. There is no need to stock codes in advance, and a repeated call for the same order creates codes only once.
curl -X POST https://wokey.ai/api/issuer/v1/codes \
-H "Authorization: Bearer wkt_YOUR_ISSUING_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-20261017-0001" \
-d '{ "sourceType": "provider", "amountUsd": 10, "count": 1, "label": "order-20261017-0001" }'{
"batch": {
"id": "icb_…",
"sourceType": "provider",
"amountUsd": "10.00",
"count": 1,
"totalUsd": "10.00",
"label": "order-20261017-0001",
"createdAt": "2026-10-17T08:00:00.000Z"
},
"replayed": false,
"codes": [
{
"id": "ic_…",
"batchId": "icb_…",
"kind": "code",
"sourceType": "provider",
"amountUsd": "10.00",
"codeHint": "7K2M",
"status": "active",
"label": "order-20261017-0001",
"createdAt": "2026-10-17T08:00:00.000Z",
"redeemedAt": null,
"redeemedByMaskedEmail": null,
"voidRequestedAt": null,
"voidEffectiveAt": null,
"voidedAt": null,
"frozenAt": null,
"code": "WK-4F9Q-T3XA-8HRB-7K2M",
"redeemUrl": "https://wokey.ai/redeem#WK-4F9Q-T3XA-8HRB-7K2M"
}
]
}code is the redemption code and redeemUrl is the redemption link; send either to the buyer. The buyer redeems it after signing in to Wokey, and the face value goes to their API credits.
Endpointslink
Every path starts with https://wokey.ai.
/api/issuer/v1/balanceBalanceReturns the withdrawable balance of each funding source: provider (null if you have no Provider account), referrer, and for the api source its switch, eligibility and available balance. It also refunds voided gift cards whose 72-hour cooldown has ended.
/api/issuer/v1/codesCreate gift cardsCharges the chosen funding source and creates a batch of gift cards with the same face value. Returns batch, replayed (whether this was an idempotent replay) and codes (each with code and redeemUrl). The face value is deducted as soon as the codes are created.
sourceTypeRequired- provider, referrer or api; see Funding sources.
amountUsdRequired- Face value per card in USD, 1 to 1,000,000, at most two decimals.
count- Number of cards, 1 to 500. Defaults to 1.
label- Note of up to 120 characters, such as an order ID or channel. Searchable in the list.
idempotencyKeyRequired- Idempotency key of up to 100 characters. Can also be sent as the Idempotency-Key header.
/api/issuer/v1/codesList gift cardsReturns { items, nextCursor }, newest first. The list never includes the code itself, only its last 4 characters in codeHint; redeemed cards include the redeemer's masked email in redeemedByMaskedEmail.
status- active, voiding, voided, redeemed or frozen.
sourceType- Filter by funding source.
batchId- Only one batch.
search- Search by note or the last 4 characters of the code.
code- A full code, matched exactly. Useful for buyer disputes.
cursor- nextCursor from the previous page.
limit- Page size, default 50, maximum 200.
/api/issuer/v1/codes/:idGift card detailsReturns one gift card including the code and redeemUrl. Every read of a code is recorded in the audit log.
/api/issuer/v1/codes/:id/voidVoid a gift cardOnly unredeemed (active) cards can be voided. A voided card stops working at once, and its face value returns to the original funding source after 72 hours. Returns issued_credit_not_found if the card does not exist or is not active.
/api/issuer/v1/codes/:id/void/cancelCancel a voidCancels a void during the 72-hour cooldown and makes the card active again. Returns issued_credit_not_voiding if the card is not being voided.
/api/issuer/v1/direct-topupsDirect top-upAdds the amount straight to another account's API credits without creating a code; the recipient is notified. Returns { direct, replayed }.
sourceTypeRequired- provider or referrer. The API credits source cannot be used for direct top-ups.
recipientIdentifierRequired- The recipient's receive code (PAY-XXXX-XXXX) or account email. Cannot be yourself.
amountUsdRequired- Amount in USD, 1 to 1,000,000, at most two decimals.
label- Note of up to 120 characters.
idempotencyKeyRequired- Idempotency key of up to 100 characters. Can also be sent as the Idempotency-Key header.
Funding sourceslink
provider- Provider earningsYour withdrawable earnings as a Provider. Requires a Provider account whose settlement is not frozen.
referrer- Referral commissionYour withdrawable referral commission.
api- API creditsGift cards only, no direct top-ups. Available only to eligible accounts: every API credit must come from an on-chain top-up or from your own Provider earnings or referral commission. Check api.enabled and api.eligible in the balance response.
Idempotency keyslink
- Creating gift cards and direct top-ups both require an idempotency key. Your order ID is a good choice.
- Keys are unique per account and shared between the website and the issuing API, regardless of which token sent the request.
- Repeating a request with the same key and the same parameters charges nothing and returns the first result with replayed set to true; a replayed create returns the same codes again.
- The same key with different parameters (sourceType, amountUsd, count, and the recipient for direct top-ups) returns 409 idempotency_key_conflict.
- After a network timeout or a 5xx response, retry with the same key; you will not be charged twice.
Gift card status & voidinglink
active- Unredeemed and can be redeemed.
redeemed- Redeemed; the face value is in the redeemer's API credits.
voiding- Being voided and can no longer be redeemed. You can cancel the void during the 72-hour cooldown.
voided- Voided; the face value has returned to the original funding source.
frozen- Frozen by the platform. It cannot be redeemed or voided by you. Contact support if you have questions.
- The face value is deducted when the card is created. active, voiding, redeemed and frozen cards all count as charged; only voided returns the balance.
- If a card was already sold or given away, voiding it leaves the recipient unable to redeem it.
- Refunds after the cooldown are settled automatically, with an in-app notification; calling balance also settles any voids that are due.
Error codeslink
Errors look like { "error": { "code": "…", "message": "…", "type": "invalid_request_error" } }. Branch on code, not on the message text.
invalid_issuer_tokenHTTP 401- No token, a malformed token, or a token that does not exist or was revoked.
issuer_token_ip_not_allowedHTTP 403- The request IP is not in this token's IP allowlist.
issuer_token_daily_limit_exceededHTTP 429- Gift cards plus direct top-ups made with this token today (UTC) would exceed its daily limit.
rate_limitedHTTP 429- Too many requests. Retry later with the same idempotency key.
issued_credits_disabledHTTP 403- The platform has paused new issuance. Issued gift cards can still be redeemed, and querying, voiding and cancelling voids still work.
issuer_not_eligibleHTTP 403- This account cannot issue gift cards.
invalid_source_typeHTTP 400- sourceType is not provider, referrer or api.
invalid_amountHTTP 400- The amount is outside 1 to 1,000,000 or has more than two decimals.
invalid_countHTTP 400- count is not a whole number from 1 to 500.
invalid_labelHTTP 400- label is not a string or is longer than 120 characters.
invalid_idempotency_keyHTTP 400- The idempotency key is missing or longer than 100 characters.
insufficient_withdrawable_balanceHTTP 400- Not enough withdrawable Provider earnings or referral commission.
insufficient_balanceHTTP 400- Not enough API credits.
api_source_not_eligibleHTTP 403- The account cannot issue from API credits; see api.disqualifiedBy in the balance response.
api_source_direct_not_supportedHTTP 400- The API credits source cannot be used for direct top-ups.
provider_profile_not_foundHTTP 404- The provider source was chosen, but the account has no Provider account.
provider_settlement_frozenHTTP 403- Provider settlement is frozen, so Provider earnings cannot be used.
withdrawable_balance_mismatchHTTP 409- Balance reconciliation failed. Please contact support.
recipient_requiredHTTP 400- The direct top-up has no recipient.
recipient_not_foundHTTP 404- No account matches this receive code or email.
recipient_not_eligibleHTTP 403- That account cannot receive credits right now.
cannot_transfer_to_selfHTTP 400- You cannot top up your own account.
idempotency_key_conflictHTTP 409- The idempotency key was already used for a request with different parameters.
issued_credit_not_foundHTTP 404- The card does not exist, is not yours, or (when voiding) is not active.
issued_credit_not_voidingHTTP 409- The card is not being voided, or the cooldown has ended, so the void cannot be cancelled.
code_generation_failedHTTP 503- Codes could not be generated this time and nothing was charged. Retry with the same idempotency key.
Limits & securitylink
- Creating gift cards and direct top-ups: at most 60 per minute per account (website and issuing API combined).
- Reading gift card details (with the code): at most 120 per minute per account.
- At most 500 cards per batch; face value from 1 to 1,000,000 USD per card.
- At most 20 unrevoked issuing tokens per account, and at most 20 IPs in each token's allowlist.
Security recommendations
- Keep the token on the server side (your storefront backend or your own server). Never put it in web front-end code, an app, or a public repository.
- If you have a fixed outbound IP, set an IP allowlist. Entries match single IPs exactly; ranges are not supported.
- Set a daily limit to cap the loss if the token leaks. The limit counts gift cards plus direct top-ups per UTC day.
- Changing your password or signing out of all sessions does not revoke issuing tokens. If you suspect a leak, revoke the token on the "Issuing tokens" tab; it stops working immediately.
- Turning on two-factor verification revokes all existing issuing tokens, and creating a token after that needs an authenticator code. Calls to these endpoints with a token never need a code.
- The "Issuing tokens" tab shows when and from which IP each token was last used. Check it from time to time.