---
title: "Cancel an enrollment"
method: POST
path: "/enrollments/{id}/cancel"
tags: ["Enrollments"]
---

# Cancel an 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`

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

## Path parameters

- `id` string, required

## Response `200`

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)**
```json
{
  "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)**
```json
{
  "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"
}
```

- object
  - `enrollment` object
    - `id` string: dLocal enrollment ID.
    - `external_id` string: Merchant-defined enrollment identifier.
  - `status` string
  - `status_code` string: Enrollment status code.
  - `status_detail` string

## Changes

- **2026-11-03** `e31ec9de4008`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/dlocal/apis/payins/changes/enrollments/:id/cancel/post.md)

---

[API](https://skmtc.dev/dlocal/apis/payins.md) - [All operations](https://skmtc.dev/dlocal/apis/payins/llms.txt) - [OpenAPI document](https://skmtc.dev/dlocal/apis/payins/revisions/e31ec9de4008?raw)
