API i SDK

API i SDK

Wbuduj Atli we własną aplikację lub stronę, na własnych ekranach.

Atli eSIM API

v1.0.0

Buy and manage travel eSIMs: browse the catalogue, quote and buy a plan, install and track an eSIM, share one as a gift, and run a group account.

Paths are unversioned and the version of this document is in info.version, as on heyatli.com's published API. A breaking change will arrive under a new base URL rather than by changing what a path here means.

Bazowy URL
https://api.heyatli.com
Plik OpenAPI
https://api.heyatli.com/openapi.yaml

Główne ścieżki

Główne ścieżki APIUżytkownik zostaje utworzony, dostaje wycenę, kupuje i płaci, otrzymuje eSIM, instaluje ją i śledzi zużycie. Opcjonalne odgałęzienia: prawdziwe konto, zapisanie karty, karta grupowa, doładowanie, zniżki i zakup do udostępnienia, a potem udostępnienie linku, przez który ktoś ją odbiera.
Utwórz użytkownikaPOST /login
Uzyskaj wycenęPOST /plan/quote
Kup i zapłaćPOST /plan/purchase
Odbierz eSIMGET /fulfillment/…
ZainstalujGET /esims
Śledź zużyciePOST /esims/{id}/sync
Prawdziwe kontoE-mail, Telegram, WhatsApp
Zapisz kartęStripe SetupIntent
Karta grupowagroup_id
Doładujtarget_esim_id
ZniżkiVouchery, środki, polecenia
Kup do udostępnieniais_gift, max_claims
Udostępnij linkGET /public/gifts/{code}
OdbierzMoże wymagać prawdziwego konta
Główna ścieżkaOpcjonalne

Wybierz ścieżkę na mapie, aby zobaczyć jej kroki.

SDK

Wygeneruj gotowego klienta dla swojego języka z naszego pliku OpenAPI.

docker run --rm -v "$PWD:/out" \
  openapitools/openapi-generator-cli generate \
  -i https://api.heyatli.com/openapi.yaml \
  -g typescript-fetch -o /out/atli-sdk

Authentication

Most routes need a bearer token, issued by signing in through /login, /register or one of the /oauth/* flows, and refreshed at /refresh. Each operation states whether a token is required, read when sent, or ignored. Tokens identify a person, not an application; there is no application API key yet.

Enums

A field with a listed set of values may gain new ones: that ships as a minor version, never a new base URL. Treat a value you do not recognise as one you do not handle yet, not as invalid, and never let it fail parsing.

Errors

Every failed request answers with the same body: a stable code, an English message, a trace_id to quote when reporting a problem, and sometimes params. Branch on code and never on message.

Zobacz częste kody błędów
400

Żądanie jest nieprawidłowe

401

Brak logowania lub logowanie wygasło

402

Płatność się nie powiodła

403

Ten użytkownik nie ma do tego uprawnień

404

Nie istnieje lub nie należy do tego użytkownika

429

Zbyt wiele żądań: odczekaj czas z Retry-After

500

Coś poszło nie tak po naszej stronie

Rate limits

Sign-in, registration, token refresh, email codes, voucher redemption, quotes, reviews and eSIM sync are throttled per caller. A refused request answers 429 with Retry-After in whole seconds, alongside X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Wait out Retry-After rather than retrying in a loop.

Language and currency

Send X-Locale (or Accept-Language, or ?lang=) to choose the language; the language answered in comes back as Content-Language, falling back to English. Prices follow the signed-in person's currency, or the currency a quote asks for.

Buying a plan

Quote first at /plan/quote, then pass the quote_id to /plan/purchase so the price you showed is the price charged. Send an idempotency_key on every purchase: the same key never buys twice.