create_esim_order
Alias of create_order with type=esim (kept for existing connectors). Guest / consumer: call without Authorization as soon as the plan is chosen — preview is optional. Show the buyer only payment_link and order_id when one exists. Never display checkout_hash (machine id for get_order_status). Buyer types email on the doctorsim.com checkout page and receives the eSIM by email after payment — do not promise an in-chat QR for guests. PRO OAuth: preview first, then create — debits prepaid credits and returns order_id, status, credits_used. Pass a unique idempotency_key per create. If the result lacks order_id, call list_orders / get_order_status — never re-create. Confirmation is emailed to the titular account when one is linked. Sandbox keys create a fake eSIM order (sandbox_esim_{id}, no credit debit, no ticket).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | ||
| currency | No | ||
| catalog_id | Yes | ||
| price_token | Yes | ||
| checkout_mode | No | Optional. Omit for the default doctorsim.com hash payment_link. stripe_link returns a Stripe Checkout Session URL when agentic_stripe_link is ON. | |
| idempotency_key | No | Required for safe retries. 1-128 printable ASCII. Same key + same account returns the original order (no second charge). Use a NEW key for each distinct SKU / denomination. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | ||
| type | No | topup | giftcard | esim | |
| status | No | ||
| payment | No | Nested gateway / provider receipt details. Never the sole success signal. | |
| currency | No | ||
| order_id | No | Show this to the buyer when present (PRO credit checkout, or after payment). | |
| expires_at | No | ||
| environment | No | production | sandbox | |
| credits_used | No | Decimal amount, normally a string, e.g. "21.98" | |
| payment_link | No | The only URL to show the buyer. Guest / consumer pay on doctorsim.com. | |
| show_to_user | Yes | Fields the assistant may show the buyer. | |
| checkout_hash | No | Machine identifier for get_order_status. Never show or read aloud. | |
| checkout_mode | No | credits (PRO credit checkout) | payment_link (guest / consumer pays on doctorsim.com) | stripe_link (opt-in Stripe Checkout Session URL when requested and agentic_stripe_link is ON). | |
| checkout_hash_usage | No | machine_only | |
| assistant_instruction | Yes |