> ## Documentation Index
> Fetch the complete documentation index at: https://developers.mioesim.com/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /api_esim/refundOrder — Cancel a SIM order

> Cancel or unsubscribe a SIM card order by order number and ICCID. Supports eSIM and physical SIM. Partial cancellations are supported by specifying ICCIDs.

Unsubscribe one or more SIM cards from an order. You can cancel a subset of cards by specifying their ICCIDs. Once successfully unsubscribed, the order status changes to `2` (cancelled) or `4` (partial unsubscribe).

```
POST https://bpm.mioesim.com/api_esim/refundOrder
```

<Warning>
  Cancellation rules vary by plan. Check the `premark` field of your package — many plans cannot be cancelled after the eSIM is installed. Contact MIOeSIM support if you are unsure.
</Warning>

## Request parameters

<ParamField body="token" type="string" required>Session token.</ParamField>
<ParamField body="orderNum" type="string" required>Order number to cancel.</ParamField>
<ParamField body="iccids" type="string" required>Comma-separated ICCID(s) to unsubscribe.</ParamField>
<ParamField body="sign" type="string" required>Request signature.</ParamField>
<ParamField body="remark" type="string">Optional cancellation notes.</ParamField>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://bpm.mioesim.com/api_esim/refundOrder \
    -d "token=YOUR_TOKEN" \
    -d "orderNum=EP20240124000013" \
    -d "iccids=934801019851134300" \
    -d "sign=YOUR_SIGN"
  ```

  ```json Success theme={null}
  { "code": "0", "message": "success", "data": null }
  ```

  ```json Error theme={null}
  { "code": 22, "message": "Non-personal orders", "data": "" }
  ```
</CodeGroup>

## Error codes

| Code  | Meaning                             |
| ----- | ----------------------------------- |
| `-1`  | Token expired                       |
| `-2`  | Required parameter missing          |
| `3`   | Data not found                      |
| `22`  | Non-personal orders (cannot cancel) |
| `-30` | Signature wrong                     |
