Guide
Explorer
no key
Production key active. Mutating requests (POST/PATCH/DELETE) execute live actions and may deduct credits. Sandbox keys (test_*) remain safe for integration testing.

doctorSIM API v2

Integrate mobile top-ups and digital gift cards for 200+ countries and 1,600+ carriers into your application. This API powers the doctorSIM Agentic Commerce Platform for AI agents and developers.

MCP Server

AI agents can connect via the MCP Server guide using OAuth + PKCE. PRO accounts debit prepaid credits on POST /orders. Regular OAuth users receive a payment_link (hash checkout on doctorsim.com) and get an order_id only after payment.

Order Flows

Mobile top-ups and gift cards share authentication and order endpoints. PRO checkout uses credits; consumer OAuth uses payment links. Always call POST /orders/preview before POST /orders.

Mobile top-up
1

Lookup phone number

Detect the carrier and country from an E.164 MSISDN before pricing.

GET /carriers/lookup/{phone}
2

Select airtime, data, or bundle

List service types, then pick a rate token for airtime, data, or bundle pricing.

GET /operators/{id}/service-types
GET /operators/{id}/rates
3

Preview price

Confirm the exact breakdown (recharge, service fee, optional SMS fee, total) before placing the order. No credits deducted.

POST /orders/preview
4

Order

Place the top-up with price_token and the recipient phone. PRO: credits deducted instantly. Consumer OAuth: returns payment_link.

POST /orders
Gift cards
1

Select country

Browse supported destinations and note the country ID or ISO code.

GET /countries
2

Search catalog

Find the gift card brand or product, then load rates and copy the token.

GET /products/search?country=
GET /operators/{id}/rates
3

Preview price

Confirm cost, service fee, and total before checkout. Same body as POST /orders; no order created.

POST /orders/preview
4

Order

Place the gift card order with price_token. Gift cards are delivered digitally — no phone number needed.

POST /orders
Monitor (both)
5

Monitor delivery

Poll order status or register webhooks for async updates on top-ups and gift cards.

GET /orders/{id}
POST /webhooks

Authentication

All protected endpoints accept either API keys or OAuth 2.0 access tokens in the Authorization header.

API keys (server-to-server)

Best for backend integrations and the Explorer above. The Bearer token must contain a colon separating api_id and api_secret:

Authorization: Bearer {api_id}:{api_secret}

Log in to your PRO account, then create keys under My Account → API. The secret is shown only once — store it securely.

OAuth 2.0 (recommended for agents)

Available on this environment. Use dynamic client registration and authorization code + PKCE for interactive agents, or client credentials where supported.

ResourceURL
Authorization server metadatahttps://www.doctorsim.com/.well-known/oauth-authorization-server
Register clientPOST https://www.doctorsim.com/oauth/register
Authorize (PKCE)GET https://www.doctorsim.com/oauth/authorize
Token exchangePOST https://www.doctorsim.com/oauth/token
Agent auth guidehttps://www.doctorsim.com/auth.md

OAuth JWTs use a plain Bearer token (no colon). PRO: scopes include orders:read, orders:write, balance:read, and webhooks. Consumer OAuth: orders:read and orders:write only (no balance or webhooks).

Sign up for a PRO account to get API access and start integrating. See also the Agents landing page.

Environments

Both environments use the same host. The key prefix determines the mode:

EnvironmentKey prefixBehavior
Sandboxtest_*Orders stored in api_sandbox_orders; webhook cron simulates fulfillment (no credits, no Zendesk)
Productionlive_*Live transactions, credits deducted from your balance

Response Format

All responses follow a consistent envelope:

{
  "success": true,
  "data": { ... },
  "meta": {
    "request_id": "req_abc123...",
    "timestamp": "2026-03-24T12:00:00Z"
  }
}

Error responses include an error object with a machine-readable code and human-readable message:

{
  "success": false,
  "data": null,
  "error": {
    "code": "INSUFFICIENT_CREDITS",
    "message": "Insufficient credit balance."
  },
  "meta": { ... }
}

Rate Limits

TierRequests/minHeaders
Free50X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
Pro500
Enterprise5,000

Endpoint Reference

Countries & Operators

Discover supported destinations. Start here to find country IDs and operator IDs needed for pricing and orders.

MethodPathDescription
GET/countriesList all supported countries with operator counts
GET/operators?country=List carriers for a country (e.g., Vodafone, Telcel)
GET/operators/{id}/service-typesService types for an operator (airtime, bundles, data)
GET/service-typesAll service type definitions

Products & Pricing

Search the catalog and get live pricing. Each rate includes a token plus service_fee_eur/usd and total_cost_eur/usd per price point. Pass the token as price_token in preview and order calls; use POST /orders/preview for the authoritative full breakdown (including optional SMS fee).

MethodPathDescription
GET/operators/{id}/ratesAgent-friendly rate list with token, service fee, and total per price point
GET/products/search?country=Catalog search with operator/service/image data
GET/products/{operator_id}Full operator detail with live pricing

Carrier Lookup

Detect the carrier from any phone number. Returns the operator ID needed for pricing and ordering.

MethodPathDescription
GET/carriers/lookup/{phone}Identify carrier from E.164 phone number

Orders

Preview pricing, create orders, and track delivery. POST /orders/preview returns the exact account-specific breakdown (recharge, service fee, optional 0.99 EUR SMS fee, total, credit applied) without placing an order — requires read scope. Credits are deducted only on POST /orders (requires read-write / orders:write).

MethodPathDescription
POST/orders/previewPreview exact price breakdown; same body as create order, no credits deducted
POST/ordersCreate a top-up or gift card order
GET/ordersList completed orders (keyset pagination)
GET/orders/{id}Get single order status and details

Balance

Monitor your prepaid credit balance and transaction history.

MethodPathDescription
GET/balanceCurrent credit balance (EUR)
GET/balance/historyRecent credit transactions

Webhooks

Subscribe to order events. Max 5 webhooks per account. The signing secret is shown only once at creation.

MethodPathDescription
POST/webhooksRegister a webhook (HTTPS only)
GET/webhooksList all webhooks
GET/webhooks/{id}Get webhook detail
PATCH/webhooks/{id}Update URL, events, or status
DEL/webhooks/{id}Delete a webhook

Events: order.created, order.fulfilled, order.failed

Sandbox vs. Production: Use sandbox keys (test_*) for safe integration testing — orders are stored in api_sandbox_orders and auto-fulfilled via the webhook cron (no credits, no Zendesk). Production keys (live_*) work in the Explorer too; mutating calls show a confirmation because they deduct credits and place real orders.

Select an endpoint

Choose an endpoint from the sidebar to see its parameters, execute it, and view the response. Enter your API credentials in the top bar to make live calls.