create_order
Place the order — one tool for every vertical; type is inferred from price_token / catalog_id. Send price_token only for gift cards (no phone, no country_id). Success always returns order_id, status, and (PRO credits) credits_used — never treat raw payment-gateway text as confirmation. Guest / consumer: call as soon as the product is chosen (preview optional). Show the buyer only payment_link and order_id when one exists. Never display checkout_hash. Guest products are emailed after the buyer pays on doctorsim.com. OAuth PRO: preview first, then create — same body as preview. Multi-SKU (e.g. three gift cards): N create_order calls with a DISTINCT idempotency_key each. If a response lacks order_id, call list_orders / get_order_status — never re-create on ambiguous success. Offer account linking only if the user asks for PRO credits or saved settings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | ||
| type | No | Order vertical. Optional — inferred from price_token (top-up / gift card rate token vs eSIM token) or catalog_id. Set esim for travel eSIM. | |
| phone | No | Recipient E.164 phone number. Required for mobile/airtime top-ups. Do NOT provide for gift cards or eSIM (digitally delivered) — omit it. | |
| currency | No | Travel eSIM only: display currency. | |
| sms_text | No | Custom SMS text (max 140 chars). Only used when sms_notification=true. If omitted, a default localized message is sent. | |
| catalog_id | No | Travel eSIM only: catalog_id from get_esim_plans (with its price_token). | |
| country_id | No | Do NOT send when using price_token — destination is encoded in the token. If you must send it, copy id_country from get_countries or product search (Spain=34). Never invent a number. | |
| operator_id | No | Optional. Omit when using price_token. If sent, must be id_operator from rates/search. | |
| price_token | Yes | token from get_operator_rates (top-up / gift card) or price_token from get_esim_plans (travel eSIM) | |
| checkout_mode | No | Optional. Omit for the default doctorsim.com hash payment_link (D-1). stripe_link returns a Stripe Checkout Session URL when agentic_stripe_link is ON; otherwise STRIPE_LINK_DISABLED (no silent fallback). PRO credits always win over stripe_link. Same checkout_hash for get_order_status. Minting a Shared Payment Token via Stripe Link Agents is a different rail — do not send stripe_link for that. | |
| 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. Also accepted as HTTP Idempotency-Key. | |
| sms_notification | No | Top-up only: send an SMS to the recipient (adds a fixed 0.99 EUR fee). Ignored for gift cards and eSIM. |
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 |