Create Card Token Endpoint

Creates a secure token for a credit card along with payer data. This endpoint optionally performs a micro-deposit validation to verify the card's validity.

Tokenize a Credit Card

post

Creates a secure token for a credit card along with payer data. Optionally performs a micro-deposit validation to verify the card's validity.

Header parameters
Content-TypestringRequired

Media type of the body sent to the API

Default: application/json
X-Datestring · date-timeRequired

ISO8601 Datetime with Timezone (yyyy-MM-dd'T'HH:mm:ssZ)

X-LoginstringRequired

Merchant X-Login API Key

AuthorizationstringRequired

Authorization control hash

X-Idempotency-KeystringOptional

Unique idempotency key for ensuring that the same request is not processed more than once

Body
micro_deposit_enabledbooleanOptional

When true (default), performs a micro-deposit to validate the card

Default: trueExample: true
Responses
200
Successful operation
application/json
post
POST /v3/tokenization HTTP/1.1
Host: cc-api-stg.directa24.com
Content-Type: application/json
X-Date: 2025-06-26T10:06:36.968Z
X-Login: text
Authorization: text
Accept: */*
Content-Length: 267

{
  "credit_card": {
    "holder_name": "Luis Perez",
    "expiration_month": 10,
    "expiration_year": 2028,
    "number": "4111111111111111",
    "cvv": "123"
  },
  "payer": {
    "country": "BR",
    "first_name": "John",
    "last_name": "Perez",
    "document_type": "CPF",
    "document": "12345678"
  },
  "micro_deposit_enabled": true
}
{
  "holder_name": "Luis Perez",
  "expiration_month": 10,
  "expiration_year": 2028,
  "last_four_digits": "1111",
  "card_identifier": "CID-2210908e-6d8e-468d-9eb3-d551e8b541a0"
}
Example Request
{
  "credit_card": {
    "holder_name": "Luis Perez",
    "expiration_month": 10,
    "expiration_year": 2028,
    "number": "4111111111111111",
    "cvv": "123"
  },
  "payer": {
    "country": "BR",
    "first_name": "John",
    "last_name": "Perez",
    "document_type": "DNI",
    "document": "12345678"
  },
  "micro_deposit_enabled": true
}

Parameters

Credit Card Object

Field
Type
Required
Description

holder_name

String

Yes

Name of the cardholder as it appears on the card

expiration_month

Integer

Yes

Expiration month (1-12)

expiration_year

Integer

Yes

Expiration year (YYYY format)

number

String

Yes

Complete card number without spaces

cvv

String

Yes

Card security code (3-4 digits)

Payer Object

Field
Type
Required
Description

country

String

Yes

Country ISO code (2 characters)

first_name

String

Yes

Payer's first name

last_name

String

Yes

Payer's last name

document_type

String

Yes

Type of identity document (e.g., DNI, CPF, PASSPORT)

document

String

Yes

Identity document number

Additional Parameters

Field
Type
Required
Description

micro_deposit_enabled

Boolean

No

When true (default), performs a micro-deposit to validate the card

Response

Success Response (200 OK)

{
  "holder_name": "Luis Perez",
  "expiration_month": 10,
  "expiration_year": 2028,
  "last_four_digits": "1111",
  "card_identifier": "CID-2210908e-6d8e-468d-9eb3-d551e8b541a0"
}

Response Fields

Field
Type
Description

holder_name

String

Cardholder name

expiration_month

Integer

Expiration month

expiration_year

Integer

Expiration year

last_four_digits

String

Last four digits of the card

card_identifier

String

Unique card identifier (token) for future transactions

Error Responses

HTTP Status
Error Code
Description

401

512

Unauthorized access

Error Response Example

{
    "code": 510,
    "description": "Token not found"
}

Integration Example

cURL Example

curl -X POST https://cc-api-stg.directa24.com/v3/tokenization \
  -H "Content-Type: application/json" \
  -H "X-Date: $(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
  -H "X-Login: YOUR_API_LOGIN_KEY" \
  -H "Authorization: YOUR_AUTHORIZATION_HASH" \
  -d '{
  "credit_card": {
    "holder_name": "Luis Perez",
    "expiration_month": 10,
    "expiration_year": 2028,
    "number": "4111111111111111",
    "cvv": "123"
  },
  "payer": {
    "country": "BR",
    "first_name": "John",
    "last_name": "Perez",
    "document_type": "CPF",
    "document": "12345678"
  },
  "micro_deposit_enabled": true
}'

Notes

  • For security reasons, the complete card number and CVV are never returned in any response

  • The token (card_identifier) is valid only for your merchant account

  • The micro-deposit is a small charge that is immediately refunded

  • Ensure all request data is properly encoded and valid before submitting

Last updated

Was this helpful?