> ## 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/addEsimOrder — Place a SIM card order

> Place an eSIM or physical SIM card order using a SKU ID and price ID. Returns activation codes, QR code data, and ICCID for each card ordered.

This is the core ordering endpoint. Pass a SKU ID and price ID (from [Get Packages](/api-reference/get-packages)) to purchase one or more SIM cards. The response includes eSIM activation details — SM-DP+ address, activation code, LPA string, and PDF link.

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

## Request parameters

<ParamField body="token" type="string" required>
  Session token from [Login](/api-reference/login).
</ParamField>

<ParamField body="skuId" type="string" required>
  Product SKU ID.
</ParamField>

<ParamField body="priceId" type="string" required>
  Package price ID from [Get Packages](/api-reference/get-packages).
</ParamField>

<ParamField body="count" type="string" required>
  Number of SIM cards to order.
</ParamField>

<ParamField body="sign" type="string" required>
  Request signature.
</ParamField>

<ParamField body="daypassDays" type="string">
  Required when `supportDaypass=1`. Number of days for a DayPass order (must satisfy `minDay`–`maxDay`).
</ParamField>

<ParamField body="beginDate" type="string">
  Required when `mustDate=1`. Plan start date in `MM/dd/yyyy` format.
</ParamField>

<ParamField body="backInfo" type="string">
  Controls response format: `0` or empty = return order number only; `1` = return full order details; `2` = return PDF URL info.
</ParamField>

<ParamField body="dpId" type="string">
  Required for physical SIM orders. DP identifier from [Get DP Info](/api-reference/get-dp-info).
</ParamField>

<ParamField body="iccids" type="string">
  For physical SIM: comma-separated list of ICCIDs. Count must equal `count`.
</ParamField>

<ParamField body="customerEmail" type="string">
  Customer email address. eSIM PDF is sent here if `isSendEmail=1`.
</ParamField>

<ParamField body="isSendEmail" type="string">
  `1` to send email; `0` or empty to skip.
</ParamField>

<ParamField body="pdfLanguage" type="string">
  PDF language code (e.g. `en-US`, `zh-CN`). Defaults to English. See [PDF Languages](/reference/pdf-languages).
</ParamField>

<ParamField body="otherOrderId" type="string">
  Your platform's order ID for reconciliation.
</ParamField>

<ParamField body="otherItemId" type="string">
  Your platform's line item ID.
</ParamField>

<ParamField body="remark" type="string">
  Optional order notes.
</ParamField>

## Response fields

When `backInfo=1`, the response includes full order details:

<ResponseField name="data" type="object">
  <Expandable title="Order fields">
    <ResponseField name="orderNum" type="string">MIOeSIM order number (e.g. `EP20240124000013`).</ResponseField>
    <ResponseField name="display" type="string">Product display name.</ResponseField>
    <ResponseField name="purchaseDate" type="string">Order creation time (GMT+8).</ResponseField>
    <ResponseField name="count" type="integer">Quantity ordered.</ResponseField>
    <ResponseField name="price" type="string">Total price charged.</ResponseField>
    <ResponseField name="status" type="integer">Order status. See [Order Statuses](/reference/order-statuses).</ResponseField>
    <ResponseField name="priceId" type="integer">Package price ID.</ResponseField>

    <ResponseField name="cardApiDtoList" type="array">
      eSIM card details — one entry per SIM card ordered.

      <Expandable title="Card fields">
        <ResponseField name="iccid" type="string">Card ICCID.</ResponseField>
        <ResponseField name="mobileNumber" type="string">eSIM phone number.</ResponseField>
        <ResponseField name="sm_dp_address" type="string">SM-DP+ server address.</ResponseField>
        <ResponseField name="activationCode" type="string">Activation code.</ResponseField>
        <ResponseField name="code" type="string">LPA string for Android: `LPA:1$sm_dp_address$activationCode`.</ResponseField>
        <ResponseField name="activateBefore" type="string">Latest date to activate the eSIM.</ResponseField>
        <ResponseField name="data" type="string">Total data (e.g. `"6GB"`).</ResponseField>
        <ResponseField name="validity" type="integer">Validity in days.</ResponseField>
        <ResponseField name="usedMB" type="string">Data consumed in MB.</ResponseField>
        <ResponseField name="pdfUrl" type="string">PDF download link (when generated).</ResponseField>
        <ResponseField name="apn" type="string">APN setting.</ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://bpm.mioesim.com/api_esim/addEsimOrder \
    -d "token=YOUR_TOKEN" \
    -d "skuId=45" \
    -d "priceId=441" \
    -d "count=1" \
    -d "backInfo=1" \
    -d "customerEmail=user@example.com" \
    -d "isSendEmail=1" \
    -d "pdfLanguage=en-US" \
    -d "sign=YOUR_SIGN"
  ```

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

  ```json Success (backInfo=1) theme={null}
  {
    "code": "0",
    "message": "success",
    "data": {
      "orderNum": "EP20240124000013",
      "display": "Australia",
      "purchaseDate": "2024-01-24(GMT+8)",
      "count": 1,
      "price": "9.89",
      "status": 0,
      "priceId": 9726,
      "cardApiDtoList": [
        {
          "iccid": "934801019851134300",
          "mobileNumber": "0841823354",
          "sm_dp_address": "ais.prod.ondemandconnectivity.com",
          "activationCode": "SEW7JEBMFGPRVSPD",
          "code": "LPA:1$ais.prod.ondemandconnectivity.com$SEW7JEBMFGPRVSPD",
          "activateBefore": "2024-02-24(GMT+8)",
          "data": "6GB",
          "validity": 8,
          "usedMB": "0.0",
          "apn": "plus"
        }
      ]
    }
  }
  ```
</CodeGroup>

<Tip>
  Use [Verify Resources](/api-reference/verify-resources) before placing large orders to confirm sufficient card inventory.
</Tip>
