Submit a esim order.
URL
Request Method
- POST
Request Header
| Header Name | Optional | Value |
|---|---|---|
| content-type | yes | application/json |
| appId | yes | Your app ID |
| timestamp | yes | Current timestamp |
| sign | yes | HMAC-SHA256 signature |
| idempotentKey | no | A unique identifier used to ensure request idempotency |
Request Examples
curl --location 'http://sandbox-api.yoni-esim.com/v1/order/e-sim' \
--header 'appId: {{appId}}' \
--header 'timestamp: {{timestamp}}' \
--header 'sign: {{sign}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"packageCode":"YN2602130xxxxx",
"email":"[email protected]"
}'
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n \"packageCode\":\"YN2602130xxxxx\",\r\n \"email\":\"[email protected]\"\r\n}");
Request request = new Request.Builder()
.url("http://sandbox-api.yoni-esim.com/v1/order/e-sim")
.method("POST", body)
.addHeader("appId", "{{appId}}")
.addHeader("timestamp", "{{timestamp}}")
.addHeader("sign", "{{sign}}")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
var request = require('request');
var options = {
'method': 'POST',
'url': 'http://sandbox-api.yoni-esim.com/v1/order/e-sim',
'headers': {
'appId': '{{appId}}',
'timestamp': '{{timestamp}}',
'sign': '{{sign}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"packageCode": "YN2602130xxxxx",
"email": "[email protected]"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
import json
url = "http://sandbox-api.yoni-esim.com/v1/order/e-sim"
payload = json.dumps({
"packageCode": "YN2602130xxxxx",
"email": "[email protected]"
})
headers = {
'appId': '{{appId}}',
'timestamp': '{{timestamp}}',
'sign': '{{sign}}',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Request Parameter
| Name | Optional | Type | Description |
|---|---|---|---|
| packageCode | no | String | unique identifier for package |
| yes | String |
Response Example
{
"code": 0,
"data": {
"orderNo": "20260325162390116407xxxxxx"
},
"msg": "success"
}
Response Result
| Name | Type | Description |
|---|---|---|
| code | String | eSIM response code (error codes) |
| msg | String | Result description |
| data | Object | Object containing orderNo |
| data.orderNo | String | Unique order number |
