# Merchant API reference (/docs/api-reference)

## Base URL [#base-url]

```text
https://apps.apiswop.co/api/v5/merchant
```

All requests use HTTPS and JSON. Every request needs a merchant API key; see [Authentication](/docs/api-reference/authentication).

## Endpoints [#endpoints]

| Method | Path | Scope | What it does |
|---|---|---|---|
| `GET` | [`/me`](/docs/api-reference/me) | any | Check a key and see what it can do right now |
| `GET` | [`/products`](/docs/api-reference/products) | `commerce.read` | List your products |
| `GET` | [`/orders`](/docs/api-reference/orders) | `commerce.read` | List your sales |
| `POST` | [`/checkout-intents`](/docs/api-reference/checkout-intents#create-a-checkout) | `commerce.checkout` | Create a checkout from a cart |
| `GET` | [`/checkout-intents/{intentId}`](/docs/api-reference/checkout-intents#retrieve-a-checkout) | `commerce.read` | Read a checkout and its status |
| `POST` | [`/embed-token`](/docs/api-reference/embed) | `commerce.embed` | Mint a token to frame checkout on a registered site |
| `GET` | [`/locations`](/docs/api-reference/locations) | `drops.read` | List your physical locations |
| `GET` | [`/locations/{id}`](/docs/api-reference/locations#retrieve-a-location) | `drops.read` | Read one location |
| `GET` | [`/locations/{id}/terminals`](/docs/api-reference/locations#list-terminals) | `drops.read` | List tap-to-pay terminals at a location |

Some things can **only** be done in the Swop app while signed in, never with an API key: creating and revoking keys, registering websites for framed checkout, and managing [webhooks](/docs/api-reference/webhooks). That way a leaked key can never widen its own access.

## Conventions [#conventions]

- **Amounts** are numbers in USDC (for example `29.85`), not cents.
- **IDs**: products and locations use 24-character hex IDs; checkouts use `co_…`; keys use `mk_…`.
- **Timestamps** are ISO 8601 in UTC.
- **Success** responses wrap the result in `data`. **Errors** have `success: false` and a `message`; see [Errors](/docs/api-reference/errors).

## Not available yet [#not-available-yet]

| | Status |
|---|---|
| Test mode / sandbox keys | Coming soon. Every request is live. |
| Idempotency keys | Coming soon. A retried `POST /checkout-intents` creates a second checkout. |
| Refunds by API | Coming soon. Use the Swop app. |
| Creating or editing products by API | The `commerce.write` scope exists, but no product write endpoints are exposed on this API yet. |
| OpenAPI spec | Coming soon |
