# Open a tokenization 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`.

Endpoint: POST /card-tokenization
Security: ClientKey, SecretKey

## Security:

  - `ClientKey` (unknown)
    apiKey in header X-Dime-Client

  - `SecretKey` (unknown)
    http bearer

## Request fields (application/json):

  - `id` (string)
    Your own reference for this request. Returned as `reference_id` on the card.
    Example: 3f8a1e02-9c4d-4b71-a5e3-6d2f0b8c7a19

  - `currency` (string)
    Enum: "USD", "JMD", "GBP", "EUR", "TTD", "BBD", "XCD", "GYD", "SRD"

  - `webhookUrl` (string)
    Required (or its alias `callbackUrl`). Where Dime POSTs the tokenization request's result.
    Example: https://example.com/hooks/card

  - `callbackUrl` (string)
    Alias of `webhookUrl`, kept for v1 parity. Used only when `webhookUrl` is absent.
    Example: https://example.com/hooks/card

  - `redirectUrl` (string)
    Where to send the customer after they enter their card.
    Example: https://example.com/done

  - `returnUrl` (string)
    Alias of `redirectUrl`, kept for v1 parity. Used only when `redirectUrl` is absent.
    Example: https://example.com/done

  - `lang` (string)
    Example: en

## Request examples:

  - `basic` (unknown)

## Response 201:

  - `201` (unknown)
    The tokenization request was opened.

## Response 201 fields (application/json):

  - `object` (string)
    Enum: "card_request"

  - `token` (string)
    The tokenization request's token. Use it to verify and to retrieve the card.
    Example: crq_lnM3xzwx_nFcWA9XR_bVWBl76P_slIlKTM

  - `status` (string)
    `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"

  - `currency` (string)
    Enum: "USD", "JMD", "GBP", "EUR", "TTD", "BBD", "XCD", "GYD", "SRD"

  - `verification_attempts` (integer)
    Example: 0

  - `last_four_digits` (string | null)
    Example: 4242

  - `card_scheme` (string | null)
    Example: VISA

  - `card_expiry` (string | null)
    Example: 12/29

  - `expired` (boolean)
    Example: true

  - `metadata` (object | null)

  - `created_at` (string)
    Example: 2026-08-26T00:48:52.252Z

  - `card_url` (string)
    Present on create. The hosted capture page.
    Example: https://pay.sandbox.dimepay.app/e-card/m82yalYupLIdpAz/crq_lnM3xzwx_nFcWA9XR_bVWBl76P_slIlKTM

## Response 400:

  - `400` (unknown)
    The request was rejected.

## Response 400 fields (application/json):

  - `error` (object, required)

  - `error.type` (string, required)
    Which kind of failure occurred. Always one of four values, so
a client can branch on `type` before reading `code`.
    Enum: "invalid_request_error", "card_error", "idempotency_error", "api_error"

  - `error.code` (string, required)
    Example: parameter_missing

  - `error.message` (string, required)
    Example: Order ID is required.

  - `error.param` (string)
    The field that caused the failure, when applicable.
    Example: id

## Response 401:

  - `401` (unknown)
    The client key or secret key was missing, not recognized, or the two do not belong to the same key.

## Response 401 fields (application/json):

  - `error` (object, required)

  - `error.type` (string, required)
    Which kind of failure occurred. Always one of four values, so
a client can branch on `type` before reading `code`.
    Enum: "invalid_request_error", "card_error", "idempotency_error", "api_error"

  - `error.code` (string, required)
    Example: parameter_missing

  - `error.message` (string, required)
    Example: Order ID is required.

  - `error.param` (string)
    The field that caused the failure, when applicable.
    Example: id

## Response 201 examples:

  - `Captured from a live sandbox response` (unknown)

## Response 400 examples:

  - `A required field was absent` (unknown)

## Response 401 examples:

  - `unauthorized` (unknown)

  - `Client key sent without its secret key` (unknown)

