> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paywire.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# API reference

> Base URL, authentication and conventions for the Paywire API.

## Base URL

| Environment | Base URL |
| - | - |
| Staging (testnets) | `https://api.staging.paywire.xyz` |
| Production | Coming soon |

## Authentication

Send your gateway's API key as a bearer token:

```bash theme={null}
Authorization: Bearer w3g_...
```

Endpoints marked *public* (reading a link's checkout, creating and reading orders) need no key. See [Authentication](https://docs.paywire.xyz/guides/authentication.md).

## Conventions

* **JSON** in and out, with `Content-Type: application/json`. Property names are camelCase.
* **Ids** are UUIDs.
* **Coin amounts** are strings in the coin's smallest unit (`"1612903225806451"` wei), with the coin's `decimals` alongside. Fields ending in `Display` give the same amount in whole coins, for showing to people.
* **Fiat amounts** are JSON numbers in the link's `currency`.
* **Times** are ISO 8601 in UTC.
* **Errors** are RFC 7807 problem details; branch on `title`. See [Errors](https://docs.paywire.xyz/guides/errors.md).

## Endpoints

| | Endpoint | Auth |
| - | - | - |
| Create a payment link | `POST /payments/links` | API key |
| Get a payment link | `GET /payments/links/{linkId}` | public |
| Get a link's checkout | `GET /payments/links/{linkId}/checkout` | public |
| Create an order | `POST /payments/links/{linkId}/orders` | public |
| Get an order | `GET /payments/orders/{orderId}` | public |
| Get your gateway | `GET /payments/merchants/me` | API key |
| Issue an API key | `POST /payments/merchants/me/api-keys` | API key |
| Revoke an API key | `DELETE /payments/merchants/me/api-keys/{keyId}` | API key |
| Get the webhook secret | `GET /notifications/merchants/me/webhook-secret` | API key |
| Rotate the webhook secret | `POST /notifications/merchants/me/webhook-secret/rotate` | API key |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.