# Cancel payment profile This endpoint allows to cancel a payment profile associated with a customer using the IDs. In case of success, the request will return a response with status 204. **POST** `/v1/customers/{customer_id}/payment-profiles/{payment_profile_id}/cancel` ## Request parameters ### Header - `X-Idempotency-Key` (string, required) This feature allows you to safely retry requests without the risk of accidentally performing the same action more than once. This is useful for avoiding errors, such as creating two identical payments. To ensure that each request is unique, it's important to use an exclusive value in the header of your request. We suggest using a UUID V4 or random strings. The header accepts values between 1 and 64 characters. ### Path - `customer_id` (string, required) Unique customer identifier for which the payment profile is being canceled. It can be obtained by sending a request to the "Search clients" endpoint. - `payment_profile_id` (string, required) Unique payment profile identifier to cancel, associated with the customer. It can be obtained by sending a request to the "Query a client's payment profi||le" endpoint. ## Response parameters This endpoint has no response body. ## Errors | Status | Error | Description | | ------- | ------- | ----------- | | 400 | customer_id_mismatch | Request failed because the "customer_id" sent does not match the payment profile. Verify if the correct value was sent and try again. | | 400 | caller_id_mismatch | Request failed because the "caller_id" sent does not match the payment profile. Verify if the correct value was sent and try again. | | 400 | site_id_mismatch | Request failed because the "site_id" does not match the payment profile. Verify if the correct value was sent and try again. | | 400 | unknown_error_occurred | Unknown error. Contact Support for more information. | | 401 | header_missing | Request failed because a required header is missing. Make sure that all necessary authentication headers are being sent. | | 401 | Unauthorized Access Token | The value sent as Access Token is incorrect. Please check and try again with the correct value. | | 404 | resource_not_found | Request failed because the payment profile was not found. Verify that the payment profile ID, customer ID and caller ID are correct. | | 429 | Too Many Requests | Request failed because the request rate has been exceeded. Reduce the frequency or implement a retry system with exponential backoff. | | 500 | internal_server_error | Request failed due to an internal server error. Please try again later and, if the problem persists, contact Support with error details. | ## Request example ### cURL ```bash curl -X POST \ 'https://api.mercadopago.com/v1/customers/{customer_id}/payment-profiles/{payment_profile_id}/cancel' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' ``` ## Response example ```json "string" ```