> For the complete documentation index, see [llms.txt](https://aplazo.gitbook.io/aplazo-integrations/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aplazo.gitbook.io/aplazo-integrations/api-reference/online-api/cancel-payment.md).

# Cancel payment

## Environments

{% tabs %}
{% tab title="Development" %}
<https://refunds-bifrost.aplazo.net/api>
{% endtab %}

{% tab title="Production" %}
<https://refunds-bifrost.aplazo.mx/api>
{% endtab %}
{% endtabs %}

{% hint style="info" icon="exclamation" %}
The only reason you should consider a payment was successful is because the [GET payment status request](/aplazo-integrations/api-reference/online-api/get-payment-status.md) responding "OUTSTANDING" and/or because you received the [payment confirmation webhook](/aplazo-integrations/api-reference/webhook-confirmation.md) from Aplazo.&#x20;
{% endhint %}

## Cancel a loan by cart ID

> Attempts to cancel a loan associated with a given cart. If the loan is in an unacceptable state for cancellation (e.g., already paid, previously cancelled), an error response is returned.  Note: This endpoint should never be treated as payment confirmation. Payment is only confirmed via a loan status query or webhook confirmation.

```json
{"openapi":"3.0.3","info":{"title":"Aplazo Online API","version":"1.0.0"},"servers":[{"url":"https://refunds-bifrost.aplazo.net/api/"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/merchant/loan/cancel":{"get":{"summary":"Cancel a loan by cart ID","description":"Attempts to cancel a loan associated with a given cart. If the loan is in an unacceptable state for cancellation (e.g., already paid, previously cancelled), an error response is returned.  Note: This endpoint should never be treated as payment confirmation. Payment is only confirmed via a loan status query or webhook confirmation.","parameters":[{"name":"cartId","in":"query","required":true,"schema":{"type":"string"},"description":"The unique identifier of the cart associated with the loan to be canceled."}],"responses":{"202":{"description":"Loan cancellation request accepted."},"400":{"description":"Loan is in an unacceptable state for cancellation (e.g., already paid, previously cancelled, or refunded).  Important: This response does not constitute payment confirmation. Always verify payment status via loan status query or webhook confirmation.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"Error code indicating the issue with the loan status."},"data":{"type":"object","properties":{"status":{"type":"string","description":"Current status of the loan."}}},"error":{"type":"string","description":"Short description of the error."},"timestamp":{"type":"integer","format":"int64","description":"Timestamp when the error occurred."},"message":{"type":"string","description":"Detailed error message."},"path":{"type":"string","description":"The path of the endpoint that caused the error."}}}}}}},"tags":["Loans"]}}}}
```
