> ## 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/renewCardByApiCode — Renew plan by API code

> Renew a SIM card plan using a package's apiCode instead of skuId and priceId. Identify the card by order number or ICCID. Supports eSIM and physical SIM.

An alternative to [Renew Order](/api-reference/renew-order) that uses the package `apiCode` for the renewal plan. Identify the card by order number or ICCID, just as with the standard renewal endpoint.

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

## Request parameters

<ParamField body="token" type="string" required>Session token.</ParamField>
<ParamField body="apiCode" type="string" required>Package API code for the renewal plan (e.g. `"99162-0-3-1-G"`).</ParamField>
<ParamField body="sign" type="string" required>Request signature.</ParamField>
<ParamField body="orderNum" type="string">Order number to renew. 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="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

Identical to [Renew Order](/api-reference/renew-order). The `renewal` field is `true` and `mainOrderNum` links back to the original order.

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://bpm.mioesim.com/api_esim/renewCardByApiCode \
    -d "token=YOUR_TOKEN" \
    -d "iccid=934801019851134300" \
    -d "apiCode=40-0-3-1-G" \
    -d "backInfo=1" \
    -d "sign=YOUR_SIGN"
  ```

  ```json Success theme={null}
  {
    "code": "0",
    "message": "success",
    "data": {
      "orderNum": "EP20240124000014",
      "renewal": true,
      "mainOrderNum": "EP20240124000013",
      "renew": 1
    }
  }
  ```
</CodeGroup>
