Wallet Payments
Wallet payments (WALLET) require the user to log in to their wallet provider (through a redirect) and approve the payment. Once the first payment is successful, a token is returned which can be used to make recurring payments without the need of a redirect.

Redirect Wallet Payment

In this flow, the user is redirected to the wallet's website to authenticate. Once that's done, the user will be redirected back to the callback_url, and the payment will be processed asynchronously. If wallet.save = TRUE in the request, the asynchronous notification will include a wallet.token , which can be used for further payments without the need to authenticating again.
Verify Flow:
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": 0,
3
"currency": "ARS",
4
"country": "AR",
5
"payment_method_id": "MP",
6
"payment_method_flow": "REDIRECT",
7
"payer": {
8
"name": "Thiago Gabriel",
9
"email": "[email protected]",
10
"document": "53033315550"
11
},
12
"wallet": {
13
"save": true,
14
"verify": true,
15
"capture": false,
16
"label": "New subscription for merchant service"
17
},
18
"description": "Exclusive contents with this service",
19
"order_id": "5346523564",
20
"notification_url": "http://merchant.com/notifications",
21
"callback_url": "http://merchant.com/callback"
22
}
Copied!
1
{
2
"id": "D-4-75c7473a-ab86-4e43-bd39-c840268747d3",
3
"amount": 0,
4
"currency": "ARS",
5
"payment_method_id": "MP",
6
"payment_method_type": "WALLET",
7
"payment_method_flow": "REDIRECT",
8
"country": "AR",
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 Asynchronous Notification
POST: {payment.notification_url}
If wallet.save = TRUE, the notification will include a wallet.token as long as the user authenticated successfully (regardless of if the payment was approved or not).
1
{
2
"id": "D-4-75c7473a-ab86-4e43-bd39-c840268747d3",
3
"amount": 0.00,
4
"status": "VERIFIED",
5
"status_detail": "The wallet was verified.",
6
"status_code": "700",
7
"currency": "USD",
8
"country": "AR",
9
"payment_method_id": "MP",
10
"payment_method_type": "WALLET",
11
"payment_method_flow": "REDIRECT",
12
"payer": {
13
"name": "Thiago Gabriel",
14
"email": "[email protected]",
15
"document": "53033315550"
16
},
17
"wallet": {
18
"token": "W-yu23y4ibnyiu23y4",
19
"userid": "45696493593"
20
},
21
"order_id": "5346523564",
22
"notification_url": "http://www.merchant.com/notifications",
23
"created_date": "2018-12-26T20:37:20.000+0000"
24
}
Copied!
Sale + Authentication Flow:
In this flow the user is going to be charged with the amount indicated in the request. In case merchant send the "save"=true parameter in the wallet object. it will also generate a wallet token for future payments.
Example Request body:
1
{
2
"amount": 10.00,
3
"currency": "ARS",
4
"country": "AR",
5
"payment_method_id": "MP",
6
"payment_method_flow": "REDIRECT",
7
"payer": {
8
"name": "Thiago Gabriel",
9
"email": "[email protected]",
10
"document": "53033315550"
11
},
12
"wallet": {
13
"save": true,
14
"verify": true,
15
"label": "New subscription for merchant service"
16
},
17
"description": "Exclusive contents with this service",
18
"order_id": "5346523564",
19
"notification_url": "http://merchant.com/notifications",
20
"callback_url": "http://merchant.com/callback"
21
}
Copied!

Direct Wallet Payments

Once a wallet.token was obtained, further payments can be processed without the need of redirecting the user to authenticate, and the payment will be done synchronously.

Example Request

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 body Request

1
{
2
"amount": 100,
3
"currency": "ARS",
4
"country": "AR",
5
"payment_method_id": "MP",
6
"payment_method_flow": "DIRECT",
7
"payer": {
8
"name": "Thiago Gabriel",
9
"email": "[email protected]",
10
"document": "53033315550"
11
},
12
"wallet": {
13
"token": "W-yu23y4ibnyiu23y4"
14
},
15
"order_id": "5346523565",
16
"notification_url": "http://merchant.com/notifications",
17
"callback_url": "http://merchant.com/callback"
18
}
Copied!
1
{
2
"id": "D-4-75c7473a-ab86-4e43-bd39-c840268747d3",
3
"amount": 100,
4
"currency": "ARS",
5
"payment_method_id": "MP",
6
"payment_method_type": "WALLET",
7
"payment_method_flow": "DIRECT",
8
"country": "AR",
9
"created_date": "2018-12-26T20:37:20.000+0000",
10
"status": "PAID",
11
"status_detail": "The payment was paid.",
12
"status_code": "200",
13
"order_id": "5346523565",
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!

The Wallet Object

Property
Type
Description
name
String
Name of wallet
save
Boolean
Whether or not a token will be included in the response in order to make future payments. Optional, default = FALSE.
token
String
Token used to make recurring payments to a previously saved wallet. Required for Direct Wallet Payments.
expiration
String
Expiration (in days) of a saved wallet. Optional.
username
String
User's username in the merchant's website. Required for OneClick.
email
String
User’s email. Required for OneClick.
recurring_info
Object
Info of recurring information for the user. Optional (for MercadoPago)
verify
Boolean
If using the request just to verify the wallet, and not creating a payment. Mandatory as TRUE if amount=0. Default FALSE.
capture
Boolean
Whether or not to immediately capture the charge. When FALSE, the charge issues an authorization and will need to be captured later. Default TRUE. Optional.
deviceId
Object
Device information. Check relevant section. Required for MercadoPago.

The deviceId Object (for MercadoPago only)
Property
Type
Description
deviceId
String
Device web unique identificator. Use dedicated script to collect it. Example: “5cf65fc6c5db631a47471bb0”. Required only if browser is web.
fingerprint
Object
Used for mobile devices. See example and SDKs following. Required only if used on native mobile app.

Web

Add the following script on website:
1
<script src="https://www.mercadopago.com/v2/security.js" view="checkout"></script>
Copied!

Mobile

Use the following SDK to get mobile device fingerprint:
Android: https://github.com/mercadopago/px-android
1
new Device(context);
Copied!
iOS: https://github.com/mercadopago/px-ios
1
Device()
Copied!
Mobile fingerprint example
1
"fingerprint": {
2
"os": "iOS",
3
"system_version": "8.3",
4
"ram": 18446744071562067968,
5
"disk_space": 498876809216,
6
"model": "MacBookPro9,2",
7
"free_disk_space": 328918237184,
8
"vendor_ids": [
9
{
10
"name": "vendor_id",
11
"value": "C2508642-79CF-44E4-A205-284A4F4DE04C"
12
},
13
{
14
"name": "uuid",
15
"value": "AB28738B-8DC2-4EC2-B514-3ACF330482B6"
16
}
17
],
18
"vendor_specific_attributes": {
19
"feature_flash": false,
20
"can_make_phone_calls": false,
21
"can_send_sms": false,
22
"video_camera_available": true,
23
"cpu_count": 4,
24
"simulator": true,
25
"device_languaje": "en",
26
"device_idiom": "Phone",
27
"platform": "x86_64",
28
"device_name": "iPhone Simulator",
29
"device_family": 4,
30
"retina_display_capable": true,
31
"feature_camera": false,
32
"device_model": "iPhone Simulator",
33
"feature_front_camera": false
34
},
35
"resolution": "375x667"
36
}
Copied!
Last modified 7d ago