Skip to content
GLORESEND

API reference

Simulate a card purchase

POST/test/cards/{id}/authorizationsSandbox only

Sandbox only. Records a simulated purchase on a Sandbox card so you can test transaction lists and balances. Declined if the card is not active or its balance is too low.

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

Parameters

  • idstring · pathrequired

    max length 64

Request body

  • amountintegerrequired

    min 1 · max 250,000

  • merchant_namestringoptional

    min length 1 · max length 80 · default "Test Merchant"

Example request

curl -X POST "https://api.gloresend.com/sandbox/v1/test/cards/card_9f8e7d6c5b4a3f2e1d0c/authorizations" \
  -H "Authorization: Bearer $GLORESEND_TEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 1299,
    "merchant_name": "Test Merchant"
  }'

Response · 201

201 · application/json
{
  "id": "ctx_1a2b3c4d5e6f7g8h9i0j",
  "object": "card_transaction",
  "card_id": "card_9f8e7d6c5b4a3f2e1d0c",
  "type": "authorization",
  "status": "succeeded",
  "amount": 1299,
  "currency": "USD",
  "merchant": {
    "name": "Test Merchant",
    "mcc": "5734",
    "country": "US"
  },
  "created_at": "2026-10-15T09:31:00.000Z",
  "test_data": true
}
Response fields
  • idstringrequired
  • objectenumrequired

    "card_transaction"

  • card_idstringrequired
  • typestringrequired
  • statusstringrequired
  • amountintegerrequired

    Amount in USD cents.

  • currencystringrequired
  • merchantobjectrequired
  • merchant.namestring | nullrequired
  • merchant.mccstring | nullrequired
  • merchant.countrystring | nullrequired
  • created_atstringrequired
  • 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.
  • 400validation_errorThe request body, query or headers failed validation. param points at the first invalid field.
  • 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.
  • 403sandbox_onlyThis endpoint only exists in the Sandbox environment.