Enrollments

Cancel an enrollment

Changed on

Cancels an active enrollment. Once cancelled, no further recurring payments can be initiated against this enrollment.

post/enrollments/{id}/cancel

Request

  • Base URL
    https://api.dlocal.com
  • URL
    https://api.dlocal.com/enrollments/{id}/cancel
  • Auth
    API key in header X-Date and API key in header X-Login and API key in header X-Trans-Key and API key in header Content-Type and API key in header X-Version and API key in header User-Agent and API key in header Authorization

Path parameters

idstring required

The dLocal enrollment ID to cancel.

Response

Cancellation request received.

Note: Cancellation is processed asynchronously for some payment methods (e.g., Pix Automático). In these cases, the synchronous response returns status: PENDING while the bank processes the request. The final CANCELLED status is confirmed via webhook notification to the notification_url.

Webhook notifications

dLocal sends an asynchronous notification to the notification_url once the cancellation is confirmed. There are two scenarios: Cancelled — merchant-initiated (confirmed by bank)

{
  "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"
}

Cancelled — user-initiated (cancelled directly through home banking)

{
  "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": "Enrollment cancelled by user",
  "status_code": "401",
  "notification_url": "http://merchantsite.com/notifications"
}
statusstring
status_codestring

Enrollment status code.

status_detailstring

Example response

{
  "enrollment": {
    "id": "E-4-32e1218f-b6ec-3f21-13d5-50v12ere2ca4",
    "external_id": "31231jj224"
  },
  "status": "CANCELLED",
  "status_code": "400",
  "status_detail": "The enrollment is cancelled."
}

Changes