Checkout redirect

Save time by integrating dLocal's Checkout, a pre-built workflow with all payment methods.

How does it work

When sending a request over to dLocal, you should specify the payment_method_flow as REDIRECT and not send the parameter payment_method_id. This way the user will be redirected to dLocal’s checkout where the user can select the payment method they want to pay with.

All payment requests should be made to the /payments endpoint.

When the payment status changes, an IPN is triggered notifying the new status. The endpoint listening to this status can either be specified dynamically on a transaction level or statically at dLocal’s dashboard.

By default, the Redirect URL can only be used one time.

You can find more information about this request on the Create payment page.

Example

curl -X POST \ 
   -H 'X-Date: 2018-02-20T15:44:42.310Z' \ 
   -H 'X-Login: sak223k2wdksdl2' \ 
   -H 'X-Trans-Key: 23k2wdksdl2' \ 
   -H 'X-Content-Type: application/json' \ 
   -H 'X-Version: 2.1'\ 
   -H 'User-Agent: Mozilla/5.0' \ 
   -H 'Authorization: V2-HMAC-SHA256, Signature: 
1bd227f9d892a7f4581b998c21e353b1686a6bdad5940e7bb6aa596c96e0a6ec' \ 
   -d '{body}' 
   https://api.dlocal.com/payments 

{ 
    "amount": 100, 
    "currency": "BRL", 
    "country": "BR", 
    "payment_method_flow": "REDIRECT", 
    "payer": { 
        "name": "Joao Peres", 
        "email": "[email protected]", 
        "document": "EHFGA5967A", 
        "address": { 
            "city": "Goa", 
            "street": "Maddo Vaddo", 
            "number": "1207" 
        } 
    }, 
    "order_id": "Zh3gb4jhbg34Vj", 
    "notification_url": "http://merchant.com/notifications" 
}

{ 
    "id": "D-4-086e1efe-c391-4226-992f-5e1d8664a297", 
    "amount": 100, 
    "currency": "BRL", 
    "payment_method_flow": "REDIRECT", 
    "country": "BR", 
    "created_date": "2019-01-09T20:08:49.000+0000", 
    "status": "PENDING", 
    "status_detail": "The payment is pending", 
    "status_code": "100", 
    "order_id": "Zh3gb4jhbg34Vj", 
    "notification_url": "http://merchant.com/notifications", 
    "redirect_url": "https://sandbox.dlocal.com/collect/pay/pay/M-610d2e60-144a-11e9-9f92-
dbdad3ad0963?xtid=CATH-ST-1547064529-1824505505" 
}

Considerations

  • After making the request, you can get the result REJECTED or PENDING. If the response is PENDING, you will get the URL to redirect the user.
  • Once the user completes the payment (or the payment expires), you will receive a notification with the final status of the payment. You can get the result REJECTED or PAID.
  • The default expiration date is 1 day.
  • If the user selects any card payment method (Visa, Mastercard, or any other card), all card payments will be processed with the security code of the card (CVV).