For credit card payments you can use the card information only if you business is Full PCI DSS compliant. Otherwise you need to securely collect the card information using Smart Fields.
For recurring payments, first save the card, and then use the card_id
to charge the card.
Important: If you are making a payment with credit card information or a Google Pay™ token, you need to use the following endpoint: https://api.dlocal.com/secure_payments
Card payments with a card_id
or token
should use the endpoint: https://api.dlocal.com/payments
currency
)CARD
for card payments.DIRECT
or REDIRECT
DIRECT
payment_method_flow.REDIRECT
payment flow.{"id": "PAY2323243343543","amount": 120.00,"currency" : "USD","country": "BR","payment_method_id" : "CARD","payment_method_type" : "CARD","payment_method_flow" : "DIRECT","card":{"holder_name": "Thiago Gabriel","expiration_month": 10,"expiration_year": 2040,"last4": "1111","brand": "VI"},"created_date" : "2018-02-15T15:14:52-00:00","approved_date" : "2018-02-15T15:14:52-00:00","status" : "PAID","status_code" : "200","status_detail" : "The payment was paid.","order_id": "657434343","notification_url": "http://merchant.com/notifications"}
Property | Type | Description |
| String | User's full name. Required. |
| String | User’s email address. Required. |
| String | User’s birthdate (DD-MM-YYYY). Optional. |
| String | User’s phone. Optional. |
| String | User’s personal identification number. Click here for more details. Required. |
| String | Unique user id at the merchant side. Optional. |
| User’s address. Only required in India. | |
| String | User's IP address. |
| String | User's unique device identifier. |
{"name" : "Thiago Gabriel","email" : "thiago@example.com","document" : "53033315550","user_reference": "12345","address": {"state" : "Rio de Janeiro","city" : "Volta Redonda","zip_code" : "27275-595","street" : "Servidão B-1","number" : "1106"},"ip" : "179.27.83.210","device_id" : "2fg3d4gf234"}
Property | Type | Description |
| String | User's address state. Optional. |
| String | User’s address city. Only required in India. |
| String | User’s address zip_code. Optional. |
| String | User’s address street. Only required in India. |
| String | User’s address number. Only required in India. |
{"state" : "Rio de Janeiro","city" : "Volta Redonda","zip_code" : "27275-595","street" : "Servidão B-1","number" : "1106"}
For credit card payments you can use the card information only if you business is Full PCI DSS compliant. Otherwise you need to collect the card information using Smart Fields. For recurring payments, make a payment with "save": true
and use the card_id
from the response for future payments.
Important: If you are making a payment with credit card information, you need to use the following endpoint instead: https://api.dlocal.com/secure_payments
Card payments with a card_id
or token
should use the endpoint: https://api.dlocal.com/payments
Property | Type | Description |
| String | Cardholder's full name. Required if |
| Integer | Two digit number representing the card's expiration month. Required if |
| Integer | Four digit number representing the card's expiration year. Required if |
| String | The card number, as a string without any separators. Required if |
| String | Credit card verification value. Optional. Required for India. |
| String | JWE encrypted params. Optional. |
| String | Temporary credit card token securely created using Smart Fields. Optional. |
| String | Temporary CVV token securely created using the CVV-only Smart Field. |
| String | Credit card id returned by the Create a Card call. Optional. |
| String | Number of installments. Default 1. Optional. |
| String | Installments id of a installments plan. Optional. |
| String | Dynamic Descriptor. Optional. |
| Boolean | Whether or not to immediately capture the charge. When false, the charge issues an authorization, and will need to be captured later. Default |
| Boolean | Whether or not to save the card for future payments. Response will include a |
{"holder_name": "Thiago Gabriel","expiration_month": 10,"expiration_year": 2040,"number": "4111111111111111","cvv": "123"}
{"token":"CV-124c18a5-874d-4982-89d7-b9c256e647b5"}
{"card_id":"CV-hgv23jh4g-n23n-kj3k-bkhb3-kj3hj3gjh3k3"}
The following example applies for credit card payments using the plain credit card information (only for Full PCI DSS merchants). To make payments using encrypted card information, simply replace the number
and cvv
parameters with encrypted_data
.
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" : "USD","country": "BR","payment_method_id" : "CARD","payment_method_flow" : "DIRECT","payer":{"name" : "Thiago Gabriel","email" : "thiago@example.com","document" : "53033315550","user_reference": "12345","address": {"state" : "Rio de Janeiro","city" : "Volta Redonda","zip_code" : "27275-595","street" : "Servidao B-1","number" : "1106"},"ip" : "179.27.83.210","device_id" : "2fg3d4gf234"},"card":{"holder_name" : "Thiago Gabriel","number" : "4111111111111111","cvv" : "123","expiration_month" : 10,"expiration_year" : 2040},"order_id": "657434343","notification_url": "http://merchant.com/notifications"}
{"id": "D-4-cf8eef6b-52d5-4320-b5ea-f5e0bbe4343f","amount": 120,"currency": "USD","payment_method_id": "CARD","payment_method_type": "CARD","payment_method_flow": "DIRECT","country": "BR","card": {"holder_name": "Thiago Gabriel","expiration_month": 10,"expiration_year": 2040,"brand": "VI","last4": "1111"},"created_date": "2018-12-26T20:26:09.000+0000","approved_date": "2018-12-26T20:26:09.000+0000","status": "PAID","status_detail": "The payment was paid","status_code": "200","order_id": "657434343","notification_url": "http://merchant.com/notifications"}
The following example applies for credit card payments using a Smart Fields 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/payments
{"amount": 120.00,"currency" : "USD","country": "BR","payment_method_id" : "CARD","payment_method_flow" : "DIRECT","payer":{"name" : "Thiago Gabriel","email" : "thiago@example.com","document" : "53033315550","user_reference": "12345","address": {"state" : "Rio de Janeiro","city" : "Volta Redonda","zip_code" : "27275-595","street" : "Servidao B-1","number" : "1106"},"ip" : "179.27.83.210","device_id" : "2fg3d4gf234"},"card":{"token": "CV-124c18a5-874d-4982-89d7-b9c256e647b5"},"order_id": "657434343","notification_url": "http://merchant.com/notifications"}
{"id": "D-4-80ca7fbd-67ad-444a-aa88-791ca4a0c2b2","amount": 120,"currency": "USD","payment_method_id": "CARD","payment_method_type": "CARD","payment_method_flow": "DIRECT","country": "BR","card": {"holder_name": "Thiago Gabriel","expiration_month": 10,"expiration_year": 2040,"brand": "VI","last4": "1111"},"created_date": "2018-12-26T20:28:47.000+0000","approved_date": "2018-12-26T20:28:47.000+0000","status": "PAID","status_detail": "The payment was paid","status_code": "200","order_id": "657434343","notification_url": "http://merchant.com/notifications"}
The following example applies for credit card payments using a the card_id
gotten in the Create a Card method.
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/payments
{"amount": 120.00,"currency" : "USD","country": "BR","payment_method_id" : "CARD","payment_method_flow" : "DIRECT","payer":{"name" : "Thiago Gabriel","email" : "thiago@example.com","document" : "53033315550","user_reference": "12345","address": {"state" : "Rio de Janeiro","city" : "Volta Redonda","zip_code" : "27275-595","street" : "Servidao B-1","number" : "1106"},"ip" : "179.27.83.210","device_id" : "2fg3d4gf234"},"card":{"card_id": "CID-124c18a5-874d-4982-89d7-b9c256e647b5"},"order_id": "657434343","notification_url": "http://merchant.com/notifications"}
{"id": "D-4-80ca7fbd-67ad-444a-aa88-791ca4a0c2b2","amount": 120,"currency": "USD","payment_method_id": "CARD","payment_method_type": "CARD","payment_method_flow": "DIRECT","country": "BR","card": {"holder_name": "Thiago Gabriel","expiration_month": 10,"expiration_year": 2040,"brand": "VI","last4": "1111"},"created_date": "2018-12-26T20:28:47.000+0000","approved_date": "2018-12-26T20:28:47.000+0000","status": "PAID","status_detail": "The payment was paid","status_code": "200","order_id": "657434343","notification_url": "http://merchant.com/notifications"}