CartirraAPI
Get API keys

Issue a gift card

posthttps://api.cartirra.com/v1/gift-cards

Issue a gift card; the code is shown only now.

Authentication
Secret key (Authorization: Bearer sk_…). How keys work
Permission
loyalty:manage
Idempotency
Idempotency-Key header recommended: a retry with the same key returns the first response. Details

Headers

  • Idempotency-Keystring

    Unique per request; replays return the first response

Request body required

JSON (Content-Type: application/json).

  • amountMoneyDtorequired
  • expires_atstring (date-time)nullable
  • recipientGiftCardRecipientDto

Responses

201CreatedIssuedGiftCardResponse
  • idstringrequired
  • last4stringrequired

    Example JK23

  • initial_amountMoneyResponserequired
  • balanceMoneyResponserequired
  • statusstringrequired

    One of active, disabled

  • expires_atstring (date-time)nullablerequired
  • recipientGiftCardRecipientResponsenullable
  • created_atstringrequired
  • codestringrequired

    Shown only now; Cartirra keeps a hash

    Example GC-ABCD-EFGH-JK23

Errors

Every error has the same body: { "error": { "code", "message", "details"?, "request_id" } }. See Errors for every code.

  • 400The request is malformed or a field is invalid (`VALIDATION_FAILED`).
  • 401Missing, malformed, revoked or expired API key (`UNAUTHENTICATED`), or a key this route does not accept, such as a public key (`CREDENTIAL_NOT_ACCEPTED`).
  • 403The key may not do this (`PERMISSION_DENIED`, `LIVE_MODE_NOT_ENABLED`, `PLAN_LIMIT_REACHED`, …).
  • 409The resource is in a state that does not allow this (for example `ORDER_NOT_CANCELLABLE`, `REFUND_NOT_ALLOWED`).
  • 422The request is valid but breaks a business rule.
  • 429Too many requests for this key (`RATE_LIMITED`); wait for `Retry-After` seconds.
  • 500Something went wrong on our side (`INTERNAL`). Safe to retry with the same `Idempotency-Key`.