Cash payments
Learn how to start receiving cash 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.
Important
Starting May 1st 2021, the
redirect_url
will start returning anHTTP 200 OK
with the HTML content of the ticket. This will be instead of theHTTP 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 method page.
Example request
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": 100,
"currency": "MXN",
"country": "MX",
"payment_method_id": "OX",
"payment_method_flow": "REDIRECT",
"payer": {
"name": "Thiago Gabriel",
"email": "[email protected]",
"document": "53033315550"
},
"order_id": "5346523564",
"notification_url": "http://merchant.com/notifications"
}
{
"id": "D-4-75c7473a-ab86-4e43-bd39-c840268747d3",
"amount": 100,
"currency": "MXN",
"payment_method_id": "OX",
"payment_method_type": "TICKET",
"payment_method_flow": "REDIRECT",
"country": "MX",
"created_date": "2018-12-26T20:37:20.000+0000",
"status": "PENDING",
"status_detail": "The payment is pending",
"status_code": "100",
"order_id": "5346523564",
"notification_url": "http://merchant.com/notifications",
"redirect_url": "https://sandbox.dlocal.com/collect/pay/pay/M-0aa0cc00-094e-11e9-9f92-dbdad3ad0963?xtid=CATH-ST-1545856640-602791137"
}
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 method page.
Example request
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,
"currency": "USD",
"country": "BR",
"payment_method_id": "BL",
"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"
}
},
"order_id": "5346523564",
"notification_url": "http://merchant.com/notifications"
}
{
"id": "D-4-965cbd38-92d4-4e71-a000-2f653d7d16c6",
"amount": 120,
"currency": "USD",
"payment_method_id": "BL",
"payment_method_type": "TICKET",
"payment_method_flow": "DIRECT",
"country": "BR",
"ticket": {
"type": "CUSTOM",
"number": "34191090080056880044554689940002877570000096000",
"expiration_date": "2019-01-03T01:59:00.000+0000",
"id": "109/00005688-0",
"barcode": "34198775700000960001090000568800445468994000",
"company_name": "DLOCAL BRASIL LTDA",
"provider_name": "itau",
"provider_logo": "http://static-sandbox.dlocal.com/images/providers/itau.png",
"image_url": "http://backoffice.dlocal.sandbox/gmf/payments/M-146aa2f0-094f-11e9-9f92-dbdad3ad0963"
},
"created_date": "2018-12-26T20:44:44.445+0000",
"status": "PENDING",
"order_id": "5346523564",
"notification_url": "http://merchant.com/notifications"
}
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.
See more information on how to Cancel a cash payment in the API reference section.
Example request
https://api.dlocal.com/payments/D-4-f1500792-7527-4a0e-86ef-3a9472b63f21/cancel
{
"id": "D-4-f1500792-7527-4a0e-86ef-3a9472b63f21",
"amount": 1000,
"currency": "MXN",
"payment_method_id": "OX",
"payment_method_type": "TICKET",
"payment_method_flow": "DIRECT",
"country": "MX",
"created_date": "2020-09-14T19:11:48.000+0000",
"status": "CANCELLED",
"status_detail": "The payment was cancelled.",
"status_code": "400",
"order_id": "23796c17-2cc5-4fbb-86b5-10da0859a282",
"description": "test",
"notification_url": "http://conductor.sandbox.internal/robot-server/rest/generic/notification/new"
}
Updated almost 3 years ago