Skip to content
GLORESEND

API reference

Terminate a card

POST/cards/{id}/terminate

Permanently closes the card. Withdraw the balance first, down to the $5.00 minimum the issuer keeps on each card; a larger balance returns card_state_conflict. In the Sandbox the remaining minimum returns to your wallet immediately; in Live it is refunded once the issuer releases it (up to 45 days).

Required scope
cards:write
Idempotency-Key
Not used
Environments
Sandbox and Live

Parameters

  • idstring · pathrequired

    max length 64

Example request

curl -X POST "https://api.gloresend.com/sandbox/v1/cards/card_9f8e7d6c5b4a3f2e1d0c/terminate" \
  -H "Authorization: Bearer $GLORESEND_TEST_KEY"

Response · 200

200 · application/json
{
  "id": "card_9f8e7d6c5b4a3f2e1d0c",
  "object": "card",
  "environment": "sandbox",
  "product": "visa-404",
  "network": "Visa",
  "currency": "USD",
  "status": "terminated",
  "cardholder": {
    "first_name": "Ada",
    "last_name": "Example",
    "email": "ada@example.com"
  },
  "last4": "4242",
  "expiry_month": "10",
  "expiry_year": "2029",
  "balance": 5000,
  "reference": "EMP-0042",
  "metadata": {},
  "created_at": "2026-10-15T09:30:00.000Z",
  "test_data": true
}
Response fields
  • idstringrequired
  • objectenumrequired

    "card"

  • environmentenumrequired

    "sandbox", "live"

  • productstringrequired
  • networkenumrequired

    "Visa", "Mastercard"

  • currencyenumrequired

    "USD"

  • statusenumrequired

    "active", "frozen", "terminated"

  • cardholderobjectrequired
  • cardholder.first_namestringrequired

    min length 1 · max length 50 · pattern ^[\p{L} '\-.]+$/u

  • cardholder.last_namestringrequired

    min length 1 · max length 50 · pattern ^[\p{L} '\-.]+$/u

  • cardholder.emailstringrequired

    max length 254 · email

  • last4stringrequired
  • expiry_monthstringrequired
  • expiry_yearstringrequired
  • balanceintegerrequired

    Card balance in USD cents, as of the last operation through GLORESEND.

  • referencestring | nullrequired
  • metadatamap of stringrequired
  • created_atstringrequired

    date-time

  • test_databooleanrequired

Errors

  • 401authentication_requiredNo credentials were supplied. Send Authorization: Bearer <api key>.
  • 401invalid_api_keyThe API key is unknown, revoked or expired.
  • 401environment_mismatchThe API key belongs to a different environment than the base URL you called. Sandbox keys (gs_test_) only work against the Sandbox base URL, Live keys (gs_live_) only against the Live base URL.
  • 429rate_limitedToo many requests. Wait for the number of seconds in the Retry-After header.
  • 403insufficient_scopeThe API key does not have the scope required for this endpoint.
  • 404not_foundThe requested resource does not exist or is not visible to this API key.
  • 409card_state_conflictThe operation is not allowed in the card's current state (for example funding a frozen or terminated card, or terminating a card that still has a balance).
  • 403activation_requiredLive card programs require an activated account (business verification and setup fee).
  • 503live_operations_disabledLive money movement is not enabled on this deployment. No provider has been authorized yet.
  • 503provider_not_configuredNo payment provider is configured for this environment and operation.
  • 502provider_errorThe downstream provider returned an error. The transfer was marked as failed and reserved funds were released.
  • 504provider_timeoutThe downstream provider did not answer in time. The transfer was marked as failed and reserved funds were released.