Documentation
en
Search…
⌃K

API Integration

Environments

Sandbox: https://api-sbx.dlocalgo.com Live: https://api.dlocalgo.com

Dashboards:

Security

All the requests will be always using HTTPS and authenticated via: Bearer auth: The key is the concatenation of: <API_KEY> + ":" + <SECRET_KEY> Basic auth: The user is the API_KEY, and the password the SECRET_KEY.
Credentials can obtained from the dashboard:
Menu > Integrations > Integrations keys

Payments

post
https://api.dlocalgo.com/v1/payments
Create a payment

Payer object

All the required attributes will be asked in the checkout as mandatory if not given in the initial request.
Attribute
Type
Description
id
string
Payer unique identifier on the merchant side.
It will be generated if not present.
name
string
User's full name.
Length: 100.
Note: If not given, it will be asked in the checkout.
email
string
User’s email address.
Length: 100.
Note: If not given, it will be asked in the checkout.
phone
string
User’s phone.
Note: Mandatory for Wallets in India. If not given will be asked in the checkout for that country.
document_type
string
Payer's document type.
Must be a valid document type for the specified country
Note: If not given, it will be asked in the checkout.
document
string
Payer's document number.
Must be a valid document for the specified country and client.
Note: If not given, it will be asked in the checkout.
user_reference
string
Unique user id at the merchant side.
address
object
User’s address.
Required in India and South Africa for fraud prevention.

Address object

All the required attributes will be asked in the checkout as mandatory if not given in the initial request.
Attribute
Type
Description
state
string
Payer's address state. Required in South Africa.
city
string
Payer’s address city. Required in India and South Africa.
zip_code
string
Payer's address zip_code. Required in South Africa.
full_address
string
Payer’s full address
Required in India and South Africa.

Example request

curl -X POST \
https://api-sbx.dlocalgo.com/v1/payments \
-H 'authorization: Bearer [hidden]' \
-H 'content-type: application/json' \
-d '{
"amount": 120,
"currency" : "BRL",
"country": "BR",
"success_url": "https://merchant.com/success",
"back_url": "https://merchant.com/back",
"redirect_url": "https://merchant.com/redirect"
}'
get
https://api.dlocalgo.com/v1/payments
/:payment_id
Retrieve a Payment

Example request

curl -X GET \
https://api-sbx.dlocalgo.com/v1/payments/DP-5954 \
-H 'authorization: Bearer [hidden]' \
-H 'content-type: application/json'

Payment status codes

Status
Description
PENDING
The payment is pending.
PAID
The payment was paid.
REJECTED
The payment was rejected.
CANCELLED
The payment was cancelled.
EXPIRED
The payment was expired.

Errors

Attribute
Type
Description
code
string
Error code.
message
string
Description of error
param
string
Invalida parameter
Example
{
"code": 5003,
"message": "Country not supported"
}

HTTP Errors

HTTP Status Code
Error Code
Error Message
Param
403 (Forbidden)
3001
Invalid Credentials.
3003
Merchant has no authorization to use this API.
404 (Not Found)
4000
Payment not found
400 (Bad Request)
5000
Invalid request.
5001
Invalid Parameter
document_type
document
currency
5003
Country not supported.
5007
Amount exceeded.
5009
Order id is duplicated
5010
Payment Method not available.
5016
Amount too low.
429 (Too many requests)
6000
Too many requests to the API.
500 (Internal Server Error)
7000
Failed to process the request.
504 Gateway Timeout
7001
Request Timeout.

Notifications

The notifications of a payment or refund status change will be sent as a POST with the ID of the Payment Or Refund in the body to the notification_url specified in the request, so that the merchant can get the information via the GET method.

Refunds

post
https://api.dlocalgo.com/v1/refunds
Make a Refund
curl -X POST \
https://api-sbx.dlocalgo.com/v1/refunds \
-H 'authorization: Bearer [hidden]' \
-H 'content-type: application/json' \
-d '{
"payment_id": "DP-6012",
"amount": 60
}'