# Introduction

The GMJ Roaming API lets you sell travel eSIMs from your own app, website or bot. You buy eSIMs
from your **GMJ account balance**, and we give you everything your customer needs to install
them: a QR code, an install link and an LPA activation code.

## What you can do

| Task | Endpoints (v1) |
| --- | --- |
| Find packages for a destination | `GET /list-country`, `GET /list-esim` |
| Buy eSIMs | `POST /checkout` |
| Hand the eSIM to your customer | `POST /myesim`, `GET /public-esim-link` |
| Follow installs, usage and expiry | [Webhooks](/webhooks), `GET /esim-live-usage` |
| Add more data | `GET /list-topupdataplan`, `POST /topup-esim` |
| Cancel, suspend or revoke | `POST /cancel-esim`, `/suspend`, `/unsuspend`, `/revoke` |

## How a purchase works

<Mermaid
  chart={`sequenceDiagram
  participant You as Your server
  participant GMJ as GMJ Roaming API
  You->>GMJ: GET /list-esim?locationCode=JP
  GMJ-->>You: packages + your prices
  You->>GMJ: POST /checkout [packageCode, count, transaction_id]
  GMJ-->>You: 200 Checkout successful
  You->>GMJ: POST /myesim {transaction_id}
  GMJ-->>You: eSIM with QR code and install link
  GMJ--)You: webhooks: ESIM_STATUS, DATA_USAGE, VALIDITY_USAGE`}
/>

1. List packages for a destination with `GET /list-esim`.
2. Buy with `POST /checkout`. The call waits until the eSIMs are ready and returns `200`.
3. Fetch the eSIMs (QR code, install link, activation code) with `POST /myesim`.
4. Get [webhooks](/webhooks) when the customer installs the eSIM, uses data or reaches expiry.

If a purchase fails, you get `500` and your balance is refunded automatically.

## Versions

- **v1** (`/api/v1`) is the **production** API. Build on this.
- **v2** (`/api/v2`) is **alpha**. It can change at any time and isn't for production.
  See [Versions](/versions).

Next: [Quickstart](/quickstart).
