Cash (Ticket) Payments

Redirect Cash Payments

All Cash (TICKET) payment methods offer a redirect solution (payment_method_flow = REDIRECT). The API returns a redirect_URL, which is used to redirect the user to a dLocal-hosted page. The user will be able to see the ticket in order to print it or pay using their home banking.
Using the Redirect method, the payment will have the PENDING status until the user pays the ticket, and dLocal gets notified.
The usage of the redirect_url must be with a GET operation.
Starting May 1st 2021, the redirect_url will start returning an HTTP 200 OK with the HTML content of the ticket. This will be instead of the HTTP 302 FOUND ,that used to generate a double redirect.
The example below belongs to payment using OXXO in Mexico. For a full list of TICKET payment methods available, visit the Payment Methods page.
Example Request
Example Response

Example Request

1
curl -X POST \
2
-H 'X-Date: 2018-02-20T15:44:42.310Z' \
3
-H 'X-Login: sak223k2wdksdl2' \
4
-H 'X-Trans-Key: fm12O7G9' \
5
-H 'Content-Type: application/json' \
6
-H 'X-Version: 2.1' \
7
-H 'User-Agent: MerchantTest / 1.0 ' \
8
-H 'Authorization: V2-HMAC-SHA256, Signature: 1bd227f9d892a7f4581b998c21e353b1686a6bdad5940e7bb6aa596c96e0a6ec' \
9
-d '{body}'
10
https://api.dlocal.com/payments
Copied!

Example Request Body

1
{
2
"amount": 100,
3
"currency": "MXN",
4
"country": "MX",
5
"payment_method_id": "OX",
6
"payment_method_flow": "REDIRECT",
7
"payer": {
8
"name": "Thiago Gabriel",
9
"email": "[email protected]",
10
"document": "53033315550"
11
},
12
"order_id": "5346523564",
13
"notification_url": "http://merchant.com/notifications"
14
}
Copied!

Example Response

1
{
2
"id": "D-4-75c7473a-ab86-4e43-bd39-c840268747d3",
3
"amount": 100,
4
"currency": "MXN",
5
"payment_method_id": "OX",
6
"payment_method_type": "TICKET",
7
"payment_method_flow": "REDIRECT",
8
"country": "MX",
9
"created_date": "2018-12-26T20:37:20.000+0000",
10
"status": "PENDING",
11
"status_detail": "The payment is pending",
12
"status_code": "100",
13
"order_id": "5346523564",
14
"notification_url": "http://merchant.com/notifications",
15
"redirect_url": "https://sandbox.dlocal.com/collect/pay/pay/M-0aa0cc00-094e-11e9-9f92-dbdad3ad0963?xtid=CATH-ST-1545856640-602791137"
16
}
Copied!
Example of redirect page of a OXXO ticket

Direct Cash Payments

Some alternative payment methods are available via our Direct APMs solution (payment_method_flow = DIRECT). The important parameters of a ticket are returned via API, so the merchant can build their own UI.
The example below belongs to direct payment using Boleto Bancário in Brazil. For a full list of TICKET payment methods available, visit the Payment Methods page.
Example Request
Example Response

Example Request

1
curl -X POST \
2
-H 'X-Date: 2018-02-20T15:44:42.310Z' \
3
-H 'X-Login: sak223k2wdksdl2' \
4
-H 'X-Trans-Key: fm12O7G9' \
5
-H 'Content-Type: application/json' \
6
-H 'X-Version: 2.1' \
7
-H 'User-Agent: MerchantTest / 1.0 ' \
8
-H 'Authorization: V2-HMAC-SHA256, Signature: 1bd227f9d892a7f4581b998c21e353b1686a6bdad5940e7bb6aa596c96e0a6ec' \
9
-d '{body}'
10
https://api.dlocal.com/payments
Copied!

Example Request Body

1
{
2
"amount": 120,
3
"currency": "USD",
4
"country": "BR",
5
"payment_method_id": "BL",
6
"payment_method_flow": "DIRECT",
7
"payer": {
8
"name": "Thiago Gabriel",
9
"email": "[email protected]",
10
"document": "53033315550",
11
"user_reference": "12345",
12
"address": {
13
"state": "Rio de Janeiro",
14
"city": "Volta Redonda",
15
"zip_code": "27275-595",
16
"street": "Servidao B-1",
17
"number": "1106"
18
}
19
},
20
"order_id": "5346523564",
21
"notification_url": "http://merchant.com/notifications"
22
}
Copied!

Example Response

1
{
2
"id": "D-4-965cbd38-92d4-4e71-a000-2f653d7d16c6",
3
"amount": 120,
4
"currency": "USD",
5
"payment_method_id": "BL",
6
"payment_method_type": "TICKET",
7
"payment_method_flow": "DIRECT",
8
"country": "BR",
9
"ticket": {
10
"type": "CUSTOM",
11
"number": "34191090080056880044554689940002877570000096000",
12
"expiration_date": "2019-01-03T01:59:00.000+0000",
13
"id": "109/00005688-0",
14
"barcode": "34198775700000960001090000568800445468994000",
15
"company_name": "DLOCAL BRASIL LTDA",
16
"provider_name": "itau",
17
"provider_logo": "http://static-sandbox.dlocal.com/images/providers/itau.png",
18
"image_url": "http://backoffice.dlocal.sandbox/gmf/payments/M-146aa2f0-094f-11e9-9f92-dbdad3ad0963"
19
},
20
"created_date": "2018-12-26T20:44:44.445+0000",
21
"status": "PENDING",
22
"order_id": "5346523564",
23
"notification_url": "http://merchant.com/notifications"
24
}
Copied!
Example mobile UI built with the information in the example above

The Ticket Object

Property
Type
Description
type
String
Type of ticket, can be NUMERIC, BARCODE , CUSTOM or REFERENCE_CODE
number
String
Numeric code of the NUMERIC or CUSTOM ticket
barcode
String
Code to be included in the barcode of the BARCODE or CUSTOM ticket.
format
String
Format of the barcode of the BARCODE or CUSTOM ticket. Example CODE_128,or ITF
id
String
Reference code of the ticket
expiration_date
Date(ISO-8601)
The expiration date of the ticket.
company_name
String
Name of the company that acts as the beneficiary of the payment.
company_id
String
Identifier of the company.
provider_name
String
Name of the company/bank that is creating the ticket.
provider_logo
String
URL of the logo of the company/bank that is creating the ticket.
image_url
String
URL of the full version of the ticket.

Cancel a Cash Payment

Some of our DIRECT APMs tickets can be cancelled by merchants just giving the following instruction through the API: https://api.dlocal.com/payments/{payment_id}/cancel
Example Request
Example Response

1
https://api.dlocal.com/payments/D-4-f1500792-7527-4a0e-86ef-3a9472b63f21/cancel
Copied!
1
{
2
"id": "D-4-f1500792-7527-4a0e-86ef-3a9472b63f21",
3
"amount": 1000,
4
"currency": "MXN",
5
"payment_method_id": "OX",
6
"payment_method_type": "TICKET",
7
"payment_method_flow": "DIRECT",
8
"country": "MX",
9
"created_date": "2020-09-14T19:11:48.000+0000",
10
"status": "CANCELLED",
11
"status_detail": "The payment was cancelled.",
12
"status_code": "400",
13
"order_id": "23796c17-2cc5-4fbb-86b5-10da0859a282",
14
"description": "test",
15
"notification_url": "http://conductor.sandbox.internal/robot-server/rest/generic/notification/new"
16
}
Copied!
Last modified 4mo ago