# Cancel an eSIM

## Cancel an eSIM based on ICCID

> Cancels the current Matching ID for the QR code associated with a given ICCID, provided its state is set to “released”. The API requires both the ICCID and the Matching ID

```json
{"openapi":"3.0.0","info":{"title":"Filtered eSIM API","version":"1.0"},"paths":{"/api/v1/eSIM/cancel":{"post":{"description":"Cancels the current Matching ID for the QR code associated with a given ICCID, provided its state is set to “released”. The API requires both the ICCID and the Matching ID","operationId":"cancelOrder","requestBody":{"content":{"application/json":{"schema":{"properties":{"iccid":{"description":"The ICCID (19 or 20 characters) associated with the order to cancel.","type":"string"},"matchingId":{"description":"The matchingId of the SIM.","type":"string"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"description":"The response data containing the cancellation details.","properties":{"header":{"description":"contains value of functionExecutionStatus.","properties":{"functionExecutionStatus":{"description":"contains value of status of cancellation.","properties":{"status":{"description":"Status of order cancellation","type":"string"}},"type":"object"}},"type":"object"}},"type":"object"}},"type":"object"}}},"description":"Successfully cancelled the order."},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"description":"Error message indicating validation failure or incorrect input.","type":"string"}},"type":"object"}}},"description":"Bad request, invalid ICCID format, or the ICCID state is not \"released\"."},"500":{"content":{"application/json":{"schema":{"properties":{"error":{"description":"Error message describing what went wrong.","type":"string"}},"type":"object"}}},"description":"Internal server error, failed to cancel the order or other issues."}},"summary":"Cancel an eSIM based on ICCID","tags":["eSIM"]}}}}
```
