Recurring payment

48 hours before the payment is due, the merchant must trigger the pre-debit notification (prenotification).

After the prenotification is approved by the issuer, the user will be notified that they will be charged the amount specified in the request. 48 hours after the prenotification is approved, dLocal will automatically trigger the charge.

Recurring payment flow

  1. For subscriptions with variable amounts, the merchant is required to trigger the pre-notification (aka pre-debit notification) 24 hours prior to the payment due date through dLocal's API, specifying the amount to charge (up to 5k INR). dLocal will return an asynchronously ACK message while the issuer confirms the pre-notification.
  2. Once the issuer confirms the pre-notification, dLocal will notify the merchant via API.
  3. 24 hours later, dLocal will automatically trigger the charge (aka mandate execution).
  4. Once the charge is successful, dLocal will notify the merchant via API.

The amount can change from payment to payment, as long as it’s under 5k INR.

35383538

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": 750,
   "currency": "INR",
   "country": "IN",
   "payment_method_id": "IR",
   "payment_method_flow": "DIRECT",
   "payer": {
       "name": "Ram Devi",
       "email": "[email protected]",
       "phone": "+919000123456",
       "document": "HSECT4378A"
   },
   "wallet": {
       "token": "W-yu23y4ibnyiu23y4",
       "recurring_info": {
           "prenotify": TRUE
       }
   },
   "order_id": "5346523565",
   "notification_url": "http://merchant.com/notifications"
}

Asynchronous notifications

1. Prenotify approved by issuer

{
   "id": "D-4-75c7473a-ab86-4e43-bd39-c840268747d3",
   "amount": 750.00,
   "currency": "INR",
   "payment_method_id": "IR",
   "payment_method_type": "WALLET",
   "payment_method_flow": "DIRECT",
   "country": "IN",
   "created_date": "2018-12-26T20:37:20.000+0000",
   "status": "PENDING",
   "status_detail": "The payment is pending",
   "status_code": "100",
   "order_id": "5346523565",
   "notification_url": "http://merchant.com/notifications",
   "recurring_info": {
        "prenotify_approved": TRUE
    }
}

2. Payment success

Should be received 48hs after the prenotify has been approved.

{
   "id": "D-4-75c7473a-ab86-4e43-bd39-c840268747d3",
   "amount": 750.00,
   "currency": "INR",
   "payment_method_id": "IR",
   "payment_method_type": "WALLET",
   "payment_method_flow": "DIRECT",
   "country": "IN",
   "created_date": "2018-12-26T20:37:20.000+0000",
   "status": "PAID",
   "status_detail": "The payment was paid",
   "status_code": "200",
   "order_id": "5346523565",
   "notification_url": "http://merchant.com/notifications",
   "recurring_info": {
        "prenotify_approved": TRUE
    }
}

Did this page help you?