# Cancel Enrollment Endpoint

### Cancelling an Enrollment

This endpoint allows you to cancel an existing enrollment.\
\
This uses the same API credentials as the deposit endpoint.\
\ <mark style="color:$danger;">`DELETE`</mark> `https://api-stg.onekeypayments.com/v3/enrollments/{enrollment_id}/`

#### Path Parameters

| Name         | Type    | Description                                                        |
| ------------ | ------- | ------------------------------------------------------------------ |
| enrollmentId | integer | OKP enrollment\_id. It is obtained when creating a new enrollment. |

#### Headers

| Name              | Type   | Description                                                                    |
| ----------------- | ------ | ------------------------------------------------------------------------------ |
| Content-Type      | string | `application/json`                                                             |
| X-Date            | string | <p>ISO8601 Datetime with Timezone: <br><code>yyyy-MM-dd'T'HH:mm:ssZ</code></p> |
| X-Login           | string | Merchant X-Login API Key                                                       |
| Authorization     | string | Authorization control hash                                                     |
| X-Idempotency-Key | string | Unique idempotency key                                                         |

### Example Response

```json
{
    "enrollment_id": 36,
    "status": "CANCELLED"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.onekeypayments.com/api-documentation/automatic-pix-api/cancel-enrollment-endpoint.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
