Globagift Docs
API / Developers

Conventions

How the Globagift API handles amounts, idempotent retries, errors, pagination, timestamps and rate limits.

Requests and responses

  • Requests and responses are JSON. Send Content-Type: application/json with a body.
  • Identifiers are UUIDs.
  • Timestamps are ISO 8601 in UTC, for example 2026-11-04T10:25:29.438Z.
  • Fields can be added to responses over time. Ignore fields you do not use.

Amounts and currency

Amounts are integer minor units: 1250 in EUR means EUR 12.50. Never send decimals. Currencies are three-letter ISO 4217 codes such as EUR.

Each card product has one currency and a minimum and maximum amount. Issuing outside that range returns 422 with code invalid_amount.

Retries and idempotency

Networks fail, and a request can succeed even when its response never arrives. Each operation in the reference says how to retry it.

Operations with an Idempotency-Key header (issuing a card, redeeming and reserving float) are safe to retry:

  • Send a unique key per logical action, such as your order or line id. Keys can be up to 255 characters.
  • Repeating the request with the same key and the same body returns the original result. A replayed issue or redemption returns 200 instead of 201.
  • The same key with a different body returns 409 with code idempotency_key_conflict.
  • A missing key returns 400 with code idempotency_key_required.

Retrying a redemption needs a new signature as well: keep the same Idempotency-Key and body, but use a fresh timestamp and nonce. Re-sending the identical signed request is refused, because each nonce works once.

One-time values are not repeated. A replayed issue or distributor capture returns the same card without the claim code, so store the claim code from the first success before you do anything else.

Operations marked not idempotent (for example creating an acceptance point, or suspending or voiding a card) should not be retried blindly. Read the current state first, then decide.

Errors

Errors use RFC 9457 problem details with the application/problem+json media type:

{
  "type": "about:blank",
  "status": 422,
  "code": "insufficient_balance",
  "title": "insufficient card balance"
}

Branch on status and code. title is for people and can change. New codes may be added, so handle unknown codes by their status.

StatusCodeMeaning
400validation_failedThe request is malformed or a field is invalid
400idempotency_key_requiredThe operation needs an Idempotency-Key header
401authentication_failedThe API key is missing, malformed or revoked
401invalid_signatureAn acceptance-point signature was refused
403insufficient_scopeThe key does not have the scope this operation needs
404not_foundNot found, or not visible to this key
409idempotency_key_conflictThe key was already used with a different body
409state_conflictThe resource is not in a state that allows this action
422invalid_amountThe amount is outside the product's range
422insufficient_balanceThe card does not have enough balance
422card_not_redeemableThe card cannot be redeemed, for example because it is suspended
422insufficient_floatA distributor does not have enough available float
429rate_limitedToo many requests; wait for the Retry-After header
500internal_errorAn unexpected error. Retry only if the operation is safe to retry

Not found means not found or not yours

For anything you are not allowed to see, the API returns the same 404 as for something that does not exist. A card from another merchant, a merchant that has not granted a distributor, or another distributor's reservation all look like an unknown id. Do not use 404 to probe for what exists.

A voided card is treated the same way by the public balance and claim endpoints: they return 404, not a zero balance.

Pagination

Card, redemption and event lists use cursors:

  • Pass limit (default 50, maximum 100).
  • Each page includes next_cursor. Pass it back as after_cursor for the next page.
  • next_cursor is null on the last page.
curl -s "$GG_BASE/v1/cards?limit=50&after_cursor=NEXT_CURSOR" -H "Authorization: Bearer $GG_KEY"

The product list uses limit and offset and returns a total.

Rate limits

The public claim and balance endpoints are limited to 10 requests a minute from each client IP address. Over the limit, they return 429 with a Retry-After header in seconds.

These limits are designed for cardholders calling from their own devices. If your servers will call them on behalf of many cardholders, talk to us first.

On this page