> For the complete documentation index, see [llms.txt](https://apidocs.onekeypayments.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.onekeypayments.com/api-reference/deposits-api/automatic-pix/cancel-an-enrollment.md).

# Cancel an enrollment

## Cancel an Enrollment

> This endpoint allows you to cancel an existing enrollment.\
> \
> This uses the same API credentials as the deposit endpoint.<br>

```json
{"openapi":"3.0.1","info":{"title":"OneKey Payments API","version":"1.0.0"},"servers":[{"url":"https://api-stg.onekeypayments.com","description":"Staging Server"}],"paths":{"/v3/enrollments/{enrollment_id}/":{"delete":{"summary":"Cancel an Enrollment","operationId":"cancelEnrollment","description":"This endpoint allows you to cancel an existing enrollment.\n\nThis uses the same API credentials as the deposit endpoint.\n","tags":["Enrollments"],"parameters":[{"name":"enrollment_id","in":"path","description":"OKP enrollment_id. It is obtained when creating a new enrollment.","required":true,"schema":{"type":"integer"}},{"name":"X-Login","in":"header","description":"Merchant X-Login API Key.","required":true,"schema":{"type":"string"}},{"name":"X-Date","in":"header","description":"ISO8601 Datetime with Timezone: yyyy-MM-dd'T'HH:mm:ssZ","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Authorization control hash.","required":true,"schema":{"type":"string"}},{"name":"X-Idempotency-Key","in":"header","description":"Unique idempotency key.","required":true,"schema":{"type":"string"}},{"name":"Content-Type","in":"header","description":"Content type of the request.","required":true,"schema":{"type":"string","default":"application/json"}}],"responses":{"200":{"description":"Enrollment cancelled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"enrollment_id":{"type":"integer","description":"The ID of the cancelled enrollment."},"status":{"type":"string","description":"The new status of the enrollment."}}}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://apidocs.onekeypayments.com/api-reference/deposits-api/automatic-pix/cancel-an-enrollment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
