Docs
Order Profiles

Order Profiles

Order eSIM profiles for your customers

Order eSIM Profiles

Order new eSIM profiles with data packages for your customers.

Order Profiles

Endpoint: POST /api/v1/open/esim/order

Request Parameters

NameTypeRequiredDescriptionExample
transactionIdStringRequiredYour unique transaction ID (max 64 chars)order_123456
amountIntegerOptionalTotal order amount * 10,00045000
packageInfoListArrayRequiredList of packages to order

Package Info Object

NameTypeRequiredDescriptionExample
packageCodeStringRequiredPackage code or slugTH_1_7
countIntegerRequiredNumber of eSIMs to order1
priceIntegerOptionalPackage price * 10,00045000
periodNumIntegerOptionalNumber of days for day pass plans3

Example Request - Single eSIM

curl --location --request POST 'https://your-api-domain.com/api/v1/open/esim/order' \
--header 'RT-AccessCode: YOUR_ACCESS_CODE' \
--header 'RT-SecretKey: YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "transactionId": "order_123456",
    "amount": 45000,
    "packageInfoList": [{
        "packageCode": "TH_1_7",
        "count": 1,
        "price": 45000
    }]
}'

Example Request - Multiple eSIMs

curl --location --request POST 'https://your-api-domain.com/api/v1/open/esim/order' \
--header 'RT-AccessCode: YOUR_ACCESS_CODE' \
--header 'RT-SecretKey: YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "transactionId": "order_789012",
    "amount": 135000,
    "packageInfoList": [{
        "packageCode": "TH_1_7",
        "count": 3,
        "price": 45000
    }]
}'

Example Request - Day Pass Plan

For day pass plans, include periodNum to specify the number of days.

curl --location --request POST 'https://your-api-domain.com/api/v1/open/esim/order' \
--header 'RT-AccessCode: YOUR_ACCESS_CODE' \
--header 'RT-SecretKey: YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "transactionId": "order_daypass_001",
    "packageInfoList": [{
        "packageCode": "JP_DAYPASS_1",
        "count": 1,
        "periodNum": 5
    }]
}'

Response Parameters

NameTypeDescription
successBooleantrue = succeeded, false = failed
errorCodeStringError code when failed
errorMsgStringError message
objObjectOrder result data

Order Result Object

FieldTypeDescriptionExample
orderNoStringPlatform order numberORD20240101123456
transactionIdStringYour transaction IDorder_123456
orderStatusStringOrder statusGOT_RESOURCE
profileListArrayList of eSIM profiles

Profile Object

FieldTypeDescriptionExample
iccidStringeSIM ICCID8901234567890123456
esimTranNoStringeSIM transaction numberESIM123456
packageCodeStringPackage codeTH_1_7
smdpAddressStringSM-DP+ server addresssmdp.example.com
matchIdStringeSIM activation codeXXXX-XXXX-XXXX-XXXX
profileStatusStringProfile statusGOT_RESOURCE
qrCodeStringBase64 QR code imagedata:image/png;base64,...
appleInstallUrlStringApple direct install URLhttps://esimsetup.apple.com/...

Example Success Response

{
    "errorCode": null,
    "errorMsg": null,
    "success": true,
    "obj": {
        "orderNo": "ORD20240101123456",
        "transactionId": "order_123456",
        "orderStatus": "GOT_RESOURCE",
        "profileList": [
            {
                "iccid": "8901234567890123456",
                "esimTranNo": "ESIM123456",
                "packageCode": "TH_1_7",
                "smdpAddress": "smdp.example.com",
                "matchId": "XXXX-XXXX-XXXX-XXXX",
                "profileStatus": "GOT_RESOURCE",
                "qrCode": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...",
                "appleInstallUrl": "https://esimsetup.apple.com/esim_qrcode_provisioning?carddata=..."
            }
        ]
    }
}

Order Status Values

StatusDescription
GOT_RESOURCEeSIM profile allocated successfully
IN_PROGRESSOrder is being processed
FAILEDOrder failed
CANCEL_SUCCESSOrder cancelled

Profile Status Values

StatusDescription
GOT_RESOURCEProfile allocated, ready for download
ACTIVATEDProfile downloaded and activated
IN_USEProfile is actively being used
USED_UPData exhausted
EXPIREDProfile validity expired
CANCELLEDProfile cancelled

Error Handling

Insufficient Balance

{
    "errorCode": "200007",
    "errorMsg": "Insufficient account balance",
    "success": false,
    "obj": null
}

Invalid Package

{
    "errorCode": "310241",
    "errorMsg": "The packageCode does not exist",
    "success": false,
    "obj": null
}

Price Mismatch

{
    "errorCode": "200005",
    "errorMsg": "Package price error. Check price",
    "success": false,
    "obj": null
}

Best Practices

  1. Always use unique transactionId - This prevents duplicate orders and allows tracking
  2. Verify prices before ordering - Use the package list API to get current prices
  3. Store the orderNo and iccid - You'll need these for queries and profile management
  4. Handle the QR code - Display to customer for eSIM installation
  5. Use webhooks - Get notified of order status changes