> ## 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/renewCard — Renew a SIM card plan

> Renew a SIM card plan by order number or ICCID. Supports eSIM and physical SIM card renewal. Returns a new order with renewal card details.

Renew an active plan for a SIM card. You can identify the card by either its order number or ICCID. The renewal creates a new order linked to the original via `mainOrderNum`.

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

<Note>
  Renewal is only available for plans where `flowType=0` (renewable). Check this field in the package list before offering renewal to your customers.
</Note>

## Request parameters

<ParamField body="token" type="string" required>Session token.</ParamField>
<ParamField body="skuId" type="string" required>Product SKU ID.</ParamField>
<ParamField body="priceId" type="string" required>Package price ID for the renewal plan.</ParamField>
<ParamField body="sign" type="string" required>Request signature.</ParamField>
<ParamField body="orderNum" type="string">Order number. Required if `iccid` is not provided.</ParamField>
<ParamField body="iccid" type="string">ICCID of the card to renew. Required if `orderNum` is not provided.</ParamField>
<ParamField body="daypassDays" type="string">Days to order for DayPass packages (`supportDaypass=1`).</ParamField>
<ParamField body="backInfo" type="string">`0`/empty = order number; `1` = full details; `2` = PDF URL info.</ParamField>
<ParamField body="pdfLanguage" type="string">PDF language code. See [PDF Languages](/reference/pdf-languages).</ParamField>
<ParamField body="otherOrderId" type="string">Your external order ID.</ParamField>
<ParamField body="otherItemId" type="string">Your external line item ID.</ParamField>
<ParamField body="remark" type="string">Optional notes.</ParamField>

## Response

Same structure as [Place Order](/api-reference/place-order) with `backInfo=1`. The `renewal` field is `true` and `mainOrderNum` contains the original order number.

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://bpm.mioesim.com/api_esim/renewCard \
    -d "token=YOUR_TOKEN" \
    -d "iccid=934801019851134300" \
    -d "skuId=45" \
    -d "priceId=441" \
    -d "backInfo=1" \
    -d "sign=YOUR_SIGN"
  ```

  ```json Success theme={null}
  {
    "code": "0",
    "message": "success",
    "data": {
      "orderNum": "EP20240124000014",
      "display": "Australia",
      "status": 0,
      "renewal": true,
      "mainOrderNum": "EP20240124000013",
      "renew": 1,
      "cardApiDtoList": [
        {
          "iccid": "162984356292255940",
          "data": "6GB",
          "validity": 8,
          "code": "LPA:1$ais.prod.ondemandconnectivity.com$SEW7JEBMFGPRVSPD"
        }
      ]
    }
  }
  ```
</CodeGroup>
