> For the complete documentation index, see [llms.txt](https://docs.citrn.io/citron/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.citrn.io/citron/api-basics.md). Agents can also search and read this documentation through its [MCP server](https://docs.citrn.io/citron/~gitbook/mcp).

# API Basics

The conventions Citron methods follow, and where they differ.

Below are the conventions the documented Citron methods follow, with the exceptions named. The specifics of each one live in [API Reference](https://docs.citrn.io/citron/api-reference).

## Base address

| Prefix                              | Who calls it                                      | Signed                                                                                                                                        |
| ----------------------------------- | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `https://api.citrn.io/api/…`        | Your backend.                                     | Yes — see [Authentication](https://docs.citrn.io/citron/api-basics/authentication). The one exception is `/api/ping`, which needs no headers. |
| `https://api.citrn.io/public-api/…` | The payer's browser, on the invoice payment page. | No. These methods carry no key and no signature, which is why they exist separately.                                                          |

## Requests

* **Almost every method is a `POST`**, including most of the ones that only read — balances, currency lists and current rates are POSTs too. Three methods are `GET`: `/api/ping`, `/api/rates` and the public `/public-api/invoices/{invoice_id}/status`. Check the method in [API Reference](https://docs.citrn.io/citron/api-reference) before you call one.
* **Required parameters** are marked with a red <mark style="color:red;">\*</mark> in every parameter table, in this guide and in API Reference. Everything without it is optional.
* **Parameters go in the JSON body**, not in the query string. The only value in the path is the invoice id, in the invoice methods. The one place that takes query parameters is the Payment Terminal link — see [API Reference › Payments](https://docs.citrn.io/citron/api-reference/payments).
* A `POST` body is JSON and the header says so:

```json
"Content-Type": "application/json"
```

Signed methods add two more headers, `X-Process-Key` and `X-Process-Signature`. How they are built: [Authentication](https://docs.citrn.io/citron/api-basics/authentication).

## Identifiers

Transactions and invoices are identified by a **UUID** in `id`. Not every identifier is one: `customer_id`, `network_id` and `balance_id` are integers, and an exchange `quote_id` is a short string. Treat every id as an opaque value and store it as it came.

Your own identifier goes in `foreign_id` when you take a deposit address or send a payout, and comes back in the callbacks, so you can match an operation to your customer without storing ours. Invoices use `order_id` and `customer_foreign_id` for the same purpose.

What comes back: [Responses](https://docs.citrn.io/citron/api-basics/responses). How dates are written: [Date Formats](https://docs.citrn.io/citron/api-basics/date-formats).
