Skip to Content
OpenRoam Docs
Airtime

Quote airtime

Prices the order body with current prices, without placing an order.

POST
/v1/airtime/quote

Prices the order body with current prices, without placing an order.

Takes the same body as order and resolves the number's operator as the order does, with a carrier lookup per item. Each item is priced on its own, in request order; the first failing item aborts the quote and is named at items[i], for example 409 / 11002 at items[i].inputs.maxPrice when the current price is above it. 409 / 20000 means the lookup shows that the offer's operator cannot be the number's: search again. A carrier lookup that fails gives 503 / 10007. A quote reserves nothing and does not expire; to hold the quoted price, send it as inputs.maxPrice in the order.

Authorization

PartnerApiKey
headerX-Partner-Key<token>

Partner API Key (X-Partner-Key)

Request Body

  1. body

The body B2B airtime quote and order both take.

currency?|

Order currency, three letters in either case; the API key's currency when omitted. An unsupported code gives 400 / 10001 at currency, reason NOT_SUPPORTED, before any item is checked.

referenceId?|

Optional partner order reference, unique per partner, at most 128 characters without leading or trailing spaces. A quote validates it and ignores it.

items*array<>

1 to 5 items, each topping up one number once.

Response Body

OK

  1. response

Current prices for the requested items, in request order. total is the sum of each item's unit price times its quantity. A quote reserves nothing and does not expire.

currency*string
items*array<>
total*
Example Request
curl -X POST 'https://api.sandbox.openroam.com/v1/airtime/quote' \  -H 'Content-Type: application/json' \  -d '{  "currency": "USD",  "referenceId": "partner-order-42",  "items": [    {      "publicId": "airtime_raanuxyz6cxzie3w3my6c3r2wm",      "quantity": 1,      "inputs": {        "phoneNumber": "+994501234567",        "maxPrice": {          "amount": 25,          "currency": "USD"        }      }    },    {      "publicId": "airtime_ms45o6lwxtqgrsculqdhop74zq",      "quantity": 1,      "inputs": {        "phoneNumber": "+994501234567",        "value": {          "amount": 50,          "currency": "AZN"        },        "maxPrice": {          "amount": 31.25,          "currency": "USD"        }      }    }  ]}'
Example Response
{  "currency": "USD",  "items": [    {      "publicId": "airtime_raanuxyz6cxzie3w3my6c3r2wm",      "quantity": 1,      "name": "Test operator 40 AZN",      "value": {        "amount": 40,        "currency": "AZN"      },      "price": {        "amount": 25,        "currency": "USD"      },      "details": {        "estimatedDeliveredValue": {          "amount": 40,          "currency": "AZN"        }      }    },    {      "publicId": "airtime_ms45o6lwxtqgrsculqdhop74zq",      "quantity": 1,      "name": "Test operator 50 AZN",      "value": {        "amount": 50,        "currency": "AZN"      },      "price": {        "amount": 31.25,        "currency": "USD"      },      "details": {        "estimatedDeliveredValue": {          "amount": 50,          "currency": "AZN"        }      }    }  ],  "total": {    "amount": 56.25,    "currency": "USD"  }}