purchase_esim
Charge the wallet and issue an eSIM, no checkout. client_ref (1–64 chars) is your own reference for this purchase and makes the call idempotent: a retry with the same value returns the existing order without a second charge, so reuse it after a timeout and never invent a new one for the same purchase. period_num (1–365, default 7) only for daily_unlimited plans; the charge is price × days. topup_iccid with a plan_id from list_topups tops up an eSIM. Returns the order (status paid) with order_url; poll get_order(token) for ready and the activation code. A 402 is a short balance: create_deposit first. A wallet pays for at most 50 orders in 24 hours (429 beyond that; a retry answered from client_ref does not count). Needs the wallet code.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"plan_id": "<plan_id>",
"client_ref": "<client_ref>"
},
"name": "purchase_esim"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | en | |
| No | |||
| plan_id | Yes | ||
| client_ref | Yes | ||
| period_num | No | ||
| topup_iccid | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||