Travixor GlobalDevelopers

Find packages

The catalogue lists the packages you can buy right now, each with your own price. A package that cannot be bought at the moment is left out, so everything on the list can be quoted.

Listing packages

Call GET /v1/catalog/packages with the catalog:read scope. Packages come sorted by name. Narrow the list with these query parameters.

ParameterMeaning
countryA two-letter country code such as TR. Plans that cover several countries appear under each of them.
typecountry for a single country, region for a group of countries, global for worldwide plans.
limitHow many packages per page, 1 to 100. The default is 50.
cursorThe next_cursor of the previous page.

When next_cursor is null you have reached the last page. Pages can come back with fewer packages than limit only on the last page.

cURL
# The first page of packages that work in Turkey
curl "https://api.travixorglobal.com/v1/catalog/packages?country=TR&limit=20" \
  -H "Authorization: Bearer $TRAVIXOR_API_KEY"

# The next page: send the next_cursor from the answer above as cursor
curl "https://api.travixorglobal.com/v1/catalog/packages?country=TR&limit=20&cursor=NEXT_CURSOR" \
  -H "Authorization: Bearer $TRAVIXOR_API_KEY"
TypeScript
interface Page {
  packages: Array<{ id: string; name: string; price_cents: number }>
  next_cursor: string | null
}

const packages: Page['packages'] = []
let cursor: string | null = null

do {
  const url = new URL('https://api.travixorglobal.com/v1/catalog/packages')
  url.searchParams.set('country', 'TR')
  url.searchParams.set('limit', '100')
  if (cursor) url.searchParams.set('cursor', cursor)

  const res = await fetch(url, { headers: { authorization: `Bearer ${process.env.TRAVIXOR_API_KEY}` } })
  if (!res.ok) throw new Error(`Request failed with status ${res.status}`)
  const page = (await res.json()) as Page

  packages.push(...page.packages)
  cursor = page.next_cursor
} while (cursor)

console.log(`${packages.length} packages`)
Python
import os

import requests

headers = {"Authorization": f"Bearer {os.environ['TRAVIXOR_API_KEY']}"}
packages = []
params = {"country": "TR", "limit": 100}

while True:
    res = requests.get(
        "https://api.travixorglobal.com/v1/catalog/packages",
        headers=headers,
        params=params,
        timeout=30,
    )
    res.raise_for_status()
    page = res.json()
    packages.extend(page["packages"])
    if not page["next_cursor"]:
        break
    params["cursor"] = page["next_cursor"]

print(f"{len(packages)} packages")

What a package holds

Example package. The values are made up.
{
  "id": "0b7e2a54-6f1c-4d58-9a3e-2c91f0d7b6a4",
  "name": "Turkey 1GB 7 Days",
  "type": "country",
  "countries": [
    "TR"
  ],
  "data_gb": 1,
  "daily_high_speed_gb": null,
  "unlimited": false,
  "validity_days": 7,
  "sold_per_day": false,
  "max_days": null,
  "voice_minutes": null,
  "sms_count": null,
  "summary": "1 GB for 7 days",
  "price_cents": 1023,
  "price_per": "esim",
  "currency": "USD"
}
FieldMeaning
idUse this as package_id in quotes. It never changes.
countriesTwo-letter codes of the countries where the eSIM works.
data_gbTotal data of a fixed-data plan. null for daily-limit and unlimited plans.
daily_high_speed_gbFull-speed data per day for a daily-limit plan. After that the speed drops; summary says how far.
unlimitedTrue for plans with no data cap. Read summary for any fair-use limit.
validity_daysHow many days the package lasts. null for packages sold per day.
sold_per_day, max_daysFor packages where you choose the number of days. See Packages sold per day.
price_cents, price_perYour price in US cents. price_per is esim for one eSIM and day for one day of a stay.

About prices

The price in the list is the price a quote gives you, so you can show it to your customers or use it to plan. It can change between two calls. A quote fixes the price for 5 minutes, and the order is always charged at the quoted price.

The price belongs to your organisation. Another partner may see a different one for the same package, so do not share it.

Read one package with GET /v1/catalog/packages/{id}. It answers 404 when the package does not exist or cannot be bought right now.