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. 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. 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. 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
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" }'
Create gift cards response
{
  "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.

GET/api/issuer/v1/balanceBalance

Returns 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.

POST/api/issuer/v1/codesCreate gift cards

Charges 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.

ParameterRequiredDescription
sourceTypeYesprovider, referrer or api; see Funding sources.
amountUsdYesFace value per card in USD, 1 to 1,000,000, at most two decimals.
countNoNumber of cards, 1 to 500. Defaults to 1.
labelNoNote of up to 120 characters, such as an order ID or channel. Searchable in the list.
idempotencyKeyYesIdempotency key of up to 100 characters. Can also be sent as the Idempotency-Key header.
GET/api/issuer/v1/codesList gift cards

Returns { 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.

ParameterRequiredDescription
statusNoactive, voiding, voided, redeemed or frozen.
sourceTypeNoFilter by funding source.
batchIdNoOnly one batch.
searchNoSearch by note or the last 4 characters of the code.
codeNoA full code, matched exactly. Useful for buyer disputes.
cursorNonextCursor from the previous page.
limitNoPage size, default 50, maximum 200.
GET/api/issuer/v1/codes/:idGift card details

Returns one gift card including the code and redeemUrl. Every read of a code is recorded in the audit log.

POST/api/issuer/v1/codes/:id/voidVoid a gift card

Only 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.

POST/api/issuer/v1/codes/:id/void/cancelCancel a void

Cancels 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.

POST/api/issuer/v1/direct-topupsDirect top-up

Adds the amount straight to another account's API credits without creating a code; the recipient is notified. Returns { direct, replayed }.

ParameterRequiredDescription
sourceTypeYesprovider or referrer. The API credits source cannot be used for direct top-ups.
recipientIdentifierYesThe recipient's receive code (PAY-XXXX-XXXX) or account email. Cannot be yourself.
amountUsdYesAmount in USD, 1 to 1,000,000, at most two decimals.
labelNoNote of up to 120 characters.
idempotencyKeyYesIdempotency key of up to 100 characters. Can also be sent as the Idempotency-Key header.

Funding sourceslink

sourceTypeFunding sourceNotes
providerProvider earningsYour withdrawable earnings as a Provider. Requires a Provider account whose settlement is not frozen.
referrerReferral commissionYour withdrawable referral commission.
apiAPI 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

statusMeaning
activeUnredeemed and can be redeemed.
redeemedRedeemed; the face value is in the redeemer's API credits.
voidingBeing voided and can no longer be redeemed. You can cancel the void during the 72-hour cooldown.
voidedVoided; the face value has returned to the original funding source.
frozenFrozen 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.

codeHTTPMeaning and what to do
invalid_issuer_token401No token, a malformed token, or a token that does not exist or was revoked.
issuer_token_ip_not_allowed403The request IP is not in this token's IP allowlist.
issuer_token_daily_limit_exceeded429Gift cards plus direct top-ups made with this token today (UTC) would exceed its daily limit.
rate_limited429Too many requests. Retry later with the same idempotency key.
issued_credits_disabled403The platform has paused new issuance. Issued gift cards can still be redeemed, and querying, voiding and cancelling voids still work.
issuer_not_eligible403This account cannot issue gift cards.
invalid_source_type400sourceType is not provider, referrer or api.
invalid_amount400The amount is outside 1 to 1,000,000 or has more than two decimals.
invalid_count400count is not a whole number from 1 to 500.
invalid_label400label is not a string or is longer than 120 characters.
invalid_idempotency_key400The idempotency key is missing or longer than 100 characters.
insufficient_withdrawable_balance400Not enough withdrawable Provider earnings or referral commission.
insufficient_balance400Not enough API credits.
api_source_not_eligible403The account cannot issue from API credits; see api.disqualifiedBy in the balance response.
api_source_direct_not_supported400The API credits source cannot be used for direct top-ups.
provider_profile_not_found404The provider source was chosen, but the account has no Provider account.
provider_settlement_frozen403Provider settlement is frozen, so Provider earnings cannot be used.
withdrawable_balance_mismatch409Balance reconciliation failed. Please contact support.
recipient_required400The direct top-up has no recipient.
recipient_not_found404No account matches this receive code or email.
recipient_not_eligible403That account cannot receive credits right now.
cannot_transfer_to_self400You cannot top up your own account.
idempotency_key_conflict409The idempotency key was already used for a request with different parameters.
issued_credit_not_found404The card does not exist, is not yours, or (when voiding) is not active.
issued_credit_not_voiding409The card is not being voided, or the cooldown has ended, so the void cannot be cancelled.
code_generation_failed503Codes 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.
  • The "Issuing tokens" tab shows when and from which IP each token was last used. Check it from time to time.