preview_order
Returns the price breakdown WITHOUT placing an order — one tool for every vertical (top-up, travel eSIM, gift card; type is inferred from price_token / catalog_id). Required for PRO credits (shows the debit before create_order). Optional for guest / consumer payment_link — guests can skip preview and create immediately. Guest checkout_mode=payment_link; OAuth PRO checkout_mode=credits. Travel eSIM also returns unlimited and data_gb.
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 (optional) | |
| 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) | |
| sms_notification | No | Top-up only: include the 0.99 EUR SMS fee in the breakdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | topup | giftcard | esim | |
| data_gb | No | Travel eSIM only. | |
| pricing | No | ||
| unlimited | No | Travel eSIM only. | |
| catalog_id | No | Travel eSIM only. | |
| environment | No | production | sandbox | |
| checkout_mode | No | PRO=credits (shows credit applied). Consumer=payment_link (user pays on doctorsim.com after create_order). | |
| currency_basis | No |