Skip to content

Card Tokenization

Store a customer's card so you can charge it later without the customer present.

  1. Open a tokenization request with POST /card-tokenization. Send the customer to the card_url in the response.
  2. The customer enters their card. Dime places a small verification charge on it: a random 0.30–0.99 USD, converted to the request's currency. The charge is not refunded.
  3. The customer reads the amount from their statement, and you submit it with PUT /card-tokenization/verify.
  4. Call GET /cards/{card_request_token}. The response's token is the card token.
  5. Charge the card token with POST /payments/sale or POST /payments/auth.

In sandbox the verification charge is always 65, and verify also accepts 1.58, 28 or 32.46.

Open a tokenization request

Request

Returns card_url, the hosted page where the customer enters their card. webhookUrl is required: the customer enters the card on Dime's page, so the webhook is how you learn the outcome. Expect card_request.succeeded once the customer verifies, or card_request.failed. Some cards also send card_request.card_saved first; see Webhooks. Omitting it returns 400 parameter_missing.

Security
ClientKey and SecretKey
Bodyapplication/jsonrequired
idstring

Your own reference for this request. Returned as reference_id on the card.

Example:"3f8a1e02-9c4d-4b71-a5e3-6d2f0b8c7a19"
currencystring(Currency)
Enum:"USD""JMD""GBP""EUR""TTD""BBD""XCD""GYD""SRD"
Example:"JMD"
webhookUrlstring, (uri)

Required (or its alias callbackUrl). Where Dime POSTs the tokenization request's result.

Example:"https://example.com/hooks/card"
redirectUrlstring, (uri)

Where to send the customer after they enter their card.

Example:"https://example.com/done"
langstring
Example:"en"
callbackUrlstring, (uri)deprecated

Alias of webhookUrl, kept for v1 parity. Used only when webhookUrl is absent.

Example:"https://example.com/hooks/card"
returnUrlstring, (uri)deprecated

Alias of redirectUrl, kept for v1 parity. Used only when redirectUrl is absent.

Example:"https://example.com/done"
curl -i -X POST \
  https://docs.dimepay.net/_mock/apis/v2/dime-v2/card-tokenization \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'X-Dime-Client: YOUR_API_KEY_HERE' \
  -d '{
    "id": "your-reference-1024",
    "currency": "USD",
    "webhookUrl": "https://example.com/hooks/card",
    "redirectUrl": "https://example.com/done"
  }'

Responses

The tokenization request was opened.

Bodyapplication/json
objectstring
Example:"card_request"
Value:"card_request"
tokenstring

The tokenization request's token. Use it to verify and to retrieve the card.

Example:"crq_lnM3xzwx_nFcWA9XR_bVWBl76P_slIlKTM"
statusstring

STARTED: opened, card not yet entered. VERIFICATION: card accepted and the verification charge placed; waiting for PUT /card-tokenization/verify. SUCCESS: verified; the card can be retrieved. FAILED: the card was declined, or verification failed three times.

Enum:"STARTED""VERIFICATION""SUCCESS""FAILED"
Example:"STARTED"
currencystring(Currency)
Enum:"USD""JMD""GBP""EUR""TTD""BBD""XCD""GYD""SRD"
Example:"JMD"
verification_attemptsinteger
Example:0
last_four_digitsstring or null
Example:"4242"
card_schemestring or null
Example:"VISA"
card_expirystring or null
Example:"12/29"
expiredboolean
Example:true
metadataobject or null
created_atstring, (date-time)
Example:"2026-08-26T00:48:52.252Z"
card_urlstring, (uri)

Present on create. The hosted capture page.

Example:"https://pay.sandbox.dimepay.app/e-card/m82yalYupLIdpAz/crq_lnM3xzwx_nFcWA9XR_bVWBl76P_slIlKTM"
Response
{ "object": "card_request", "token": "crq_lnM3xzwx_nFcWA9XR_bVWBl76P_slIlKTM", "status": "STARTED", "currency": "USD", "verification_attempts": 0, "last_four_digits": null, "card_scheme": null, "card_expiry": null, "expired": false, "metadata": { "type": "API", "api_version": "v2", "return_url": "https://example.com/done", "webhook_url": "https://example.com/hooks/card", "reference_id": "your-reference-1024" }, "created_at": "2026-08-26T00:53:02.169Z", "card_url": "https://pay.sandbox.dimepay.app/e-card/m82yalYupLIdpAz/crq_lnM3xzwx_nFcWA9XR_bVWBl76P_slIlKTM" }