Enrollment cancelation

Understand how enrollment cancelation works, whether requested or notified.

This process allows either the merchant or the user to invalidate an active enrollment so it can no longer be used as a payment method.

If enabled, merchants can initiate the cancelation via API, while users can also cancel their enrollment through their online or mobile banking applications.

Once the enrollment is canceled, its status changes to CANCELLED, and no further recurring or subsequent payments can be processed using that enrollment.


Cancelation requested by merchant (via API)

This service allows merchants to cancel an active enrollment.

Flow

Example request

curl -X POST \
   -H 'X-Date: {X-Date}' \
   -H 'X-Login: {X-Login}' \
   -H 'X-Trans-Key: {X-Trans-Key}' \
   -H 'Content-Type: application/json' \
   -H 'X-Version: 2.1' \
   -H 'User-Agent: MerchantTest / 1.0 ' \
   -H 'Authorization: V2-HMAC-SHA256, Signature: {Signature}' \
   https://api.dlocal.com/enrollments/E-4-32e1218f-b6ec-3f21-13d5-50v12ere2ca4/cancel  
{
   "id": "E-4-32e1218f-b6ec-3f21-13d5-50v12ere2ca4",
   "external_id": "31231jj224",
   "status": "PENDING",
   "status_detail": "The enrollment has an ongoing cancelation",
   "status_code": "100"
} 
{
  "id": "E-4-32e1218f-b6ec-3f21-13d5-50v12ere2ca3",
  "external_id": "31231jj223",
  "currency": "BRL",
  "country": "BR",
  "type": "MERCHANT_SUBSCRIPTION",
  "payment_method_id": "XA",
  "payment_method_flow": "DIRECT",
  "payment_method_type": "TICKET",
  "created_date": "2024-07-26T20:37:20.000+0000",
  "approved_date": "2024-07-26T20:39:24.000+0000",
  "status": "CANCELLED",
  "status_detail": "The enrollment is cancelled.",
  "status_code": "400",
  "notification_url": "http://merchantsite.com/notifications"
}

Request params

Path paramRequiredTypeDescription
idYesStringEnrollment ID provided by dLocal, identifying the enrollment to cancel.

Cancelation notified by the processor/payment network (via online banking)

Enrollment cancelation can be initiated by local processors or other payment network stakeholders, for example, when users cancel their enrollment directly through their online banking platform.

In such cases, dLocal will cancel the enrollment on its platform and notify the merchant via webhook notification.

Flow

{
  "id": "E-4-32e1218f-b6ec-3f21-13d5-50v12ere2ca3",
  "external_id": "31231jj223",
  "status": "CANCELLED",
  "status_detail": "Enrollment cancelled by user",
  "status_code": "401"
}