Network tokens

Learn how to handle network token payments.

Network tokens are digital representations of sensitive payment card data, such as credit card numbers, issued by payment networks like Visa, Mastercard, or American Express. These tokens are used to replace actual card data during transactions, enhancing security by reducing exposure to potential fraud.

Request fields

These fields should be added to the Card Object request for sending payments with network tokens.

PropertyRequired?TypeDescription
card.network_tokenRequiredStringNetwork Token DPAN (Device Primary Account Number).
card.holder_nameRequiredStringCardholder's full name.
card.expiration_monthRequiredIntegerA two-digit number representing the Network Token expiration month.
card.expiration_yearRequiredIntegerA four-digit number representing the Network Token expiration year.
card.cryptogramRequiredStringThe unique cryptogram generated by the issuer for the network token in use in the transaction. Optional for recurring transactions.

Example code

Here is a complete example of payment with a network token:

curl -X POST \
   -H 'X-Date: 2018-02-20T15:44:42.310Z' \
   -H 'X-Login: sak223k2wdksdl2' \
   -H 'X-Trans-Key: fm12O7G9' \
   -H 'Content-Type: application/json' \
   -H 'X-Version: 2.1' \
   -H 'User-Agent: MerchantTest / 1.0 ' \
   -H 'Authorization: V2-HMAC-SHA256, Signature: 1bd227f9d892a7f4581b998c21e353b1686a6bdad5940e7bb6aa596c96e0a6ec' \
   -d '{body}'
   https://api.dlocal.com/secure_payments

{
    "amount": 120.00,
    "currency" : "BRL",
    "country": "BR",
    "payment_method_id" : "VD",
    "payment_method_flow" : "DIRECT",
    "payer":{
        "name" : "Thiago Gabriel",
        "email" : "[email protected]",
        "document" : "53033315550",
        "user_reference": "12345",
        "address": {
            "state"  : "Rio de Janeiro",
            "city" : "Volta Redonda",
            "zip_code" : "27275-595",
            "street" : "Servidao B-1",
            "number" : "1106"
        }
    },
    "card":{
        "holder_name" : "Thiago Gabriel",
        "network_token" : "4111111111111111",
        "cryptogram" : "CCADBxYzRTBBXXXXXXXYZa0AbZD=",
        "expiration_month" : 10,
        "expiration_year" : 2040
    },
    "order_id": "657434343",
    "notification_url": "http://merchant.com/notifications"
}
{
    "id": "D-4-80ca7fbd-67ad-444a-aa88-791ca4a0c2b2",
    "amount": 120.00,
    "currency" : "BRL",
    "country": "BR",
    "payment_method_id" : "VD",
    "payment_method_flow" : "DIRECT",
    "payer":{
        "name" : "Thiago Gabriel",
        "email" : "[email protected]",
        "document" : "53033315550",
        "user_reference": "12345",
        "address": {
            "state"  : "Rio de Janeiro",
            "city" : "Volta Redonda",
            "zip_code" : "27275-595",
            "street" : "Servidao B-1",
            "number" : "1106"
        }
    },
    "card": {
        "holder_name": "Thiago Gabriel",
        "expiration_month": 10,
        "expiration_year": 2040,
        "brand": "VI"
    },
    "order_id": "657434343",
    "status": "PAID",
    "notification_url": "http://merchant.com/notifications"
}