# Verify a tokenization request

Confirms the customer controls the card: submit the verification
amount from their statement as `value`. A correct amount sets
`status: SUCCESS` and returns the stored card.
A wrong amount returns `402` (`card_declined`, `param: value`) and
leaves the request open. The third wrong amount closes it: `status`
becomes `FAILED`, and later attempts return `400`. Open a new card
request to try again.

Endpoint: PUT /card-tokenization/verify
Security: ClientKey, SecretKey

## Security:

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

  - `SecretKey` (unknown)
    http bearer

## Request fields (application/json):

  - `token` (string, required)
    The tokenization request's `token` (`cr_…`).
    Example: crq_lnM3xzwx_nFcWA9XR_bVWBl76P_slIlKTM

  - `value` (number, required)
    The verification amount the customer saw on their
statement. In sandbox, send 65 (or 1.58, 28 or 32.46).
    Example: 0.47

## Request examples:

  - `verify` (unknown)

## Response 200:

  - `200` (unknown)
    Verified. The card is now retrievable.

## Response 200 fields (application/json):

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

  - `token` (string)
    The card token. Pass it as `token` to `POST /payments/sale` or `POST /payments/auth`.
    Example: crd_lYW5MOH2_omvDipze_0iG9s67K_hUwjeHr

  - `card_request_token` (string)
    The `token` of the tokenization request this card came from. Not accepted by the payment endpoints.
    Example: crq_lnM3xzwx_nFcWA9XR_bVWBl76P_slIlKTM

  - `reference_id` (string | null)
    The `id` you supplied when opening the request.
    Example: 3f8a1e02-9c4d-4b71-a5e3-6d2f0b8c7a19

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

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

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

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

  - `expired` (boolean)
    Example: true

  - `metadata` (object | null)

## 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 402:

  - `402` (unknown)
    The amount did not match.

## Response 402 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 404:

  - `404` (unknown)
    No record matches the token in the request. A database id in a URL
also ends here: v2 looks records up by token only.

## Response 404 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 200 examples:

  - `The verified card` (unknown)

## Response 400 examples:

  - `A required field was absent` (unknown)

## Response 401 examples:

  - `unauthorized` (unknown)

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

## Response 402 examples:

  - `declined` (unknown)

## Response 404 examples:

  - `missing` (unknown)

