Card / 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.
Property | Required? | Type | Description |
---|---|---|---|
card.network_token | Required | String | Network Token DPAN (Device Primary Account Number). |
card.holder_name | Required | String | Cardholder's full name. |
card.expiration_month | Required | Integer | A two-digit number representing the Network Token expiration month. |
card.expiration_year | Required | Integer | A four-digit number representing the Network Token expiration year. |
card.cryptogram | Required | String | The unique cryptogram generated by the issuer for the network token in use in the transaction. Optional for recurring transactions. |
card.network_payment_reference | Optional | String | This is the Network Transaction Reference which you can find in the response of the first payment. Highly recommended for Merchant Initiated Transactions (MIT). |
Network Transaction Reference
Please note that if the transaction was initiated by the customer (CIT), the Network Transaction Reference will be found in the
card.network_tx_reference
field that corresponds to the transaction ID for VISA and traceID for Mastercard.
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,
"network_payment_reference": "MCC000000355"
},
"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",
"network_tx_reference": "MCC000000355"
},
"order_id": "657434343",
"status": "PAID",
"notification_url": "http://merchant.com/notifications"
}
Updated 23 days ago