---
title: "API docs: guides and every endpoint - SimPig eSIMs"
description: "SimPig API documentation: authentication, errors and limits, selling eSIMs with copy-paste examples, callbacks, the Piggyback partner API and its signatures,…"
url: "https://simpig.com/developers"
currency: "USD"
---

The Docs

# API docs.

REST · MCP · A2A · OpenAPI 3.1

Everything to integrate SimPig: selling eSIMs from your app or assistant, reading your Piggyback sales into your own systems, and every endpoint with its fields. The overview is on the API page; the machine-readable copy is the OpenAPI document.

[The API at a glance](https://simpig.com/api) · [The OpenAPI document](https://simpig.com/api/v1/openapi.json) · [The agent guide](https://simpig.com/agents.md)

## Contents

1. The basics
2. Authentication
3. Errors and limits
4. Selling eSIMs
5. Callbacks
6. Piggyback partners
7. Checking our signatures
8. MCP and A2A
9. For tools and other platforms
10. Reference: Catalogue
11. Reference: Orders
12. Reference: Piggyback partners
13. Reference: Service

## The basics

Every endpoint is under https://simpig.com/api/v1, over HTTPS, in JSON (a Piggyback export can be CSV). Field names are camelCase. Times are ISO 8601 in UTC.

Money is an integer in the currency’s minor unit, always beside its currency: 1999 with USD is US$19.99; yen have no minor unit, so 1200 with JPY is ¥1,200. Never divide by 100 without checking the currency.

Prices can be shown and charged in USD, AUD, NZD, EUR, GBP, CAD, SGD, JPY. Add ?currency= to a catalogue read and "currency" to an order; every plan also lists its price in all of them, and each is exactly what checkout charges in that currency, conversion included.

**Try it: no key needed**

```
curl https://simpig.com/api/v1/catalog/plans/japan?currency=USD
```

## Authentication

There are no client registrations and no OAuth. Three cases:

- The catalogue, starting an order, a watch key and the service endpoints: nothing at all.
- Reading an order: the order token that starting it answered, as Authorization: Bearer <orderToken>. It is returned once, reads that one order for 14 days, and never goes in a URL.
- A Piggyback partner’s own data: a key they make on /me/piggyback (it starts pbk_), as Authorization: Bearer pbk_…. Up to three live keys, each read-only, each capped at 600 requests an hour. We keep only a hash, so a lost key is revoked and replaced, not recovered.

**A partner key**

```
curl -H "Authorization: Bearer pbk_…" https://simpig.com/api/v1/piggyback/partner/summary
```

## Errors and limits

A failure answers an HTTP status and the same envelope every time: a human sentence, a broad code (validation, unauthorized, forbidden, not_found, conflict, rate_limited, server_error), the exact reason, and for a bad input which field and why.

Over a limit is 429 with Retry-After in seconds (60). Wait that long and resend; an order resent with the same idempotencyKey is the same order, never a second one.

- Orders: 5 eSIMs at most in one, 10 per email an hour, 200 per network address an hour. Unpaid orders have their own limit: 5 started in an hour per email with none paid, 30 per network address; over that is 429 TOO_MANY_UNPAID until the hour is out or one is paid.
- A pay link lasts 30 minutes; a watch key answers for 14 days.
- A partner key: 600 requests an hour; sales come 200 a page.

**422**

```
{
  "error": "some of that is not right.",
  "code": "validation",
  "reason": "INVALID_INPUT",
  "issues": [{ "path": ["email"], "message": "Invalid email" }]
}
```

## Selling eSIMs

Your code finds a plan and starts the order; the person pays on Stripe’s page; your code reads the eSIM back. You never handle a card, and the person never needs a SimPig password.

**1. Find a plan**

```
curl "https://simpig.com/api/v1/catalog/plans/JP?currency=AUD"
# or a trip: https://simpig.com/api/v1/catalog/trip?to=JP,KR,TH
```

**2. Confirm its price live**

```
curl "https://simpig.com/api/v1/catalog/plan/<productId>?currency=AUD"
```

**3. Start the order**

```
curl -X POST https://simpig.com/api/v1/agent/orders \
  -H "Content-Type: application/json" \
  -d '{ "email": "traveller@example.com", "productId": "<productId>", "qty": 1,
        "currency": "AUD", "idempotencyKey": "order-8412",
        "callbackUrl": "https://your.app/simpig-hook", "partner": "yourcode" }'
```

**4. Read it back once paid**

```
curl -H "Authorization: Bearer <orderToken>" https://simpig.com/api/v1/agent/orders/<ref>
```

The email must be the buyer’s real address: the eSIM is sent there and nowhere else. A placeholder (example.com, as in the request above, a name like test@…, or another reserved or made-up one) is refused with 422 before any pay link exists.

Step 3 answers the order (its ref, status and total), payUrl, statusUrl and orderToken. Give the person payUrl; it lasts 30 minutes, and they are emailed it too. Keep orderToken: it is returned only here.

The status moves pending_payment → paid → provisioning → fulfilled, usually within a minute of paying. Poll every 5 to 10 seconds, or give a callbackUrl. Once fulfilled the answer carries the install details (the activation code, the SM-DP+ address and the links that install it in one tap); the person gets the same by email. The activation code is theirs: show it to them, never log it.

eSIMs are final once delivered. Before the person pays, tell them so and check their phone supports eSIM.

## Callbacks

Give a callbackUrl (https, a public host) and we POST { ref, status, statusUrl, fulfilledAt } to it when the order is fulfilled. It carries X-SimPig-Timestamp and X-SimPig-Signature: v1=<hex>, an HMAC-SHA256 over <timestamp>.<raw body>, keyed by the hex of SHA-256 of the order token. Check it, and ignore one more than a few minutes old.

**Node**

```
import { createHash, createHmac, timingSafeEqual } from 'node:crypto';

function fromSimPig(rawBody, headers, orderToken) {
  const t = headers['x-simpig-timestamp'];
  const sig = String(headers['x-simpig-signature'] ?? '').replace(/^v1=/, '');
  if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
  const key = createHash('sha256').update(orderToken).digest('hex');
  const want = createHmac('sha256', key).update(`${t}.${rawBody}`).digest('hex');
  return sig.length === want.length && timingSafeEqual(Buffer.from(sig), Buffer.from(want));
}
```

## Piggyback partners

A partner earns a share of every sale they bring (15% to start, up to 20%; the rules are on /piggyback). A program brings sales in two ways: send people to the partner link, or put the partner code on the order as "partner" (step 3 above). Add your own click id to a link as ?sub= and it comes back on the sale.

Then read the sales into your own systems with your key. Nothing names a buyer: each customer is a token that stays the same in your data and differs for every other partner. The token is derived from a secret only we hold. We change it only if we believe it has leaked, and we email partners first; after a change every customer has a new token, so tokens in exports taken before it will not match those after. Sales, amounts and commissions are unchanged by it.

**Your standing**

```
curl -H "Authorization: Bearer pbk_…" https://simpig.com/api/v1/piggyback/partner/summary
```

**Sync sales: page with next**

```
curl -H "Authorization: Bearer pbk_…" \
  "https://simpig.com/api/v1/piggyback/partner/sales?updatedSince=2026-11-01T00:00:00Z"
# → { "sales": [...], "next": "<id>" }; ask again with &after=<id> until next is null
```

**The same as CSV**

```
curl -H "Authorization: Bearer pbk_…" "https://simpig.com/api/v1/piggyback/partner/sales?format=csv" -o sales.csv
```

**By day, and payouts**

```
curl -H "Authorization: Bearer pbk_…" "https://simpig.com/api/v1/piggyback/partner/days?from=2026-10-01"
curl -H "Authorization: Bearer pbk_…" https://simpig.com/api/v1/piggyback/partner/transfers
```

Each sale carries what you need to reconcile it on one row: the plan bought (plan: productId, title, dataBytes, daily, days, and items for an order with more than one), the final price the buyer paid after any discount (amountMinor, in currency, the minor unit: cents, or whole yen), when it was made and paid (createdAt, paidAt), and the commission (commission.amountMinor in the sale’s currency, commission.earnedAudMinor in AUD cents, which is what we pay out). A minimum per sale agreed with you shows as commission.minimumUsdMinor (US cents), and the commission is never below it, nor above the price paid.

The CSV has the same fields, one column each, in the order of the JSON: sale_id, created_at, paid_at, kind, destination_code, amount_minor, currency, source, sub, customer, rate_bps, state, reason, earned_aud_minor, owed_back_aud_minor, due_at, transfer_id, stripe_transfer_id, then plan_product_id, plan_title, plan_data_bytes, plan_days, commission_minor and minimum_usd_minor (added on 2026-11-20 at the end, so a reader that goes by position still works). The download on your partner page and the API give the same rows, as JSON or CSV.

Sync with updatedSince: a sale changes after it is made (pending, then due after the hold, then paid, or void after a refund), and updatedAt moves when it does. Commission is in AUD cents (earnedAudMinor) and in the sale’s own currency (commission.amountMinor); the sale itself is in the currency the buyer paid.

Each transfer carries Stripe’s own transfer id and the sales in it, so you can match it in your Stripe dashboard.

## Checking our signatures

Every partner answer and export carries Piggyback-Signature: t=<unix seconds>,kid=<key id>,ed25519=<base64url>, an Ed25519 signature over <t>.<body>. The public key is at /.well-known/piggyback-keys.json (a JWK set). Keep the body and the header, and you can prove later exactly what we reported.

**Node 20+**

```
import { createPublicKey, verify } from 'node:crypto';

async function fromUs(body, header) {
  const p = Object.fromEntries(header.split(',').map((x) => x.split('=')));
  const { keys } = await (await fetch('https://simpig.com/.well-known/piggyback-keys.json')).json();
  const jwk = keys.find((k) => k.kid === p.kid);
  if (!jwk) return false;
  const key = createPublicKey({ key: jwk, format: 'jwk' });
  return verify(null, Buffer.from(`${p.t}.${body}`), key, Buffer.from(p.ed25519, 'base64url'));
}
```

## MCP and A2A

An assistant can use the same shop without REST. The MCP server is POST /api/mcp over Streamable HTTP, with no session and no auth; its tools are search_destinations, list_plans, plans_covering, get_plan, start_order and order_status. The A2A agent is POST /api/a2a (JSON-RPC 2.0) with the same skills. Both answer exactly what REST does.

**Claude Code, Cursor or any MCP client**

```
{ "mcpServers": { "simpig": { "type": "http", "url": "https://simpig.com/api/mcp" } } }
```

The API guide (/agents.md) is the same reference as Markdown: every call and field, the refund rule word for word, and a whole A2A exchange.

## For tools and other platforms

Point a tool at these and it knows the API without reading this page:

- /api/v1/openapi.json: OpenAPI 3.1, every endpoint, field and error. Import it into Postman, Insomnia or Bruno, or generate a client from it.
- /agents.md and /llms.txt: the guide and the short index, for language models.
- /discovery.json: every address a program can use, and whether each is live, cached or static.
- /.well-known/mcp/server-card.json and /.well-known/agent-card.json: the MCP server and the A2A agent described.
- /catalog.json: the whole catalogue in one read, cached for up to an hour. Find a plan with it; never price one.
- /api/v1/status: what works right now, component by component.

## Reference

Every endpoint a partner or platform calls, with what it takes and what it answers. Generated from our OpenAPI document; the document itself has every customer endpoint too.

### Catalogue

Public, cached at the edge, no key.

#### `GET /api/v1/catalog/currencies`

**The currencies a price can be shown and paid in** No key

The shop currency (`base`) and, when choosing is on, every currency on offer with its symbol and how many decimals its minor unit has (0 for yen). Pass one as `?currency=` to every catalogue read and to the order.

##### Answer (200)

- `base` string · required
- `enabled` boolean · required
- `currencies` object[] · required
- `currencies[].code` string · required
- `currencies[].name` string · required
- `currencies[].symbol` string · required
- `currencies[].exponent` integer · required

##### Statuses

- `200` What is on offer.

#### `GET /api/v1/catalog/destinations`

**Every destination with something to sell** No key

##### Parameters

- `currency` string · query: A currency to price in (USD, AUD, NZD, EUR, GBP, CAD, SGD, JPY). Without it, or with one not on offer, the shop currency. GET /currencies lists what is on.

##### Answer (200)

- `destinations` object[] · required
- `destinations[].code` string · required
- `destinations[].name` string · required
- `destinations[].kind` "country" | "region" | "global" · required
- `destinations[].continent` string or null · required
- `destinations[].slug` string · required
- `destinations[].aliases` string[] · required
- `destinations[].memberCodes` string[] · required
- `destinations[].popularity` integer · required
- `destinations[].planCount` integer · required
- `destinations[].fromPriceMinor` integer or null · required
- `destinations[].currency` string · required

##### Statuses

- `200` Destinations, most popular first.

#### `GET /api/v1/catalog/plans/{destination}`

**The plans for one destination** No key

A country lists its own plans first, then the regional and global plans that cover it (`isRegional`).

##### Parameters

- `destination` string · path · required: A destination slug (japan, bali-indonesia, europe) or code (JP, EU-42).
- `currency` string · query: A currency to price in (USD, AUD, NZD, EUR, GBP, CAD, SGD, JPY). Without it, or with one not on offer, the shop currency. GET /currencies lists what is on.

##### Answer (200)

- `destination` object · required
- `destination.code` string · required
- `destination.name` string · required
- `destination.kind` "country" | "region" | "global" · required
- `destination.slug` string · required
- `destination.memberCodes` string[] · required
- `destination.facts` object or null
- `currency` string
- `plans` object[] · required
- `plans[].productId` string (uuid) · required
- `plans[].title` string · required
- `plans[].subtitle` string or null · required
- `plans[].destinationCode` string · required
- `plans[].destinationName` string · required
- `plans[].destinationKind` "country" | "region" | "global" · required
- `plans[].isRegional` boolean · required
- `plans[].volumeBytes` number · required
- `plans[].durationDays` integer · required
- `plans[].dataType` integer · required
- `plans[].activeType` integer or null · required
- `plans[].installWithinDays` integer or null
- `plans[].fairUse` string or null
- `plans[].supportsTopup` boolean · required
- `plans[].speed` string or null · required
- `plans[].priceMinor` integer · required
- `plans[].currency` string · required
- `plans[].compareAtMinor` integer or null · required
- `plans[].badge` string or null · required
- `plans[].isFeatured` boolean · required
- `plans[].coverageCodes` string[] · required
- `plans[].operators` object[] · required
- `plans[].coverage` object[]
- `plans[].breakout` object or null
- `plans[].prices` object[]

##### Statuses

- `200` The destination and its plans.
- `404` No such destination, or nothing to sell there.
- `422` Malformed destination.

#### `GET /api/v1/catalog/trip`

**Plans for a multi-stop trip** No key

Pass the ISO country codes as `to=JP,KR,TH` (up to 8). `covering` lists every plan whose coverage includes all of them; `singles` lists each country’s own plans so a combination can be built when nothing covers the whole trip. Unknown codes are dropped; 404 when none is a country we sell.

##### Parameters

- `to` string · query · required: Comma-separated ISO 3166-1 alpha-2 codes.
- `currency` string · query: A currency to price in (USD, AUD, NZD, EUR, GBP, CAD, SGD, JPY). Without it, or with one not on offer, the shop currency. GET /currencies lists what is on.

##### Answer (200)

- `currency` string
- `destinations` object[] · required
- `destinations[].code` string · required
- `destinations[].name` string · required
- `destinations[].slug` string · required
- `covering` object[] · required
- `covering[].productId` string (uuid) · required
- `covering[].title` string · required
- `covering[].subtitle` string or null · required
- `covering[].destinationCode` string · required
- `covering[].destinationName` string · required
- `covering[].destinationKind` "country" | "region" | "global" · required
- `covering[].isRegional` boolean · required
- `covering[].volumeBytes` number · required
- `covering[].durationDays` integer · required
- `covering[].dataType` integer · required
- `covering[].activeType` integer or null · required
- `covering[].installWithinDays` integer or null
- `covering[].fairUse` string or null
- `covering[].supportsTopup` boolean · required
- `covering[].speed` string or null · required
- `covering[].priceMinor` integer · required
- `covering[].currency` string · required
- `covering[].compareAtMinor` integer or null · required
- `covering[].badge` string or null · required
- `covering[].isFeatured` boolean · required
- `covering[].coverageCodes` string[] · required
- `covering[].operators` object[] · required
- `covering[].coverage` object[]
- `covering[].breakout` object or null
- `covering[].prices` object[]
- `singles` object[] · required
- `singles[].code` string · required
- `singles[].plans` object[] · required

##### Statuses

- `200` The trip’s plans.
- `404` None of the codes is a country on sale.
- `422` Malformed list of codes.

#### `GET /api/v1/catalog/plan/{productId}`

**One plan** No key

##### Parameters

- `productId` string (uuid) · path · required
- `currency` string · query: A currency to price in (USD, AUD, NZD, EUR, GBP, CAD, SGD, JPY). Without it, or with one not on offer, the shop currency. GET /currencies lists what is on.

##### Answer (200)

- `plan` object · required
- `plan.productId` string (uuid) · required
- `plan.title` string · required
- `plan.subtitle` string or null · required
- `plan.destinationCode` string · required
- `plan.destinationName` string · required
- `plan.destinationKind` "country" | "region" | "global" · required
- `plan.isRegional` boolean · required
- `plan.volumeBytes` number · required
- `plan.durationDays` integer · required
- `plan.dataType` integer · required
- `plan.activeType` integer or null · required
- `plan.installWithinDays` integer or null
- `plan.fairUse` string or null
- `plan.supportsTopup` boolean · required
- `plan.speed` string or null · required
- `plan.priceMinor` integer · required
- `plan.currency` string · required
- `plan.compareAtMinor` integer or null · required
- `plan.badge` string or null · required
- `plan.isFeatured` boolean · required
- `plan.coverageCodes` string[] · required
- `plan.operators` object[] · required
- `plan.coverage` object[]
- `plan.breakout` object or null
- `plan.prices` object[]

##### Statuses

- `200` The plan.
- `404` No such plan, or it is not on sale.
- `422` Malformed id.

### Orders

Buying for a person: start an order with their email, read it back with the order token.

#### `POST /api/v1/agent/orders`

**Start an order (no sign-in)** No key

Starts an order for a buyer’s email and a plan (`productId`, as listed by `GET /api/v1/catalog/plans/{destination}`). The answer carries Stripe’s `payUrl`, where the buyer pays, a `statusUrl`, and an `orderToken` that is returned only here and is the one credential that reads the order back. Once paid and provisioned, the order carries the install details (one-tap links, the LPA activation code for a QR, the manual SM-DP+ entry), and the same are emailed to the buyer. A repeated `idempotencyKey` returns the same order. `poolCode` buys from a mates link: the card is held at full price and the mates rates price is taken when the link closes; there is no separate step to join. `startPool: true` starts a mates link with this purchase, hosted by the buyer; `order.pool.code` is its code. Rate-limited per network address and per email.

##### Body

- `email` string (email) · required
- `productId` string (uuid) · required
- `qty` integer
- `callbackUrl` string (uri)
- `idempotencyKey` string
- `poolCode` string
- `displayName` string
- `startPool` boolean
- `payLinkEmail` boolean
- `currency` string
- `watchKey` string
- `partner` string
- `partnerTyped` boolean
- `partnerSub` string

##### Answer (200)

- `order` object · required
- `order.id` string (uuid) · required
- `order.ref` string · required
- `order.status` "pending_payment" | "paid" | "provisioning" | "fulfilled" | "partially_fulfilled" | "failed" | "refunded" | "cancelled" | … · required
- `order.kind` "purchase" | "topup" · required
- `order.currency` string · required
- `order.subtotalMinor` integer · required
- `order.discountMinor` integer · required
- `order.taxMinor` integer · required
- `order.totalMinor` integer · required
- `order.paidMinor` integer or null
- `order.captureState` "auto" | "authorised" | "captured" | "released" | "expired"
- `order.perk` "simpig_paid" | "pool" | "saved_bacon" | "heist" | null
- `order.pool` object or null
- `order.createdAt` string · required
- `order.paidAt` string or null · required
- `order.fulfilledAt` string or null · required
- `order.failedReason` string or null · required
- `order.items` object[] · required
- `order.esims` object[] · required
- `order.payUrl` string (uri) or null · required
- `order.claimExpiresAt` string or null · required
- `orderToken` string or null · required
- `statusUrl` string (uri) · required
- `existing` boolean · required
- `next` string · required

##### Statuses

- `200` The order, the pay link and the one-time token.
- `422` Unknown or unavailable plan, bad quantity or email.
- `429` Too many orders from this address or IP in an hour, or too many started and not paid for (TOO_MANY_UNPAID).
- `503` Payments not configured.

#### `GET /api/v1/agent/orders/{ref}`

**The order’s progress and, once fulfilled, the install details** Order token

Send the order token as `Authorization: Bearer <orderToken>`. An unknown ref, a wrong token and an expired token (14 days) all answer 404.

##### Parameters

- `ref` string · path · required

##### Answer (200)

- `order` object · required
- `order.id` string (uuid) · required
- `order.ref` string · required
- `order.status` "pending_payment" | "paid" | "provisioning" | "fulfilled" | "partially_fulfilled" | "failed" | "refunded" | "cancelled" | … · required
- `order.kind` "purchase" | "topup" · required
- `order.currency` string · required
- `order.subtotalMinor` integer · required
- `order.discountMinor` integer · required
- `order.taxMinor` integer · required
- `order.totalMinor` integer · required
- `order.paidMinor` integer or null
- `order.captureState` "auto" | "authorised" | "captured" | "released" | "expired"
- `order.perk` "simpig_paid" | "pool" | "saved_bacon" | "heist" | null
- `order.pool` object or null
- `order.createdAt` string · required
- `order.paidAt` string or null · required
- `order.fulfilledAt` string or null · required
- `order.failedReason` string or null · required
- `order.items` object[] · required
- `order.esims` object[] · required
- `order.payUrl` string (uri) or null · required
- `order.claimExpiresAt` string or null · required
- `next` string · required

##### Statuses

- `200` The order.
- `401` No order token, or not one (`UNAUTHENTICATED`).
- `404` Not found (or not your token).

#### `GET /api/v1/agent/watch/{key}`

**Where an order started from a link you shared has got to** No key

For an assistant that sent a person a plan’s page and holds no order token. Make up a random key (16 to 64 characters of A–Z, a–z, 0–9, `-`, `_`), add it to the page’s address as `?watch=<key>` before sharing it, then read this address with the same key. The answer is the order’s status and when it started, was paid and was fulfilled: never the person’s email, the order’s reference, what was bought or how to install it. `not_started` until the person presses pay. A key answers for 14 days. Anyone holding the key can read the same, so make it long and random and share the link only with the person. Rate-limited per network.

##### Parameters

- `key` string · path · required

##### Answer (200)

- `status` "not_started" | "pending_payment" | "paid" | "provisioning" | "fulfilled" | "partially_fulfilled" | "failed" | "refunded" | … · required
- `startedAt` string or null · required
- `paidAt` string or null · required
- `fulfilledAt` string or null · required
- `next` string · required

##### Statuses

- `200` The status.
- `422` Not a watch key.
- `429` Too many reads from this network; ask less often.

### Piggyback partners

A partner’s own data with their key, and what a partner code gives a buyer.

#### `GET /api/v1/piggyback/partner/summary`

**Your standing: code, rate and money by state** Partner key

For your own systems, with your API key. When we have configured our signing key, the answer carries `Piggyback-Signature: t=<unix seconds>,kid=<key id>,ed25519=<base64url>`: an Ed25519 signature over `<t>.<body>`, checkable with the public key at `/.well-known/piggyback-keys.json`.

##### Answer (200)

- `code` string · required
- `status` "active" | "paused" | "terminated" · required
- `rateBps` integer · required
- `tenureDays` integer · required
- `windowDays` integer · required
- `holdDays` integer · required
- `payoutsEnabled` boolean · required
- `totals` object · required
- `totals.pendingAudMinor` integer · required
- `totals.dueAudMinor` integer · required
- `totals.paidAudMinor` integer · required
- `totals.owedBackAudMinor` integer · required
- `asOf` string · required

##### Statuses

- `200` Your standing.
- `401` No key, or not a live one (`INVALID_API_KEY`).
- `429` Over the key’s hourly cap.

#### `GET /api/v1/piggyback/partner/sales`

**Your sales, oldest first, 200 a page** Partner key

Every attributed sale: when, where to, the plan bought (`plan`: product, title, data and days), the final price paid (`amountMinor`) and in which currency, how it came (`link`, `code`, `agent`, or `tenure` for a returning customer), your `sub` (the click id you put on your link as `?sub=`), an anonymous `customer` token (stable in your data unless we rotate its secret, which we announce first), and the commission: rate, any agreed minimum per sale in US cents (`minimumUsdMinor`), state (`pending` inside the hold, `due`, `paid`, `void`), what it earns in the sale’s currency (`amountMinor`) and in AUD cents (`earnedAudMinor`, what we pay out), anything owed back after a refund, and the transfer that paid it with Stripe’s own id. Filter by `from`/`to` (when the sale was made) or `updatedSince` (to sync changes); page with `after=<next>`. `format=csv` answers the same rows as CSV. When we have configured our signing key, the answer carries `Piggyback-Signature: t=<unix seconds>,kid=<key id>,ed25519=<base64url>`: an Ed25519 signature over `<t>.<body>`, checkable with the public key at `/.well-known/piggyback-keys.json`.

##### Parameters

- `from` string · query
- `to` string · query
- `updatedSince` string · query
- `after` string (uuid) · query
- `limit` integer · query
- `format` "json" | "csv" · query

##### Answer (200)

- `sales` object[] · required
- `sales[].id` string (uuid) · required
- `sales[].createdAt` string · required
- `sales[].updatedAt` string · required
- `sales[].paidAt` string or null · required
- `sales[].kind` "purchase" | "topup" · required
- `sales[].destinationCode` string or null · required
- `sales[].destination` string or null · required
- `sales[].plan` object or null
- `sales[].amountMinor` integer · required
- `sales[].currency` string · required
- `sales[].source` "link" | "code" | "agent" | "tenure" | null · required
- `sales[].sub` string or null · required
- `sales[].customer` string · required
- `sales[].discountBps` integer
- `sales[].discountMinor` integer
- `sales[].commission` object · required
- `sales[].transfer` object or null · required
- `next` string (uuid) or null · required

##### Statuses

- `200` A page of sales.
- `401` No key, or not a live one (`INVALID_API_KEY`).
- `422` A bad filter, or `after` is not one of your sales (`INVALID_CURSOR`).
- `429` Over the key’s hourly cap.

#### `GET /api/v1/piggyback/partner/days`

**Clicks, sales and earnings by day (UTC)** Partner key

From `from` to `to` (YYYY-MM-DD, at most 366 days; the last 30 by default). A click is a person who opened a page of ours through your link with scripts running; programs are not counted. When we have configured our signing key, the answer carries `Piggyback-Signature: t=<unix seconds>,kid=<key id>,ed25519=<base64url>`: an Ed25519 signature over `<t>.<body>`, checkable with the public key at `/.well-known/piggyback-keys.json`.

##### Parameters

- `from` string · query
- `to` string · query

##### Answer (200)

- `days` object[] · required
- `days[].day` string · required
- `days[].clicks` integer · required
- `days[].sales` integer · required
- `days[].earnedAudMinor` integer · required

##### Statuses

- `200` Day by day.
- `401` No key, or not a live one (`INVALID_API_KEY`).
- `429` Over the key’s hourly cap.

#### `GET /api/v1/piggyback/partner/transfers`

**Your transfers, with Stripe’s ids and the sales in each** Partner key

Newest first, 100 at most (narrow with `from`/`to`). Each names the sales it paid and any refunds it took back, and carries Stripe's transfer id: look it up in your own Stripe dashboard to see the same money arrive. When we have configured our signing key, the answer carries `Piggyback-Signature: t=<unix seconds>,kid=<key id>,ed25519=<base64url>`: an Ed25519 signature over `<t>.<body>`, checkable with the public key at `/.well-known/piggyback-keys.json`.

##### Parameters

- `from` string · query
- `to` string · query

##### Answer (200)

- `transfers` object[] · required
- `transfers[].id` string (uuid) · required
- `transfers[].createdAt` string · required
- `transfers[].settledAt` string or null · required
- `transfers[].state` "pending" | "sent" | "failed" · required
- `transfers[].amountAudMinor` integer · required
- `transfers[].currency` "AUD" · required
- `transfers[].stripeTransferId` string or null · required
- `transfers[].saleIds` string (uuid)[] · required
- `transfers[].salesAudMinor` integer · required
- `transfers[].clawbacksAudMinor` integer · required

##### Statuses

- `200` Your transfers.
- `401` No key, or not a live one (`INVALID_API_KEY`).
- `429` Over the key’s hourly cap.

#### `GET /api/v1/piggyback/offer/{code}`

**What a partner’s code gives a buyer** No key

Public. Whether the code is a live partner’s, and the discount it gives a buyer, in basis points of the price (500 = 5 % off; 0 for none). The order’s answer and Stripe’s page carry the exact amount.

##### Parameters

- `code` string · path · required

##### Answer (200)

- `found` boolean · required
- `code` string
- `discountBps` integer · required
- `own` boolean

##### Statuses

- `200` The offer.
- `422` Not a partner code.

### Service

Whether it works, and what is deployed.

#### `GET /api/v1/status`

**Service status** No key

Each service the shop depends on (website, payments, eSIM delivery, catalogue, email, sign-in, API, MCP, A2A, site search): its state now, since when, and the last 60 days of checks. Checked once a minute; `unknown` when the checks are more than five minutes old.

##### Answer (200)

- `overall` "operational" | "degraded" | "down" | "unknown" · required
- `checkedAt` string or null · required
- `components` object[] · required
- `components[].id` string · required
- `components[].state` "operational" | "degraded" | "down" | "unknown" · required
- `components[].since` string or null · required
- `components[].checkedAt` string or null · required
- `components[].latencyMs` integer or null · required
- `components[].days` object[] · required

##### Statuses

- `200` The status.

#### `GET /api/v1/health`

**Liveness** No key

##### Answer (200)

- `ok` boolean · required
- `build` string or null · required: A fingerprint of the build that is live (the first 12 hex characters of the SHA-256 of its commit), for a deploy check that already knows the commit; null on a build made elsewhere. Not the commit itself.

##### Statuses

- `200` OK

## Stuck?

Write to us with what you sent and what came back (never a key or an order token) and a person answers.

[hello@simpig.com](mailto:hello@simpig.com)

---

This is [simpig.com/developers](https://simpig.com/developers) as Markdown. Every page there has a Markdown copy at its own address plus `.md`. [Every plan and price as JSON](https://simpig.com/catalog.json) · [API guide](https://simpig.com/agents.md) · [Every page, listed](https://simpig.com/llms.txt)
