> 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/in-store-api/cancel-payment.md).

# Cancel Payment

{% hint style="warning" %}
**You should always cancel a payment if it will not be completed.**\
\
Whether the customer opts out, the cashier finds an error, or a set period of time passes without payment confirmation. This ensures your system stays accurate and clear of pending transactions that will never be paid.
{% endhint %}

## Environments

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

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

## Cancel Payment

> Cancels an existing payment using the cartId. The payment will be cancelled regardless of the totalAmount value provided.

```json
{"openapi":"3.0.3","info":{"title":"Aplazo In-Store Payments API","version":"1.0.0"},"servers":[{"url":"https://api.aplazo.net"}],"security":[{"apiKeyAuth":[]},{"merchantIdAuth":[]}],"components":{"securitySchemes":{}},"paths":{"/api/pos/loan/cancel":{"post":{"summary":"Cancel Payment","description":"Cancels an existing payment using the cartId. The payment will be cancelled regardless of the totalAmount value provided.","operationId":"cancelPayment","tags":["Payment"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["cartId","totalAmount","reason"],"properties":{"cartId":{"type":"string","description":"Identifier in the merchant POS for the order/transaction."},"totalAmount":{"type":"number","format":"float","description":"Amount to be cancelled (informational only).","minimum":0},"reason":{"type":"string","description":"Reason for the cancellation.","minLength":1}}}}}},"responses":{"200":{"description":"Payment cancelled successfully.","content":{"application/json":{"schema":{"type":"object","required":["cartId","status","requestDate","updateDate"],"properties":{"cartId":{"type":"string","description":"Identifier in the merchant POS for the order/transaction."},"status":{"type":"string","description":"Status of the cancellation.","enum":["CANCELLED"]},"requestDate":{"type":"string","description":"Date of the cancellation request.","format":"date-time"},"updateDate":{"type":"string","description":"Date of the cancellation request last update.","format":"date-time"}}}}}}}}}}}
```
