# Pay Fiat to Crypto API
> REST API to accept payments that settle in USDC on Base. Customers pay by card, bank transfer or digital wallet, in US dollars or euros, through a hosted checkout, a widget or a ready payment link, or send USDC to the order's own wallet. Every payment is split automatically between the seller, your commission and the platform, then paid out on-chain.
- Base URL: https://api.payfiattocrypto.com
- API version: 1.0.0
- Human-readable docs: https://payfiattocrypto.com/en/docs (guides) and https://payfiattocrypto.com/en/docs/reference (API reference)
- OpenAPI 3.1: https://payfiattocrypto.com/openapi.json
- API keys: from the Telegram bot @fiat_to_crypto_bot (/newkey, in a private chat); the reply also carries the webhook signing secret
- Last updated: 2026-11-26
## Overview
The API lets your platform take payments that settle in USD stablecoins, with your own commission on every order. You create an order, send the customer to its checkout link, and once the payment arrives the API splits it and pays every recipient on-chain. You never hold the funds or run blockchain infrastructure.
- Card, bank transfer and digital wallet payments in US dollars or euros, through a hosted checkout page, an embeddable widget or a ready payment link: you choose per order.
- One checkout for the customer, with no payment provider to choose: Privy, the wallet and payments infrastructure owned by Stripe, routes each payment to a large licensed provider that serves the customer's country.
- Every order has its own wallet, so each payment reconciles to exactly one order, with no memo or reference to match.
- A customer who comes back to a payment link sees the real state of the payment (in progress, already paid or expired), so nobody pays twice by mistake.
- Automatic split of every payment between the seller, your commission and the platform fee, paid out on-chain.
- Split payouts to up to 5 seller wallets and up to 5 commission wallets per order.
- Payouts start as soon as the payment is final on-chain, with no manual step: on Base, a payout is final about half an hour after the payment arrives.
- Payouts follow what actually arrives: any excess goes to the seller, and a shortfall is paid out in proportion to what arrived.
- Idempotent order creation, cursor pagination and stable error codes.
- Optional Telegram messages to the seller and to you when an order is created, paid and settled.
- Signed webhooks when the payment arrives, is paid out, fails to pay out or expires, when a customer pays an order again, and for what the payment page reports from the checkout.
### How it works
1. **You create an order** with the amount, the stablecoin and network, the seller's wallet(s) and your commission. See [`POST /v1/orders`](https://payfiattocrypto.com/en/docs/reference#create-order).
2. **The API returns the order's own wallet** (`deposit.address`) with how much must arrive (`deposit.amount`), the fees, and, for USDC on Base, a [checkout](https://payfiattocrypto.com/en/docs#checkout) (`checkout.url`).
3. **The customer pays** by card, bank transfer or digital wallet, in US dollars or euros, on the payment page, where a licensed payment provider converts the payment to USDC that reaches the order wallet. Or they send the stablecoin straight to `deposit.address`.
4. **The API detects the payment on-chain.** When the balance is final, the order becomes `received`. Nobody has to confirm the payment by hand.
5. **The API splits and pays out:** the seller's share, your commission and the platform fee, each recipient in its own on-chain transfer. When every transfer is final, the order becomes `settled`.
**Money flow**
```text
customer
└─► checkout (checkout.url)
├─► payment page
│ MDR and processor fee
└─► order wallet (deposit.address)
├─► seller wallet(s)
│ sellerReceives
├─► your wallet(s)
│ partnerReceives
└─► platform
platformFee
```
### Who it is for
- **Marketplaces and platforms** that pay sellers, creators or freelancers in USD stablecoins and keep a commission on each sale.
- **Payment and invoicing products** that want stablecoin settlement without running wallets, nodes or payout logic.
- **Agencies and resellers** that split each payment between several wallets.
### Why integrate
Card-to-crypto gateways tend to lose payments in the same places. This is how the API avoids each one:
1. **The customer lands on a payment provider that requires an account, and gives up.** Here the customer doesn't pick a provider: Privy, the wallet and payments infrastructure owned by Stripe, takes them to a large licensed payment provider that serves their country.
2. **Advertised coverage isn't real, and the customer reaches a country no provider serves.** The provider is chosen at payment time, among those that serve where the customer is.
3. **The fee shows up in the middle of the payment.** [`GET /v1/orders/{orderId}/checkout/offers`](https://payfiattocrypto.com/en/docs/reference#get-checkout-offers) tells you what the customer will pay before they pay, with the fees itemized.
4. **Nobody tells you what happened to a payment.** Every order has its own wallet (`deposit.address`), and [signed webhooks](https://payfiattocrypto.com/en/docs#webhooks) report each step, including the amount paid (`data.payment.amount`). Every payout is an on-chain transfer you can check.
5. **What arrives depends on the provider: a different coin, on a different network.** Payouts are always USDC on Base, already split between the seller, your commission and the platform.
6. **A customer who pays twice becomes your problem.** A second payment at the checkout, or one made after the order expired, is paid out automatically through a [derived order](https://payfiattocrypto.com/en/docs#derived-orders).
7. **A per-payment cap that depends on the country forces large sales to be split, or lost.** There is no maximum per order on our side, only the US$ 10 minimum.
We work with large licensed payment providers. Privy compares the options available in the customer's country and routes each payment to one that serves it, so there is no provider list to choose from and no dead end.
Depending on the country and the amount, the payment provider may ask the customer to confirm their identity.
## Terms of use
Integrating the API means accepting these terms. You accept them when you create an API key.
- **We do not perform KYB.** Verifying the businesses and sellers that use your integration (KYB) is the responsibility of whoever integrates the API.
- **Regulators are your responsibility.** We are not liable for any problems with regulators or supervisory authorities.
- **No refunds.** We are not responsible for refunds, and there are no refunds in cryptocurrency.
- **Fees:** the platform fee is 1% per payment for orders created through the API, or 3% on our website, plus the processing fee of 6.70% + US$ 0.50 per payment (the payment provider's MDR) when the customer pays by card, bank or digital wallet. Through the API, the commission you set comes on top. There is no maximum amount per order, only the US$ 10 minimum. The card processor that handles the payment may also deduct its own fee, which varies by processor, from what it delivers, so less reaches the order wallet, and the payout follows what arrives.
## Quickstart
1. **Get an API key** from our Telegram bot [@fiat_to_crypto_bot](https://t.me/fiat_to_crypto_bot) with `/newkey`. The key is shown once, together with your webhook signing secret: keep both on your server only.
2. **Check the supported assets** with [`GET /v1/assets`](https://payfiattocrypto.com/en/docs/reference#get-assets).
3. **Create an order** with [`POST /v1/orders`](https://payfiattocrypto.com/en/docs/reference#create-order) and send the customer to `checkout.url`, or use another of the [checkout options](https://payfiattocrypto.com/en/docs#checkout-options). The wallets in the examples are placeholders: put in wallets you control.
4. **Follow the order** with [webhooks](https://payfiattocrypto.com/en/docs#webhooks) or [`GET /v1/orders/{orderId}`](https://payfiattocrypto.com/en/docs/reference#get-order): at `received` the payment has arrived, and at `settled` every recipient has been paid. See [order lifecycle](https://payfiattocrypto.com/en/docs#lifecycle).
**cURL**
```bash
curl "https://api.payfiattocrypto.com/v1/orders" \
-H "Authorization: Bearer $PFC_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-A-1001" \
-d '{
"amount": "100.00",
"asset": {
"symbol": "USDC",
"network": "base"
},
"feeMode": "seller",
"sellerWallet": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"partnerFee": {
"rate": "0.01",
"wallet": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
}
}'
```
**JavaScript**
```javascript
const response = await fetch("https://api.payfiattocrypto.com/v1/orders", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PFC_API_KEY}`,
"Content-Type": "application/json",
// One key per order, reused on every retry of that order.
"Idempotency-Key": "order-A-1001",
},
body: JSON.stringify({
"amount": "100.00",
"asset": {
"symbol": "USDC",
"network": "base"
},
"feeMode": "seller",
"sellerWallet": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"partnerFee": {
"rate": "0.01",
"wallet": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
}
}),
});
const order = await response.json().catch(() => null);
if (!response.ok) {
throw new Error(order?.error ? order.error.code + ": " + order.error.message : "HTTP " + response.status);
}
// Send the customer to the hosted checkout (or embed checkout.embedUrl).
console.log(order.checkout.url);
```
**Python**
```python
import os
import requests
response = requests.post(
"https://api.payfiattocrypto.com/v1/orders",
headers={
"Authorization": f"Bearer {os.environ['PFC_API_KEY']}",
# One key per order, reused on every retry of that order.
"Idempotency-Key": "order-A-1001",
},
json={
"amount": "100.00",
"asset": {
"symbol": "USDC",
"network": "base"
},
"feeMode": "seller",
"sellerWallet": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"partnerFee": {
"rate": "0.01",
"wallet": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
}
},
timeout=30,
)
if not response.ok:
try:
error = response.json()["error"]
except (ValueError, KeyError):
response.raise_for_status()
raise RuntimeError(f"{error['code']}: {error['message']}")
order = response.json()
# Send the customer to the hosted checkout (or embed checkout.embedUrl).
print(order["checkout"]["url"])
```
**PHP**
```php
true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("PFC_API_KEY"),
"Content-Type: application/json",
// One key per order, reused on every retry of that order.
"Idempotency-Key: order-A-1001",
],
CURLOPT_POSTFIELDS => json_encode([
"amount" => "100.00",
"asset" => [
"symbol" => "USDC",
"network" => "base",
],
"feeMode" => "seller",
"sellerWallet" => "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"partnerFee" => [
"rate" => "0.01",
"wallet" => "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359",
],
"webhookUrl" => "https://example.com/webhooks/payfiattocrypto",
"metadata" => [
"orderRef" => "A-1001",
],
]),
CURLOPT_TIMEOUT => 30,
]);
$raw = curl_exec($ch);
if ($raw === false) {
// No answer: the order may exist. Retry with the same Idempotency-Key.
throw new RuntimeException("Network error: " . curl_error($ch));
}
$order = json_decode($raw, true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status >= 400) {
throw new RuntimeException(($order["error"]["code"] ?? "HTTP " . $status) . ": " . ($order["error"]["message"] ?? ""));
}
// Send the customer to the hosted checkout (or embed checkout.embedUrl).
echo $order["checkout"]["url"];
```
**Response · 201 Created**
```json
{
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"status": "created",
"deposit": {
"address": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb",
"amount": "100.000000",
"asset": {
"symbol": "USDC",
"network": "base",
"contractAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
},
"breakdown": {
"sellerReceives": "97.998000",
"platformFee": "1.000000",
"partnerFee": "1.000000",
"partnerReceives": "0.998000",
"networkFee": "0.004000"
},
"checkout": {
"token": "kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"url": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"embedUrl": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT?embed=1",
"feeMode": "seller"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
},
"createdAt": "2026-11-16T14:05:09.120Z"
}
```
## Authentication
> **API keys come from our Telegram bot:** Open [@fiat_to_crypto_bot](https://t.me/fiat_to_crypto_bot) in a private chat and send `/newkey`. After you accept the terms, the bot shows your key once, together with your webhook signing secret. See all [bot commands](https://payfiattocrypto.com/en/docs#telegram-bot).
Every request needs an API key in the `Authorization` header. Keys start with `ftc_`. Each account has one active key. A new key replaces it, and the previous key keeps working for 24 hours, so you have time to switch; `/revoke` in the bot stops a key at once: use it on the previous key if it leaked.
```http
Authorization: Bearer ftc_…
```
**Server-side only:** never put a key in a browser, mobile app or public repository. Anyone with the key can create orders in your name.
## Base URL and conventions
**Base URL**
```text
https://api.payfiattocrypto.com
```
- HTTPS only. Requests and responses are JSON in UTF-8; send `Content-Type: application/json` with a body.
- **Money is a decimal string**, never a JSON number: `"100.50"`, not `100.5`. Amounts are in units of the stablecoin, with at most the token's decimal places (6); more decimal places return `400 INVALID_REQUEST`. USDC counts as US$ 1 for every minimum and limit.
- An asset is always the pair `{ "symbol": "USDC", "network": "base" }`, today the only pair the API accepts. The same symbol on another network would be another asset.
- In these docs, an **order** is the API's payment order (`orderId`), not an order in your own system. Link the two with your own reference in `metadata`.
- Wallets are EVM addresses in **EIP-55 checksummed** form, exactly as the wallet displays them. An all-lowercase address is rejected, because a mistyped character could not be detected, and a transfer to a mistyped address cannot be reversed.
- Timestamps are ISO 8601. Responses use UTC; query filters need an explicit time zone.
- Unknown request fields are rejected with `400 INVALID_REQUEST`, so a typo in a field name never goes unnoticed.
- Responses may gain new fields over time. Ignore fields you do not know. Breaking changes get a new version prefix (`/v2`).
- Every error message is in English. Branch on `error.code`, which is stable.
- A request body can have up to 1 MiB; a larger one returns `413 INVALID_REQUEST`.
- Questions and support: [@payfiattocrypto](https://t.me/payfiattocrypto) on Telegram.
## Supported assets and networks
Every order pays out in one stablecoin on one network, chosen in the request. Today the API operates on **Base** only, with **USDC**: any other pair returns `400 UNSUPPORTED_ASSET`. Every order can be paid by card, bank or digital wallet at the [checkout](https://payfiattocrypto.com/en/docs#checkout), or by sending USDC on Base straight to the order's own wallet (`deposit.address`).
| Asset | Network (`network`) | Token contract | Payout after payment |
| --- | --- | --- | --- |
| **USDC** · USD Coin | Base (`base`) | [`0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`](https://basescan.org/token/0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) | ~30–38 minutes |
Payout time counts from the payment reaching the order wallet, and covers confirming the payment and confirming the payout. On Base, both wait for finality on Ethereum. That wait is part of how the network works, not a delay on our side. Read the live values from [`GET /v1/assets`](https://payfiattocrypto.com/en/docs/reference#get-assets).
## Checkout: card, bank and digital wallets
Orders in USDC on Base, today every order, come with a `checkout`: the customer pays in US dollars or euros on a payment page, where a licensed payment provider, picked there for the customer, converts the payment to USDC. The USDC reaches the order's own wallet, and from there it is the same flow as any payment. A [derived order](https://payfiattocrypto.com/en/docs#derived-orders) has no `checkout`, and the checkout endpoints return `409 ORDER_NOT_PAYABLE` for it.
### Three ways to send the customer
| Option | How | What the customer sees |
| --- | --- | --- |
| Hosted page | Send the customer to `checkout.url`. | Our page: the currency and the amount, then the payment page in a new tab. |
| Widget | Embed `checkout.embedUrl` in an `iframe` on your site. | The same page, inside yours. |
| Ready link | Call [`POST /v1/orders/{orderId}/checkout`](https://payfiattocrypto.com/en/docs/reference#create-checkout) and send the customer its `url` by email, chat or a button. | The payment page, straight away. Our page appears only when there is nothing to pay: a payment in progress, already paid or expired. |
Start with the hosted page: it shows the order's state, follows the payment and brings the customer back with `checkout.returnUrl`. Use the widget to keep the customer on your own page. Use the ready link to send the payment by email or chat, or behind your own button, when sending the customer straight to the payment page matters more than our page around it.
- `checkout.payer.currency` sets the customer's currency: `USD` (the default) or `EUR`. On the hosted page and the widget, the customer can still switch.
- The payment page picks the payment provider for the customer. The API has no list of providers, countries, payment methods or per-payment limits, and no way to choose them: the payment page shows the customer what is available to them before anything is charged.
- The payment page does not run inside an iframe: the widget opens it in a new tab and keeps showing the payment status.
- A payment that is opened and not paid is reused for 60 minutes; after that, a new one is opened. An order opens at most 10 payments per hour.
- The widget adapts to its frame: a width from 360 to 480 px and a height of about 700 px fit every step. Any site can embed it. If you add a `sandbox` attribute to the `iframe`, include `allow-scripts`, `allow-same-origin`, `allow-forms`, `allow-popups` and `allow-popups-to-escape-sandbox`: the payment page opens in a new tab.
- `checkout.returnUrl` (https) is where the hosted page sends the customer back, exactly as you gave it: nothing is added to it. While the payment is pending or being confirmed, the hosted page shows a link to it; on the screen of an expired order, a button to it. Once the payment reaches the order wallet, it sends the customer there after 5 seconds. Confirming can take minutes or hours, so the customer can leave earlier through the link. The widget never navigates: your page decides, from the widget events. Reaching `returnUrl` is not proof of payment: confirm with the order status or the webhooks.
- The widget tells your page what happens through `postMessage`, so you can resize the `iframe` and react to the payment without polling. Each message is an object with `source`, `type` and `orderId`; `checkout.resize` also has `height`. Accept a message only when `event.origin` is `https://payfiattocrypto.com` and `event.data.source` is `payfiattocrypto`. Treat `checkout.paid` like `checkout.returnUrl`: a signal to update your screen, not proof of payment.
**Request body: checkout options**
```json
{
"checkout": {
"payer": {
"currency": "EUR"
},
"returnUrl": "https://example.com/orders/A-1004"
}
}
```
**Widget**
```html
```
| `type` | When | Other fields |
| --- | --- | --- |
| `checkout.resize` | The content height changed. | `height` (px) |
| `checkout.payment_started` | The customer opened the payment page. | — |
| `checkout.confirming` | The payment was approved; the funds are on their way to the order wallet. | — |
| `checkout.paid` | The payment reached the order wallet. | — |
| `checkout.expired` | The order stopped waiting for payment. | — |
**Widget events**
```javascript
const frame = document.getElementById("pfc-checkout");
window.addEventListener("message", (event) => {
if (event.origin !== "https://payfiattocrypto.com" || event.data?.source !== "payfiattocrypto") return;
const { type, orderId } = event.data;
if (type === "checkout.resize") frame.style.height = event.data.height + "px";
if (type === "checkout.paid") showThankYou(orderId);
});
```
### What the customer pays
Through the API, each card, bank or digital wallet payment costs **the platform fee of 1% + the processing fee**, plus the commission you set. The processing fee is the payment provider's MDR (merchant discount rate): **6.70% of each payment plus a fixed US$ 0.50 per payment**, converted to the payment's currency. The MDR is not among the deductions in `breakdown`, and the order's `feeMode` decides who pays it. The card processor is chosen for each payment, so its fee is not known in advance and is not in the price: when the processor deducts a fee from the USDC it delivers, less reaches the order wallet, and the payout follows what arrives.
- `customer`: the customer pays the order and the MDR on top, so that the whole `deposit.amount` is left once the MDR is taken: (`deposit.amount` + US$ 0.50) / (1 − 6.70%), converted to their currency and rounded up to the cent. If the card processor deducts its own fee, less arrives and the payout is [proportional](https://payfiattocrypto.com/en/docs#amount-differences), so the seller can receive less than `amount`.
- `seller`: the MDR, and any fee the card processor deducts, come out of the payment. The customer pays `deposit.amount`, converted to their currency, so less than `deposit.amount` reaches the order wallet, and what arrives is paid out [proportionally](https://payfiattocrypto.com/en/docs#amount-differences): the seller's share, your commission and the platform fee all shrink by the same fraction. What arrives is paid out only from US$ 5 up. The smallest order is US$ 10, as in `customer` mode; if card costs ever push the `seller`-mode minimum above that, `GET /v1/assets` returns it as `sellerMinTicketUsd`, and a `seller`-mode order below it is refused at creation with `400 AMOUNT_TOO_LOW`.
- The [offer](https://payfiattocrypto.com/en/docs/reference#get-checkout-offers) shows the amount before the customer pays, split into `orderAmount` (the order's `amount` in the customer's currency, not `deposit.amount`), `serviceFee` (the platform fee, your commission and the network fee, together with the MDR) and `processorFee`, which is `0.00` today because the card processor's fee is not known in advance; `fee` is the two fees together. With `seller` all three fees are `0.00`. The hosted page shows the same split. The payout always follows what actually reaches the order wallet.
- The customer pays at least US$ 10, or the same in euros. Below that there is no offer, and opening a payment returns `422 AMOUNT_BELOW_MINIMUM`. Every order is at least US$ 10, so today no order falls below this limit.
- Amounts in the customer's currency are rounded up to 2 decimal places. Exchange rates are public reference rates, refreshed every 6 hours.
**Worked example.** The same order in each mode, paid in US dollars (your commission 1%, one seller wallet, one commission wallet, network fee 0.002 USDC per transfer), with the MDR of 6.70% + US$ 0.50. What reaches the order wallet assumes the card processor deducts no fee of its own; if it does, less arrives and every share shrinks in proportion:
| | `seller` | `customer` |
| --- | --- | --- |
| `amount` in the request | 100.00 | 100.00 |
| `deposit.amount` | 100.000000 | 102.042857 |
| The customer pays | 100.00 USD | 109.91 USD |
| `orderAmount` | 100.00 USD | 100.00 USD |
| `serviceFee` | 0.00 USD | 9.91 USD |
| `processorFee` | 0.00 USD | 0.00 USD |
| Reaches the order wallet | 92.800000 USDC | 102.046030 USDC |
| The seller receives | **90.942000** | **100.003173** |
| You receive | 0.926000 | 1.018428 |
| Rule applied | [Proportional](https://payfiattocrypto.com/en/docs#amount-differences): the MDR comes out of the payment, and every share shrinks by the same fraction. | [More than expected](https://payfiattocrypto.com/en/docs#amount-differences): the rounding up of the customer's amount goes to the seller. |
### Payments and the customer
- The offer's amount is calculated when you ask for it, with the current exchange rate. The ready link calculates it again when the payment opens, so it can differ slightly if the rate moved.
- The ready link (`url`) is our page in "pay now" mode, never the payment page itself. When the order can be paid, it sends the customer straight to the payment page, in the same tab; otherwise it shows the order's state. For a given currency the link is always the same: keep it and send it again whenever you need. Our page is no longer open while the customer pays, so it cannot bring them back to `checkout.returnUrl`; the payment page is given `returnUrl` and may send them there when they finish or cancel.
- If the customer comes back while a payment is in progress and not confirmed, the hosted page and the ready link ask whether they already paid (and wait) or did not finish (and pay now). Paying now opens a new payment and closes the old one.
- Once a payment is approved, the order opens no other payment (`409 PAYMENT_IN_PROGRESS`), and the payment page is closed so it cannot be paid again. The [offer](https://payfiattocrypto.com/en/docs/reference#get-checkout-offers) still returns a price then: to know whether a payment is on its way, use the webhooks.
- The order expires 7 days after `createdAt`, and card and bank payments close 12 hours earlier, because such a payment can take hours to reach the order wallet. From then on, the [offer](https://payfiattocrypto.com/en/docs/reference#get-checkout-offers) and [`POST /v1/orders/{orderId}/checkout`](https://payfiattocrypto.com/en/docs/reference#create-checkout) return `409 ORDER_NOT_PAYABLE`, no new payment opens from the hosted page, the widget or the ready link, and a payment page that is still open is closed. USDC sent straight to `deposit.address` still counts until the order expires. There is no `expiresAt` field: compute both moments from `createdAt`.
- If a customer still pays twice, or pays after the order expired, the extra payment is not lost: it is paid out through a [derived order](https://payfiattocrypto.com/en/docs#derived-orders), with the same recipients and terms.
- Each attempt to pay is a separate payment, with its own `data.payment.id` in `payment.started` and `payment.completed`; one link can lead to several. Match events to your records by `orderId`, never by the link.
- With the hosted page, the payment page opens in a new tab and our page stays open: it follows the payment, shows the result and, with `checkout.returnUrl`, takes the customer back to your site. The widget does not leave your page; it reports what happens through `postMessage`. Either way, confirm the payment with [webhooks](https://payfiattocrypto.com/en/docs#webhooks) or [`GET /v1/orders/{orderId}`](https://payfiattocrypto.com/en/docs/reference#get-order).
- Between `payment.completed` and `order.received` there can be minutes or hours: the payment provider decides when it delivers, and the API waits for on-chain finality.
- The payment provider may ask the customer to verify their identity, mostly on a first purchase. The customer sees a purchase of USDC, and the card statement shows the provider's name.
- Disputes and chargebacks are between the customer and the payment provider, under the provider's rules. The API never takes back a payout: a payout made on-chain cannot be reversed. What a chargeback means for the seller or for you is not defined by the API; see [terms of use](https://payfiattocrypto.com/en/docs#terms).
## Fees and payouts
Each order has three deductions. All of them are in the order's stablecoin and are returned in `breakdown` when the order is created, before the customer pays. Paying at the checkout also has the processing fee (the payment provider's MDR), and the card processor may deduct its own fee from what it delivers; see [what the customer pays](https://payfiattocrypto.com/en/docs#checkout-pricing).
| Fee | Field | Who receives it | How much |
| --- | --- | --- | --- |
| Platform fee | `platformFee` | The platform | 1% of `deposit.amount` for orders created through the API, the same for every account. Orders created on our website pay 3%. |
| Your commission | `partnerFee` | Your wallet(s) | `partnerFee.rate` × `deposit.amount`: your full commission, set on every order. What reaches your wallet(s) is `partnerReceives`. |
| Network fee | `networkFee` | The network (gas) | The real on-chain cost of each payout transfer, measured continuously per network. Each recipient pays for its own transfers. |
- The seller's network fee comes out of `sellerReceives`. Yours comes out of your commission: `partnerFee` is the full commission, and `partnerReceives` is what you actually receive, `partnerFee` minus the network fee of your own transfers.
- `networkFee` is the total of all payout transfers on the order, the seller's and yours. The platform pays for its own transfers.
- So `sellerReceives` + `platformFee` + `partnerReceives` + `networkFee` = `deposit.amount`, to the last decimal place. Add `partnerReceives`, not `partnerFee`: the network fee of your own transfers is already in `networkFee`.
### Fee modes
`feeMode` decides who pays the fees, and at the checkout it also decides who pays the [MDR](https://payfiattocrypto.com/en/docs#checkout-pricing). Both examples below are 100 USDC on Base with your commission at 1%, one seller wallet, one commission wallet and an illustrative network fee of 0.002 USDC per transfer.
| | `seller`: the seller pays | `customer`: the customer pays |
| --- | --- | --- |
| `amount` in the request | `deposit.amount`: what must reach the order wallet. By card, less arrives: the MDR, and any fee the card processor deducts, come out of it. | What the seller receives in the quote (`breakdown.sellerReceives`) |
| `deposit.amount` | 100.000000 | 102.042857 |
| `breakdown.platformFee` | 1.000000 | 1.020429 |
| `breakdown.partnerFee` | 1.000000 | 1.020428 |
| `breakdown.partnerReceives` | 0.998000 | 1.018428 |
| `breakdown.networkFee` | 0.004000 | 0.004000 |
| `breakdown.sellerReceives` | **97.998000** | **100.000000** |
Every amount is rounded down to the token's 6 decimal places. In `customer` mode the quote gives the seller exactly `amount` (`breakdown.sellerReceives`); the rounding remainder stays in the platform fee and never comes out of your commission. What is actually paid follows what reaches the order wallet: see [when the amount received differs](https://payfiattocrypto.com/en/docs#amount-differences).
### Minimums
- `amount` must be at least **US$ 10**, in either fee mode and however the customer pays (`AMOUNT_TOO_LOW`). `GET /v1/assets` returns this minimum as `minTicketUsd`. The error's `details.minimumTicket` is a `deposit.amount`: in `customer` mode the fees come on top of the US$ 10, so it is higher. There is no maximum amount.
- What reaches the order wallet is paid out only from US$ 5 up; below the order amount, the payout is proportional (see [when the amount received differs](https://payfiattocrypto.com/en/docs#amount-differences)). In `seller` mode the card cost comes out of the payment: if card costs ever push the `seller`-mode minimum above `minTicketUsd`, `GET /v1/assets` returns it as `sellerMinTicketUsd` (absent today), and `seller`-mode orders need at least that (`AMOUNT_TOO_LOW`).
- Each side pays the network fee of its own transfers, and that fee, times a safety margin of 3, must stay within 10% of the side's share. In practice, your commission must be at least 30 times the network fee of your own transfers (`PARTNER_FEE_BELOW_GAS`), and so must the seller's share (`AMOUNT_TOO_LOW`). The error tells you the smallest amount and the smallest rate that would pass.
- Each recipient must receive at least twice the network fee of its own transfer (`RECIPIENT_AMOUNT_TOO_LOW`). This matters with many split wallets or small shares.
- Every order pays a commission: `partnerFee.rate` of `0` cannot cover your own transfer and returns `PARTNER_FEE_BELOW_GAS`. An `amount` of `0` returns `AMOUNT_TOO_LOW`.
- The network fee is measured continuously, so an order near a minimum can pass today and fail later. There is no quote endpoint: `details` on these errors tells you what would pass.
These rules exist because a transfer that costs more in gas than it moves loses money. They are checked at creation, when a rejected order costs nothing.
**Response to a 5.00 order in seller mode**
```json
{
"error": {
"code": "AMOUNT_TOO_LOW",
"message": "Amount is below the minimum for this asset and network.",
"details": {
"minimumTicket": "10.000000"
}
}
}
```
## Order lifecycle
```text
created ──► received ──► settling ──► settled
│ │ ▲
▼ ▼ │
expired settle_failed
```
| Status | Meaning | What to do |
| --- | --- | --- |
| `created` | Waiting for the payment: at the checkout, or sent to `deposit.address`. | Send the customer to the checkout, or give them `deposit.address` and `deposit.amount`. |
| `received` | A payable amount reached the order wallet and is final on-chain. It can be less than `deposit.amount`. | Treat the payment as arrived; the payout starts right away. The order does not show yet how much arrived: see [when the amount received differs](https://payfiattocrypto.com/en/docs#amount-differences). |
| `settling` | Payout transfers are being sent and confirmed. | Wait. On Base, the payout is final about half an hour after the payment arrived, because it waits for finality on Ethereum. |
| `settled` | Every recipient was paid, and every transfer is final. | Final state. Nothing else happens to this order. |
| `settle_failed` | A payout could not be completed. For example, the token issuer blocked a recipient's address. | Our team is alerted and handles it. Transfers that already went out stay paid. Contact support if you need to change a destination. |
| `expired` | No payable amount arrived within 7 days: nothing, or less than the [minimum](https://payfiattocrypto.com/en/docs#amount-differences). The checkout no longer works, and the order wallet is no longer watched. | Create a new order. |
**Paid or not:** the payment has arrived in `received`, `settling`, `settled` and `settle_failed`. In `created` and `expired`, nothing payable has arrived.
The API never confirms a payment that is not final on-chain, so a chain reorganization cannot turn a paid order back into an unpaid one.
## What the order shows
- The order shows the quote, fixed at creation: `deposit.amount` and `breakdown`. It does not show yet what actually arrived, the amount each recipient was paid or the payout transaction hashes. To see the transfers, look up `deposit.address` on the network's block explorer.
- The order does not repeat your request (`amount`, `feeMode` outside `checkout`, the wallets, `partnerFee.rate`). Store what you sent, or put your own references in `metadata`.
- An order expires 7 days after `createdAt` if no payable amount arrived. There is no endpoint to cancel an order: one that is never paid simply expires.
- A second payment at the checkout, or one made after the order expired, is paid out through a [derived order](https://payfiattocrypto.com/en/docs#derived-orders). Crypto sent straight to `deposit.address` after the order was paid or expired is not paid out automatically: contact support.
- `settle_failed` is resolved by our team. When the payout completes, the order becomes `settled` and `order.settled` is sent.
- `checkout.url` and `checkout.embedUrl` are always present when the order has a `checkout`.
- For a cart with several sellers, create one order per seller, or one order with `sellerRecipients` when the shares are fixed.
- Amounts that reach the order wallet add up, but the checkout always charges the full `deposit.amount`. If part was already sent in crypto, paying at the checkout too makes the excess go to the seller.
## When the amount received differs
The payout follows what actually reaches the order wallet. The expected amount is `deposit.amount`. A card or bank payment rarely matches it to the cent: the customer's amount is rounded up, exchange rates move, the card processor may deduct its own fee from what it delivers, and in `seller` mode the MDR comes out of the payment. The platform never makes up a shortfall. Whatever arrives, the result is defined in advance:
| What arrived | What is paid |
| --- | --- |
| Exactly the expected amount | The amounts in `breakdown`. |
| More than expected | The whole excess goes to the seller. Your commission and the fees stay as quoted. |
| Less than expected | Proportional to what arrived: the platform fee and your commission are each multiplied by what arrived ÷ `deposit.amount`, each recipient still pays the full network fee of its own transfers, and the seller receives the rest. The platform does not cover the shortfall. |
| Below the payout minimum (US$ 5), or so little that the seller's or your proportional share would not cover the network fee of its own transfers | Nothing is paid out, to anyone, because the network fees would cost more than the value. The order stays `created`, and later amounts delivered to the same order add up. The seller (with `sellerNotify`) and you are told on Telegram how much arrived, and asked to contact support (see [notifications](https://payfiattocrypto.com/en/docs#notifications)). Without a payable balance, the order expires after 7 days and sends `order.expired`; no webhook reports the amount that arrived. |
> **One payment per order:** Each order is paid once. A second payment at the checkout is paid out through a [derived order](https://payfiattocrypto.com/en/docs#derived-orders). Crypto sent after the order is `received` is not part of any payout; contact support to recover it.
## Additional payments and derived orders
A customer can pay an order more than once: twice at the checkout, or after the order expired. A second card or bank payment is never added to an order that was already paid or that expired: the API creates a derived order to pay it out, and tells you with `order.additional_payment`.
- The derived order has its own `orderId`, the same as the `data.payment.id` of the payment it pays out, its own wallet (`deposit.address`), and `parentOrderId`: your order's `orderId`. That payment's `payment.started` and `payment.completed` came with your order's `orderId`, so you can link the derived order by `parentOrderId` or by that `data.payment.id`.
- It copies your order's terms: the same seller and commission wallets, the same `deposit.amount` and `breakdown` (your order's quote, not the amount of this payment), `metadata`, `webhookUrl` and Telegram chats. It has no `checkout`: it cannot be paid by link, and the checkout endpoints return `409 ORDER_NOT_PAYABLE` for it.
- Its payout follows what actually reaches its wallet, with the [same rules](https://payfiattocrypto.com/en/docs#amount-differences): in `seller` mode the MDR comes out of the payment, any fee the card processor deducts comes out of what arrives, and a shortfall is paid out in proportion.
- Its events go to the same `webhookUrl`: `order.additional_payment` when it is created (`occurredAt` is its `createdAt`), then its own `order.received` and `order.settled`, with its own `orderId`. Your order keeps its status: an expired order stays `expired`.
- A card payment approved shortly before your order expired can reach the order wallet after that: you then get `order.expired` for your order and, later, `order.additional_payment`. If you got `payment.completed` for an order, do not treat its `order.expired` as final. Keep the sale open, and deliver when the derived order's `order.received` arrives.
- Like any order, it expires if nothing payable reaches its wallet within 7 days.
- Crypto sent straight to `deposit.address` after your order was paid or expired does not create a derived order: contact support.
- The platform does not refund. The seller receives the extra payment; refunding the customer, if needed, is up to the seller, outside the API.
## Split payouts
Instead of one wallet, the seller's amount (`sellerRecipients`) and your commission (`partnerFee.recipients`) can each be split between up to 5 wallets. Each entry has a `wallet` and a `share`, and the shares of a group add up to exactly `1`.
**Request body with a split**
```json
{
"amount": "250.00",
"asset": {
"symbol": "USDC",
"network": "base"
},
"feeMode": "seller",
"sellerRecipients": [
{
"wallet": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"share": "0.7"
},
{
"wallet": "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB",
"share": "0.3"
}
],
"partnerFee": {
"rate": "0.02",
"wallet": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"
}
}
```
- Each wallet is paid in its own on-chain transfer and pays that transfer's network fee. Splitting into more wallets means more network fees for that group.
- `breakdown.sellerReceives` is the total for all seller wallets together, and `breakdown.partnerReceives` the total for all your commission wallets.
- Send either `sellerWallet` or `sellerRecipients`, never both. The same applies to `partnerFee.wallet` and `partnerFee.recipients`.
- A wallet receives only one part of an order: the same wallet twice in a group, or as both the seller and the partner, is rejected with `WALLET_CONFLICT`.
- A `share` is a decimal string with at most 39 decimal places; trailing zeros do not count.
## Webhooks
Give an order a `webhookUrl` and we send its events to your server with a `POST`: when the payment arrives, when it is paid out, when a payout fails or the order expires, when a customer pays an order again, and what the payment page reports to us from the checkout. They arrive even when the customer never returns to your site, so your system can update the order on its own.
### Receive webhooks for an order
- Send `webhookUrl` in [`POST /v1/orders`](https://payfiattocrypto.com/en/docs/reference#create-order). Each order has its own URL; an order without one sends no webhooks.
- The URL must use `https://` on port 443 or 8443, point to a public internet host and have at most 2048 characters. Anything else is rejected with `400 INVALID_REQUEST`. The host is checked again on every delivery, and redirects are not followed.
- Every event is signed with your account's webhook secret (`whsec_…`). You get it with your API key, and every new key comes with a new secret; `/webhook` in the Telegram bot shows the current one. For 24 hours after a new key, every attempt, including retries of older events, is signed with both the previous and the new secret, so `X-Signature` carries two `v1` values; after that, only the new secret signs. Update your server within those 24 hours.
- A public host is a name with at least one dot that resolves only to public internet addresses. Private and local IP addresses, `localhost` and names ending in `.local`, `.localdomain`, `.internal`, `.intranet`, `.lan`, `.home` or `.corp` are refused. A query string is allowed; credentials and a `#fragment` are not. Deliveries do not come from fixed IP addresses.
### Events
Order events come from the blockchain and follow the [order lifecycle](https://payfiattocrypto.com/en/docs#lifecycle). Payment events are what the payment page reports about the checkout: notices, not proof. There is no event for `settling`; when our team resolves a `settle_failed` payout, `order.settled` follows. Failed, cancelled or abandoned payments are not reported.
| Event | When it is sent | What to do |
| --- | --- | --- |
| `order.received` | A payable amount reached the order wallet and is final on-chain (`received`). It can be less than `deposit.amount`. | Treat the payment as arrived; the payout starts right away. See [when the amount received differs](https://payfiattocrypto.com/en/docs#amount-differences). |
| `order.settled` | Every recipient was paid and every transfer is final (`settled`). | Final state. Nothing else happens to this order. |
| `order.settle_failed` | A payout could not be completed (`settle_failed`). | Our team is alerted and handles it. See [order lifecycle](https://payfiattocrypto.com/en/docs#lifecycle). |
| `order.expired` | No payable amount arrived within 7 days (`expired`): nothing, or less than the [minimum](https://payfiattocrypto.com/en/docs#amount-differences). | Create a new order if the customer still wants to pay. After a `payment.completed`, the payment can still come as a [derived order](https://payfiattocrypto.com/en/docs#derived-orders). Keep the sale open until then, and deliver on that order's `order.received`. |
| `order.additional_payment` | The customer paid one of your orders again, or paid after it expired, and the API created a [derived order](https://payfiattocrypto.com/en/docs#derived-orders) to pay that out. `data.order` is the new order; its `parentOrderId` is your order. | Record the new order and link it to yours. It follows the normal lifecycle and sends its own events. The seller receives the extra payment; refunding the customer, if needed, is up to the seller. |
| `payment.started` | The customer opened the payment page for this order. | Optional: show that the payment is in progress. The customer can still give up. |
| `payment.completed` | The payment page reports that the customer paid. | Show the payment as accepted. The funds still have to reach the order wallet: wait for `order.received` before treating the order as paid. |
### What we send
Each event is one `POST` with a JSON body. The order inside the event has the same shape as in [`GET /v1/orders/{orderId}`](https://payfiattocrypto.com/en/docs/reference#get-order), as it was when the event happened.
**Example: payment.completed**
```http
POST /webhooks/payfiattocrypto HTTP/1.1
Host: example.com
Content-Type: application/json
User-Agent: webhooks/1.0
X-Event-Id: evt_6f1d3c52-8e0a-4b7e-9a51-2c4d7e8f9a10
X-Event-Type: payment.completed
X-Signature: t=1794838319,v1=bc95c29c02dc06d6f7198c2e26402659e48b07cb7cc060b21ca2d966ec0aa4a3
{
"id": "evt_6f1d3c52-8e0a-4b7e-9a51-2c4d7e8f9a10",
"event": "payment.completed",
"occurredAt": "2026-11-16T14:11:58.604Z",
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"data": {
"order": {
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"status": "created",
"deposit": {
"address": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb",
"amount": "100.000000",
"asset": {
"symbol": "USDC",
"network": "base",
"contractAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
},
"breakdown": {
"sellerReceives": "97.998000",
"platformFee": "1.000000",
"partnerFee": "1.000000",
"partnerReceives": "0.998000",
"networkFee": "0.004000"
},
"checkout": {
"token": "kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"url": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"embedUrl": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT?embed=1",
"feeMode": "seller"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
},
"createdAt": "2026-11-16T14:05:09.120Z"
},
"payment": {
"id": "3b8e2f41-6c7d-4a9e-8f10-5d2c1b0a9e87",
"amount": "100.00",
"currency": "USD"
}
}
}
```
- `X-Event-Id`: the event id, the same on every retry of that event. Use it to skip duplicates.
- `X-Event-Type`: the event type, the same as `event` in the body.
- `X-Signature`: `t=`, the Unix time of this attempt, then one or more `v1=`, each an HMAC-SHA256 signature: `t=,v1=`, or `t=,v1=,v1=` while a previous secret still signs. Accept the webhook if any `v1` matches. See [verify the signature](https://payfiattocrypto.com/en/docs#webhook-signature).
**Body by event: order.received**
```json
{
"id": "evt_610ed79b-c493-4323-88e9-beff2e9d8290",
"event": "order.received",
"occurredAt": "2026-11-16T16:48:03.271Z",
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"data": {
"order": {
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"status": "received",
"deposit": {
"address": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb",
"amount": "100.000000",
"asset": {
"symbol": "USDC",
"network": "base",
"contractAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
},
"breakdown": {
"sellerReceives": "97.998000",
"platformFee": "1.000000",
"partnerFee": "1.000000",
"partnerReceives": "0.998000",
"networkFee": "0.004000"
},
"checkout": {
"token": "kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"url": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"embedUrl": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT?embed=1",
"feeMode": "seller"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
},
"createdAt": "2026-11-16T14:05:09.120Z"
}
}
}
```
**Body by event: order.settled**
```json
{
"id": "evt_577cc06e-1408-4778-aae6-4d1cfe3f9da7",
"event": "order.settled",
"occurredAt": "2026-11-16T17:23:41.902Z",
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"data": {
"order": {
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"status": "settled",
"deposit": {
"address": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb",
"amount": "100.000000",
"asset": {
"symbol": "USDC",
"network": "base",
"contractAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
},
"breakdown": {
"sellerReceives": "97.998000",
"platformFee": "1.000000",
"partnerFee": "1.000000",
"partnerReceives": "0.998000",
"networkFee": "0.004000"
},
"checkout": {
"token": "kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"url": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"embedUrl": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT?embed=1",
"feeMode": "seller"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
},
"createdAt": "2026-11-16T14:05:09.120Z"
}
}
}
```
**Body by event: order.settle_failed**
```json
{
"id": "evt_a5ed38c6-2fba-432e-9421-c25b89d8030e",
"event": "order.settle_failed",
"occurredAt": "2026-11-16T17:31:12.448Z",
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"data": {
"order": {
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"status": "settle_failed",
"deposit": {
"address": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb",
"amount": "100.000000",
"asset": {
"symbol": "USDC",
"network": "base",
"contractAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
},
"breakdown": {
"sellerReceives": "97.998000",
"platformFee": "1.000000",
"partnerFee": "1.000000",
"partnerReceives": "0.998000",
"networkFee": "0.004000"
},
"checkout": {
"token": "kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"url": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"embedUrl": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT?embed=1",
"feeMode": "seller"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
},
"createdAt": "2026-11-16T14:05:09.120Z"
}
}
}
```
**Body by event: order.expired**
```json
{
"id": "evt_15bdf163-f19f-45cc-99b1-cc94c8e211c9",
"event": "order.expired",
"occurredAt": "2026-11-23T14:05:31.006Z",
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"data": {
"order": {
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"status": "expired",
"deposit": {
"address": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb",
"amount": "100.000000",
"asset": {
"symbol": "USDC",
"network": "base",
"contractAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
},
"breakdown": {
"sellerReceives": "97.998000",
"platformFee": "1.000000",
"partnerFee": "1.000000",
"partnerReceives": "0.998000",
"networkFee": "0.004000"
},
"checkout": {
"token": "kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"url": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"embedUrl": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT?embed=1",
"feeMode": "seller"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
},
"createdAt": "2026-11-16T14:05:09.120Z"
}
}
}
```
**Body by event: order.additional_payment**
```json
{
"id": "evt_ad303074-1e99-4692-b8a0-21478b25021d",
"event": "order.additional_payment",
"occurredAt": "2026-11-17T09:14:26.537Z",
"orderId": "c4f1a7e2-9b3d-4e58-a6c0-7d21e5f8b934",
"data": {
"order": {
"orderId": "c4f1a7e2-9b3d-4e58-a6c0-7d21e5f8b934",
"status": "created",
"deposit": {
"address": "0x52908400098527886E0F7030069857D2E4169EE7",
"amount": "100.000000",
"asset": {
"symbol": "USDC",
"network": "base",
"contractAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
},
"breakdown": {
"sellerReceives": "97.998000",
"platformFee": "1.000000",
"partnerFee": "1.000000",
"partnerReceives": "0.998000",
"networkFee": "0.004000"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
},
"parentOrderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"createdAt": "2026-11-17T09:14:26.537Z"
}
}
}
```
**Body by event: payment.started**
```json
{
"id": "evt_d8833195-d5fa-4a9a-bf81-0a5b87b21d0a",
"event": "payment.started",
"occurredAt": "2026-11-16T14:07:42.315Z",
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"data": {
"order": {
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"status": "created",
"deposit": {
"address": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb",
"amount": "100.000000",
"asset": {
"symbol": "USDC",
"network": "base",
"contractAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
},
"breakdown": {
"sellerReceives": "97.998000",
"platformFee": "1.000000",
"partnerFee": "1.000000",
"partnerReceives": "0.998000",
"networkFee": "0.004000"
},
"checkout": {
"token": "kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"url": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"embedUrl": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT?embed=1",
"feeMode": "seller"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
},
"createdAt": "2026-11-16T14:05:09.120Z"
},
"payment": {
"id": "3b8e2f41-6c7d-4a9e-8f10-5d2c1b0a9e87",
"amount": "100.00",
"currency": "USD"
}
}
}
```
**Body by event: payment.completed**
```json
{
"id": "evt_6f1d3c52-8e0a-4b7e-9a51-2c4d7e8f9a10",
"event": "payment.completed",
"occurredAt": "2026-11-16T14:11:58.604Z",
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"data": {
"order": {
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"status": "created",
"deposit": {
"address": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb",
"amount": "100.000000",
"asset": {
"symbol": "USDC",
"network": "base",
"contractAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
},
"breakdown": {
"sellerReceives": "97.998000",
"platformFee": "1.000000",
"partnerFee": "1.000000",
"partnerReceives": "0.998000",
"networkFee": "0.004000"
},
"checkout": {
"token": "kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"url": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"embedUrl": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT?embed=1",
"feeMode": "seller"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
},
"createdAt": "2026-11-16T14:05:09.120Z"
},
"payment": {
"id": "3b8e2f41-6c7d-4a9e-8f10-5d2c1b0a9e87",
"amount": "100.00",
"currency": "USD"
}
}
}
```
**Event fields**
- `id` (string, required): Event id, the same as in `X-Event-Id` and on every retry.
- `event` (string, required, one of `order.received`, `order.settled`, `order.settle_failed`, `order.expired`, `order.additional_payment`, `payment.started`, `payment.completed`): Event type. See [events](https://payfiattocrypto.com/en/docs#webhook-events).
- `occurredAt` (string · date-time, required): When the event happened, ISO 8601 in UTC.
- `orderId` (string · uuid, required): The order this event is about.
- `data` (object, required): What the event is about.
- `order` (object, required): The order when the event was created, in the same shape as in [`GET /v1/orders/{orderId}`](https://payfiattocrypto.com/en/docs/reference#get-order).
- `payment` (object, optional): Present on `payment.started` and `payment.completed` only, absent on every `order.*` event: the payment on the payment page.
- `id` (string · uuid, required): The payment's id. A customer who pays again starts another payment. A [derived order](https://payfiattocrypto.com/en/docs#derived-orders) takes the id of the payment it pays out.
- `amount` (string · decimal, required): What the customer pays, in their currency, as a decimal string: the amount the payment was opened for, the same on `payment.started` and `payment.completed`.
- `currency` (string, required): Currency the customer pays in, as an ISO 4217 code, for example `EUR`.
### Verify the signature
1. Read `t` and every `v1` from the `X-Signature` header: there is exactly one `t`, and one or more `v1`.
2. Reject the request if `t` is more than 300 seconds away from your clock. That way, a request someone captured and sends again later is refused.
3. Compute HMAC-SHA256 with your webhook secret over `t`, a period (`.`) and the raw request body, exactly as received. Compare the result with each `v1` (hex) in constant time, and accept the webhook if any of them matches. For 24 hours after a new key, the previous and the new secret both sign, so the secret your server has matches one of them.
4. Parse the JSON only after the signature matches. Store the event once, unique on its `id`, respond with a 2xx within 10 seconds, and do the slow work afterwards.
5. Use the secret exactly as given, including the `whsec_` prefix, and verify the raw bytes you received: the bodies we send are compact JSON. The [example request](https://payfiattocrypto.com/en/docs#webhook-request) is indented for reading, and its signature covers it exactly as shown.
**Node.js**
```javascript
import crypto from "node:crypto";
import express from "express";
const app = express();
const SECRET = process.env.PFC_WEBHOOK_SECRET;
const TOLERANCE_SECONDS = 300;
// The signature covers the exact bytes we sent: read the raw body.
app.post("/webhooks/payfiattocrypto", express.raw({ type: "application/json" }), async (req, res) => {
const pairs = (req.get("X-Signature") ?? "").split(",").map((p) => p.split("=", 2));
const timestamps = pairs.filter(([key]) => key === "t").map(([, value]) => value);
const t = Number(timestamps[0]);
if (timestamps.length !== 1 || !Number.isInteger(t) || Math.abs(Date.now() / 1000 - t) > TOLERANCE_SECONDS) return res.sendStatus(400);
const expected = crypto.createHmac("sha256", SECRET).update(timestamps[0] + ".").update(req.body).digest();
// There can be more than one v1 (for example, for 24 hours after a new key): accept if any of them matches.
const valid = pairs
.filter(([key]) => key === "v1")
.some(([, value]) => {
const received = Buffer.from(value ?? "", "hex");
return received.length === expected.length && crypto.timingSafeEqual(received, expected);
});
if (!valid) return res.sendStatus(400);
const event = JSON.parse(req.body.toString("utf8"));
// The same event can arrive more than once: store it once, unique on its id, and answer 2xx right away.
const isNew = await saveEventOnce(event); // e.g. INSERT ... ON CONFLICT (id) DO NOTHING
res.sendStatus(200);
// Process it afterwards: read the order with GET /v1/orders/{orderId} and act on its current status.
if (isNew) queueForProcessing(event.id); // event.event, event.orderId, event.data.payment
});
```
**Python**
```python
import hashlib
import hmac
import json
import os
import time
from flask import Flask, request
app = Flask(__name__)
SECRET = os.environ["PFC_WEBHOOK_SECRET"].encode()
TOLERANCE_SECONDS = 300
@app.post("/webhooks/payfiattocrypto")
def webhook():
pairs = [p.split("=", 1) for p in request.headers.get("X-Signature", "").split(",") if "=" in p]
timestamps = [value for key, value in pairs if key == "t"]
if len(timestamps) != 1:
return "", 400
try:
t = int(timestamps[0])
except ValueError:
return "", 400
if abs(time.time() - t) > TOLERANCE_SECONDS:
return "", 400
# The signature covers the exact bytes we sent: read the raw body.
body = request.get_data()
expected = hmac.new(SECRET, timestamps[0].encode() + b"." + body, hashlib.sha256).hexdigest().encode()
# There can be more than one v1 (for example, for 24 hours after a new key): accept if any of them matches.
signatures = [value.encode() for key, value in pairs if key == "v1"]
if not any(hmac.compare_digest(expected, signature) for signature in signatures):
return "", 400
event = json.loads(body)
# The same event can arrive more than once: store it once, unique on its id, and answer 2xx right away.
if save_event_once(event): # e.g. INSERT ... ON CONFLICT (id) DO NOTHING
# Process it afterwards: read the order with GET /v1/orders/{orderId} and act on its current status.
queue_for_processing(event["id"]) # event["event"], event["orderId"], event["data"].get("payment")
return "", 200
```
**PHP**
```php
$tolerance) {
http_response_code(400);
exit;
}
$expected = hash_hmac("sha256", $t . "." . $body, $secret);
// There can be more than one v1 (for example, for 24 hours after a new key): accept if any of them matches.
$valid = false;
foreach ($signatures as $signature) {
if (hash_equals($expected, $signature)) {
$valid = true;
}
}
if (!$valid) {
http_response_code(400);
exit;
}
$event = json_decode($body, true);
// The same event can arrive more than once: store it once, unique on its id, and answer 2xx right away.
if (save_event_once($event)) { // e.g. INSERT ... ON CONFLICT (id) DO NOTHING
// Process it afterwards: read the order with GET /v1/orders/{orderId} and act on its current status.
queue_for_processing($event["id"]); // $event["event"], $event["orderId"], $event["data"]["payment"] ?? null
}
http_response_code(200);
```
To test your verifier, use the secret `whsec_example` with the `X-Signature` value and the body below, exactly as shown: the body ends at the last `}`, with no newline after it. The Copy button of the [example request](https://payfiattocrypto.com/en/docs#webhook-request) copies the headers too. Turn off the time check first: the example's `t` is in the past. Copying it out of a Markdown code block adds a line break before the closing fence: remove it, or the signature will not match.
**X-Signature of the example**
```text
t=1794838319,v1=bc95c29c02dc06d6f7198c2e26402659e48b07cb7cc060b21ca2d966ec0aa4a3
```
**Body of the example, signed exactly as shown**
```json
{
"id": "evt_6f1d3c52-8e0a-4b7e-9a51-2c4d7e8f9a10",
"event": "payment.completed",
"occurredAt": "2026-11-16T14:11:58.604Z",
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"data": {
"order": {
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"status": "created",
"deposit": {
"address": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb",
"amount": "100.000000",
"asset": {
"symbol": "USDC",
"network": "base",
"contractAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
},
"breakdown": {
"sellerReceives": "97.998000",
"platformFee": "1.000000",
"partnerFee": "1.000000",
"partnerReceives": "0.998000",
"networkFee": "0.004000"
},
"checkout": {
"token": "kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"url": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"embedUrl": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT?embed=1",
"feeMode": "seller"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
},
"createdAt": "2026-11-16T14:05:09.120Z"
},
"payment": {
"id": "3b8e2f41-6c7d-4a9e-8f10-5d2c1b0a9e87",
"amount": "100.00",
"currency": "USD"
}
}
}
```
### Delivery rules
- Respond with a 2xx status within 10 seconds. Any other status, a redirect or no answer counts as a failed attempt.
- Failed attempts are retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h, 24 h: up to 9 attempts over about 69 hours. A retry keeps the same `X-Event-Id` and body, with a new `t` and signature.
- Delivery is at least once: the same event can arrive more than once. Skip event ids you already handled.
- Order is not guaranteed: an older event can arrive after a newer one, and `data.order` is the order as it was when the event was created. Use the event as a trigger: before acting (shipping goods, crediting an account), read the order with [`GET /v1/orders/{orderId}`](https://payfiattocrypto.com/en/docs/reference#get-order) and act on its current `status`. An order that moved quickly from `received` to `settled` gets both events.
- An event can be about an order you have no record of: the [derived order](https://payfiattocrypto.com/en/docs#derived-orders) of one of yours, whose events can arrive before its `order.additional_payment`. Its `data.order.parentOrderId` is your order's `orderId`. Answer with a 2xx to every event whose signature matches, even one you ignore: any other answer is retried for about 69 hours.
- Webhooks speed up your integration, but the source of truth is the order status read from the API. If every attempt fails, the order still changes status normally.
- There is no endpoint to list or resend events. If you miss one, read the order with [`GET /v1/orders/{orderId}`](https://payfiattocrypto.com/en/docs/reference#get-order) or page through [`GET /v1/orders`](https://payfiattocrypto.com/en/docs/reference#list-orders).
## Telegram notifications
Optionally, the seller (`sellerNotify`) and you (`partnerFee.notify`) can get Telegram messages about an order: order created, payment received, order settled, or a payout that failed.
```json
{
"sellerNotify": {
"channel": "telegram",
"id": "123456789"
}
}
```
- `id` is the **numeric** Telegram chat id, never a `@username`: positive for a private chat, negative for a group, supergroup or channel (for example `-1001234567890`). Leading zeros are dropped, and the absolute value can be at most 9007199254740991. Anything else is rejected with `400 INVALID_REQUEST`. The easiest way for a seller to get their id is to open [`https://t.me/fiat_to_crypto_bot?start=notify`](https://t.me/fiat_to_crypto_bot?start=notify) and press **Start**: our bot replies with that person's numeric chat id and a button to copy it. For a group, a Telegram "ID bot" added to the group can show its id.
- For a private chat, the person must open [@fiat_to_crypto_bot](https://t.me/fiat_to_crypto_bot) and press **Start** once, because Telegram bots cannot start a conversation. For a group, supergroup or channel, add the bot to it first: it can only post where it is a member (in a channel, as an administrator). These notices and their buttons are in English; the bot answers commands in the language of the person's Telegram app.
- Each order notifies only the chats given in that order. Nothing is reused from other orders, even with the same wallet.
- The API checks only the format of `id`: it cannot tell whether the chat exists or whether **Start** was pressed. A message the chat cannot receive is dropped, and nothing tells you. The seller's chat and yours get a message as soon as the order is created, so you can confirm right away with the seller that the messages arrive; a repeated request (`Idempotent-Replayed: true`) does not send it again.
- If less than the order amount arrives and it is below the payout minimum (US$ 5) or too little to cover the network fee of the payout, nothing is paid out. The seller's chat (`sellerNotify`, if given) and your account's chat, where you created your API key, get one message saying how much arrived and asking to contact support at [@payfiattocrypto](https://t.me/payfiattocrypto). See [when the amount received differs](https://payfiattocrypto.com/en/docs#amount-differences).
## Telegram bot
For you, the integrator, the bot manages your access to the API, in a private chat only:
- `/newkey` creates your API key after you accept the terms. The reply shows the key once (copy it right away), together with your webhook signing secret.
- Each account has one active key. Sending `/newkey` again creates a new key and a new webhook secret; the bot warns you before. The previous key keeps working for 24 hours, then stops, and for those 24 hours webhooks are signed with both the previous and the new secret: put the new key and secret in your integration within that time. The new key still sees your orders.
- `/keys` shows your client id, your active key's short id and creation time and, for 24 hours after a new key, the previous key and when it stops; never the key itself: only its hash is stored. `/revoke` stops the key you pick from that list at once, the previous one included: use it if a key leaked.
- `/webhook` shows your webhook signing secret again. To change the secret, create a new key: every key comes with a new secret.
The seller (`sellerNotify`) and you (`partnerFee.notify`) can register a Telegram on each order. That chat gets a message when the order is created, when it is paid and when the payout is sent.
- If a payout cannot be delivered, the message says so and the funds **stay safe with us**. Nothing is lost.
- When the token issuer has blocked the receiving address, the message has a **Use another address** button. The person sends an address they control **on the same network**, checks it on a confirmation screen, and our team reviews the change before anything is sent. After approval, the payment goes out after a short safety wait. Typing `/newaddress` with the order id from the message does the same.
- Only the Telegram registered for that payout in the order can ask for a new address, and only from its **private chat** with the bot. A request from any other chat is refused, without revealing anything about the order. When the order registered a group, nobody can ask from the group: contact support at [@payfiattocrypto](https://t.me/payfiattocrypto) to change the address.
- Any other kind of failure is handled by our team: the person does not need to do anything, and gets a message when the payment is sent.
- Anyone who does not want these messages can send `/mute` to the bot: that chat stops getting payment messages, including failures and address changes. `/unmute` turns them back on. Commands still get answers while the chat is muted.
## Idempotency
Send an `Idempotency-Key` header on `POST /v1/orders`, unique per order, and reuse it on every retry of that same order. Without it, a retry after a timeout can create a second order with a second wallet and checkout, and the customer would pay only one of them.
- Same key and same body: the API returns the same order, with the same wallet and checkout, the same `201` status and the response header `Idempotent-Replayed: true`. It does not create anything new. A newly created order never has this header, so it tells a repeat from a creation.
- Same key with a different body: `409 IDEMPOTENCY_KEY_REUSED`, at any time. A key that created an order never creates a different one.
- Same key while the first request is still running: `409 REQUEST_IN_PROGRESS`. Retry after a short wait.
- If the first attempt failed after the order was saved, the retry finds that order and returns its current `status`, also with `Idempotent-Replayed: true`.
- The key has 1 to 255 characters. Your own order id or a UUID works well.
- The body is compared in a canonical form: spacing and the order of keys do not matter, but the order of items in an array does (for example, in `sellerRecipients`). Values must match exactly: `"120.00"` and `"120.0"` are different bodies. Keep the body you sent and resend it unchanged.
- A request rejected with a `4xx` creates nothing and does not use up the key: fix the request and retry with the same key.
- Keys are per account, and a key that created an order stays bound to that order. A finished response is replayed for 24 hours. A request that never finishes releases its key after 2 minutes, so `REQUEST_IN_PROGRESS` never lasts longer than that.
- `POST /v1/orders/{orderId}/checkout` takes no `Idempotency-Key`: it opens nothing, and for a given currency the link it returns is always the same. After a `5xx` or a network error, just call it again.
## Pagination
`GET /v1/orders` returns up to `limit` orders (default 30, at most 100), newest first. When there are more, the response has `nextCursor`: pass it unchanged as `cursor` to get the next page. When `nextCursor` is absent, you are on the last page.
Pages are keyed by creation time, not by offset, so orders created while you page never make you skip or repeat an order. Keep the same filters on every page.
## Errors
Every error uses the same envelope, on every endpoint. `code` is stable and meant for your code; `message` is for people; `details` is present on some codes. On schema errors, `details.issues` lists each problem as `{ "path", "message" }`, where `path` names the field, for example `sellerRecipients.1.wallet`. On the rules for `metadata`, `webhookUrl` and `checkout`, `details` has `field` and `reason` instead. Handle an unknown `code` by its HTTP status.
```json
{
"error": {
"code": "AMOUNT_TOO_LOW",
"message": "Amount is below the minimum for this asset and network.",
"details": {
"minimumTicket": "10.000000"
}
}
}
```
`details` by code:
- `INVALID_REQUEST` from the schema: `issues`, a list of `{ "path", "message" }`.
- `INVALID_REQUEST` from the rules of `metadata`, `webhookUrl`, `checkout.payer` or `checkout.returnUrl`: `field`, one of those four, and `reason`, a short English text such as `must use https` or `must be at most 4096 bytes as JSON`.
- `INVALID_RECIPIENT_WALLET`: `field`, `wallet` and `reason`.
- `WALLET_CONFLICT`: `field` and `wallet`.
- `RECIPIENT_AMOUNT_TOO_LOW`: `wallet`.
- `AMOUNT_TOO_LOW`: `minimumTicket`, when some amount would pass. `PARTNER_FEE_BELOW_GAS`: `minimumTicket` and `minimumRate`, each when present.
- `CHECKOUT_UNAVAILABLE`: `asset`, with `symbol` and `network`.
| Code | HTTP | When |
| --- | --- | --- |
| `INVALID_REQUEST` | 400 | The body or query failed validation or is not valid JSON, or the body of `POST /v1/orders` is empty. For `metadata`, `webhookUrl` and `checkout`, `details` names the `field` and the `reason`. An oversized body returns `413` and an unsupported `Content-Type` returns `415`, with the same code. |
| `INVALID_RECIPIENT_WALLET` | 400 | A destination wallet is not a valid EVM address, is not in EIP-55 checksummed form, or can never receive funds (zero address, a token contract, any of the platform's own wallets, another order's wallet). `details` has `field` (`sellerRecipients` or `partnerFee.recipients`, also when you sent `sellerWallet` or `partnerFee.wallet`), `wallet` and `reason`: `malformed`, `not_checksummed`, `zero_address`, `token_contract`, `platform_wallet` or `order_wallet`. The wallet format is checked here, not in the schema. |
| `WALLET_CONFLICT` | 400 | The same wallet appears twice in the order: repeated in a group, or used for both the seller and the partner. `details` has `field` and `wallet`. |
| `PARTNER_PLATFORM_WALLET_CONFLICT` | 400 | A commission wallet is the wallet that receives the platform fee. The platform's other wallets return `INVALID_RECIPIENT_WALLET`. |
| `EMPTY_RECIPIENTS` | 400 | Not returned by the current API: an empty recipient group fails the schema check first, with `INVALID_REQUEST`. |
| `INVALID_SHARES` | 400 | A recipient share is zero or negative, or the shares of a group do not add up to exactly 1. |
| `TOO_MANY_RECIPIENTS` | 400 | Not returned by the current API: a group with more than 5 recipients fails the schema check first, with `INVALID_REQUEST`. |
| `RECIPIENT_AMOUNT_TOO_LOW` | 400 | A recipient would receive less than twice the network fee of its own transfer. `details.wallet` says which one. |
| `AMOUNT_TOO_LOW` | 400 | `amount` is below US$ 10, in either fee mode; or, in `seller` mode, a card payment would arrive below the payout minimum (US$ 5) once card costs come out, which happens only below `sellerMinTicketUsd`, when [`GET /v1/assets`](https://payfiattocrypto.com/en/docs/reference#get-assets) returns it; or the seller's share is too small for the network fee of the seller's transfers (see [minimums](https://payfiattocrypto.com/en/docs#minimums)). `details.minimumTicket`, when present, is the smallest `deposit.amount` that would pass. In `seller` mode, send it as `amount`. In `customer` mode the fees come on top: for an `amount` below US$ 10, it is the `deposit.amount` of an order of 10, so send 10; otherwise, the `amount` that passes is about `minimumTicket` × (1 − 1% − your rate), minus the seller's network fee. |
| `PARTNER_FEE_BELOW_GAS` | 400 | Your commission is too small for the network fee of your own transfers (see [minimums](https://payfiattocrypto.com/en/docs#minimums)). `details` has `minimumTicket` and `minimumRate`: raise either one. |
| `INVALID_FEE_RATE` | 400 | The platform fee and your partner fee together reach 100% or more. |
| `UNSUPPORTED_ASSET` | 400 | The asset and network pair is not supported. Today the API accepts only USDC on Base (`base`); see [supported assets](https://payfiattocrypto.com/en/docs#assets). |
| `CHECKOUT_UNAVAILABLE` | 400 | `checkout` was sent for an asset and network that has no card or bank checkout. Only USDC on Base has one. `details.asset` names the pair. |
| `UNAUTHORIZED` | 401 | The API key is missing, invalid or revoked. |
| `ORDER_NOT_FOUND` | 404 | The order does not exist, belongs to another account, or the id is not a valid UUID. All cases return the same error. |
| `NOT_FOUND` | 404 | The route does not exist: check the method and the path. Any call can return it. |
| `IDEMPOTENCY_KEY_REUSED` | 409 | This `Idempotency-Key` was already used with a different body. Use a new key for a new order. |
| `REQUEST_IN_PROGRESS` | 409 | A request with the same `Idempotency-Key` is still being processed. Retry after a short wait. |
| `ORDER_NOT_PAYABLE` | 409 | The order is no longer waiting for a payment (already paid or expired), has no checkout (a derived order), or expires in less than 12 hours: card and bank payments close 12 hours before the order expires. See [payments and the customer](https://payfiattocrypto.com/en/docs#checkout-flow). |
| `PAYMENT_IN_PROGRESS` | 409 | A payment for this order was already approved and is on its way. Opening another one would charge the customer twice. |
| `CURRENCY_NOT_SUPPORTED` | 422 | The customer's currency is a three-letter code other than `USD` or `EUR` (case does not matter). Anything that is not three letters returns `400 INVALID_REQUEST`. |
| `AMOUNT_BELOW_MINIMUM` | 422 | What the customer would pay is below the minimum for a card payment (US$ 10). With today's order minimum (US$ 10) it does not happen; handle it like `ORDER_NOT_PAYABLE`. |
| `RATE_LIMITED` | 429 | This IP address made more than 120 requests in the current minute, with or without an API key. Wait for the seconds in `Retry-After`. |
| `TOO_MANY_CHECKOUTS` | 429 | Only on the hosted page and the widget, never in your API calls: this order opened 10 payments in the last hour. The page asks the customer to try later. |
| `EXCHANGE_RATE_UNAVAILABLE` | 503 | The exchange rate for the customer's currency is temporarily unavailable at the checkout. Retry later, or use USD. Order creation does not need one: every supported asset is a US dollar stablecoin. |
| `PAYMENTS_UNAVAILABLE` | 503 | Only on the hosted page and the widget, never in your API calls: the payment page is not available right now. The customer can retry shortly. |
| `PAYMENTS_BUSY` | 503 | Only on the hosted page and the widget, never in your API calls: the queue to the payment page had no free slot in time, or this account opened too many new payments in the last minute. Nothing was opened; the hosted page, also when opened from the ready link, retries by itself for about 30 seconds. |
| `INTERNAL_ERROR` | 500 | Unexpected error on our side. The message is generic on purpose; retry with the same `Idempotency-Key`. |
An order is checked in this order, and the first failure is returned: the schema (`INVALID_REQUEST`), the asset, the wallets and shares, the checkout options, then the amounts (`INVALID_FEE_RATE`, `AMOUNT_TOO_LOW`, `PARTNER_FEE_BELOW_GAS`, `RECIPIENT_AMOUNT_TOO_LOW`).
Retry only on `409 REQUEST_IN_PROGRESS`, `429`, `5xx` and network errors, with the same `Idempotency-Key`. A `400` will fail again until the request changes.
## Rate limits
- Each IP address can make up to 120 requests per minute, with or without an API key.
- Every response carries `x-ratelimit-limit`, `x-ratelimit-remaining` and `x-ratelimit-reset` (seconds until the quota resets).
- Above the limit the API returns `429 RATE_LIMITED` with `Retry-After`, in seconds. Other errors have no `Retry-After`: after `REQUEST_IN_PROGRESS` and `EXCHANGE_RATE_UNAVAILABLE`, wait a few seconds, with increasing waits.
- The limit counts every call from the address, with or without a key: a different key does not reset it. On the hosted page and the widget, each customer's browser calls the API itself and has its own quota.
- Each order opens at most 10 payments per hour on the payment page, however the customer arrives (hosted page, widget or ready link). Above that, the page asks the customer to try later (`TOO_MANY_CHECKOUTS`); your API calls are not affected.
Prefer webhooks. To follow many orders, page through `GET /v1/orders?status=…` instead of polling each order one by one; when you poll one order, every 10 seconds is enough.
## Security and reliability
- **Every order has its own wallet.** Payments never mix and the address is never reused. It is returned in `deposit.address` for customers who send the stablecoin directly; card and bank payments go through the checkout.
- **Checked before any money moves.** When the order is created, every wallet's checksum is verified, and the zero address, token contracts, any of the platform's own wallets and other orders' wallets are refused as destinations.
- **A payment notice is never proof.** An order becomes `received` only when the payment is final on-chain in its own wallet, whatever the payment page reports.
- **Payment only from final balances.** The API waits for on-chain finality before treating a payment as received or a payout as done.
- **Never paid twice.** Each payout transfer is recorded before it is signed, and retries resend that same transfer. A retry or a restart cannot pay the same recipient twice.
- **Payouts are not held.** Only the chain itself can delay a payout, never our internal processes.
- **Keys are stored as hashes only.** A key is shown once, at creation.
## Testing your integration
There is no sandbox or test mode yet, and no endpoint that triggers events. Until there is:
- Test your webhook verifier with the [signed example](https://payfiattocrypto.com/en/docs#webhook-signature): with the secret `whsec_example`, its signature is valid once you turn off the time check.
- Webhooks go only to a public `https://` URL. To receive them on your machine, use a tunnel that gives you a public HTTPS address.
- Once you have a key, test with a small real order of at least US$ 10, the minimum in either fee mode: in crypto, by sending `deposit.amount` to `deposit.address`, or by card at the [checkout](https://payfiattocrypto.com/en/docs#checkout-pricing). Payouts are real and irreversible: use wallets you control.
## API reference
| Method | Path | Description |
| --- | --- | --- |
| `GET` | [`/v1/assets`](https://payfiattocrypto.com/en/docs/reference#get-assets) | Stablecoins and networks you can use in an order (today, USDC on Base), with minimums and settlement times. |
| `POST` | [`/v1/orders`](https://payfiattocrypto.com/en/docs/reference#create-order) | Creates an order and returns its own wallet and, for USDC on Base, its checkout. |
| `GET` | [`/v1/orders/{orderId}`](https://payfiattocrypto.com/en/docs/reference#get-order) | Current status, wallet, checkout and breakdown of one order. |
| `GET` | [`/v1/orders`](https://payfiattocrypto.com/en/docs/reference#list-orders) | Your orders, newest first, with filters and cursor pagination. |
| `GET` | [`/v1/orders/{orderId}/checkout/offers`](https://payfiattocrypto.com/en/docs/reference#get-checkout-offers) | How much the customer pays, in their currency, before paying. |
| `POST` | [`/v1/orders/{orderId}/checkout`](https://payfiattocrypto.com/en/docs/reference#create-checkout) | Returns a link that sends the customer straight to the payment page. |
### List supported assets
`GET https://api.payfiattocrypto.com/v1/assets` · requires an API key
Returns every stablecoin and network pair the API accepts; today there is one, USDC on Base. The list is the same for every account.
Read `settlementSeconds` per network: Base waits for finality on Ethereum, so a payout takes about half an hour.
**cURL**
```bash
curl "https://api.payfiattocrypto.com/v1/assets" \
-H "Authorization: Bearer $PFC_API_KEY"
```
**JavaScript**
```javascript
const response = await fetch("https://api.payfiattocrypto.com/v1/assets", {
headers: { Authorization: `Bearer ${process.env.PFC_API_KEY}` },
});
const data = await response.json().catch(() => null);
if (!response.ok) {
throw new Error(data?.error ? data.error.code + ": " + data.error.message : "HTTP " + response.status);
}
```
**Python**
```python
import os
import requests
response = requests.get(
"https://api.payfiattocrypto.com/v1/assets",
headers={"Authorization": f"Bearer {os.environ['PFC_API_KEY']}"},
timeout=30,
)
if not response.ok:
try:
error = response.json()["error"]
except (ValueError, KeyError):
response.raise_for_status()
raise RuntimeError(f"{error['code']}: {error['message']}")
data = response.json()
```
**PHP**
```php
true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("PFC_API_KEY")],
CURLOPT_TIMEOUT => 30,
]);
$raw = curl_exec($ch);
if ($raw === false) {
throw new RuntimeException("Network error: " . curl_error($ch));
}
$data = json_decode($raw, true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status >= 400) {
throw new RuntimeException(($data["error"]["code"] ?? "HTTP " . $status) . ": " . ($data["error"]["message"] ?? ""));
}
```
**Response · 200 OK**
```json
{
"assets": [
{
"symbol": "USDC",
"network": "base",
"name": "USD Coin",
"precision": 6,
"minTicketUsd": "10",
"settlementSeconds": 2280,
"settlementNote": "Waits for Ethereum L1 finality (~65 blocks); counted from the deposit reaching the order wallet."
}
]
}
```
**Response fields**
- `assets` (array of objects, required): One entry per stablecoin and network pair.
- `symbol` (string, required, one of `USDC`): Stablecoin symbol.
- `network` (string, required, one of `base`): Network id used in requests.
- `name` (string, required): Display name.
- `precision` (integer, required): Decimal places of the token contract.
- `minTicketUsd` (string · decimal, required): The smallest `amount` of an order, in US dollars, in either fee mode. The effective minimum can be higher; see [minimums](https://payfiattocrypto.com/en/docs#minimums).
- `sellerMinTicketUsd` (string · decimal, optional): Only on the stablecoin that gets a card `checkout`, and only when card costs push the smallest `seller`-mode order above `minTicketUsd`: that minimum. Absent today. Below it, creating a `seller`-mode order returns `AMOUNT_TOO_LOW`. See [minimums](https://payfiattocrypto.com/en/docs#minimums).
- `settlementSeconds` (integer, required): Typical time from the payment reaching the order wallet to the payout being final, on this network.
- `settlementNote` (string, required): What `settlementSeconds` counts from.
**Errors:** [`UNAUTHORIZED`](https://payfiattocrypto.com/en/docs#error-unauthorized), [`RATE_LIMITED`](https://payfiattocrypto.com/en/docs#error-rate-limited), [`INTERNAL_ERROR`](https://payfiattocrypto.com/en/docs#error-internal-error). See [errors](https://payfiattocrypto.com/en/docs#errors).
### Create an order
`POST https://api.payfiattocrypto.com/v1/orders` · requires an API key
Creates an order and returns its own wallet (`deposit.address`) with exactly how much must arrive (`deposit.amount`), the fees and, for USDC on Base, the `checkout` where the customer pays by card, bank or digital wallet. When the payment reaches the order wallet and is final on-chain, the API splits it and pays every recipient automatically.
All validation happens here, before any money moves: wallet checksums, forbidden destinations, minimums and fee coverage. A rejected order costs nothing. A wrong address after the payment would be irreversible.
Send an `Idempotency-Key` header. If a request fails because of a network error, retrying it with the same key returns the same order, wallet and checkout instead of creating a second one, with the response header `Idempotent-Replayed: true`.
The wallets in the examples are placeholders: replace them with wallets you control.
**Headers**
- `Authorization` (string, required): `Bearer `. See [authentication](https://payfiattocrypto.com/en/docs#authentication).
- `Idempotency-Key` (string, optional, 1–255 characters): Strongly recommended. Your unique id for this order, reused on every retry. See [idempotency](https://payfiattocrypto.com/en/docs#idempotency).
**Request body**
- `amount` (string · decimal, required): Amount in units of the stablecoin, for example `100.00`, with at most 6 decimal places, and at least 10 in either fee mode (see [minimums](https://payfiattocrypto.com/en/docs#minimums)). With `feeMode: "seller"` it is what must reach the order wallet, and the fees come out of it. With `feeMode: "customer"` it is what the seller receives, and the deposit grows to cover the fees.
- `asset` (object, required): Stablecoin and network of every payout.
- `symbol` (string, required, one of `USDC`): Stablecoin symbol.
- `network` (string, required, one of `base`): Network the stablecoin travels on. See [supported assets](https://payfiattocrypto.com/en/docs#assets) for the valid pairs.
- `feeMode` (string, required, one of `seller`, `customer`): Who pays the fees and, at the checkout, the MDR. See [fee modes](https://payfiattocrypto.com/en/docs#fee-modes) and [what the customer pays](https://payfiattocrypto.com/en/docs#checkout-pricing).
- `sellerWallet` (string · evm-address, optional): The seller's wallet. Send exactly one of `sellerWallet` or `sellerRecipients`.
- `sellerRecipients` (array of objects, optional, 1–5 items): Split the seller's amount between up to 5 wallets. See [split payouts](https://payfiattocrypto.com/en/docs#split).
- `wallet` (string · evm-address, required): Destination wallet, exactly as the wallet shows it (EIP-55 checksummed).
- `share` (string · decimal, required): Fraction of the group's amount, for example `0.7`, with at most 39 decimal places. The shares of a group add up to exactly `1`.
- `sellerNotify` (object, optional): Optional. Telegram chat that gets this order's messages for the seller: order created, payment received and payout sent.
- `channel` (string, required, one of `telegram`): Notification channel.
- `id` (string, required): Numeric Telegram chat id, never a `@username`: positive for a private chat, negative for a group, supergroup or channel. See [notifications](https://payfiattocrypto.com/en/docs#notifications).
- `partnerFee` (object, required): Your commission on this order, paid to your wallet(s) on every order.
- `rate` (string · decimal, required): Fraction of `deposit.amount`, for example `0.02` for 2%. The platform fee and this rate together must stay below 100%.
- `wallet` (string · evm-address, optional): Your wallet. Send exactly one of `wallet` or `recipients`.
- `recipients` (array of objects, optional, 1–5 items): Split your commission between up to 5 wallets.
- `wallet` (string · evm-address, required): Destination wallet, exactly as the wallet shows it (EIP-55 checksummed).
- `share` (string · decimal, required): Fraction of the group's amount, for example `0.7`, with at most 39 decimal places. The shares of a group add up to exactly `1`.
- `notify` (object, optional): Optional. Telegram chat that gets this order's messages for you.
- `channel` (string, required, one of `telegram`): Notification channel.
- `id` (string, required): Numeric Telegram chat id, never a `@username`: positive for a private chat, negative for a group, supergroup or channel. See [notifications](https://payfiattocrypto.com/en/docs#notifications).
- `checkout` (object, optional): Optional checkout options. Only for USDC on Base; see [checkout](https://payfiattocrypto.com/en/docs#checkout).
- `payer` (object, optional): Optional. What you already know about the customer.
- `currency` (string, optional, one of `USD`, `EUR`): The currency the customer pays in: `USD` (the default) or `EUR`; lowercase is accepted. Anything else returns `400 INVALID_REQUEST`.
- `returnUrl` (string · uri, optional, up to 2048 characters): Optional. https URL of your site, used unchanged. The hosted page links back to it and, once the payment arrives, sends the customer there; the payment page is given it too. Not proof of payment. See [checkout options](https://payfiattocrypto.com/en/docs#checkout-options).
- `webhookUrl` (string · uri, optional, up to 2048 characters): Optional. HTTPS URL that receives this order's events: port 443 or 8443, on a public host. See [webhooks](https://payfiattocrypto.com/en/docs#webhooks).
- `metadata` (object, optional): Optional. A JSON object with your own data for this order: any keys and any JSON values, nested or not. At most 4096 bytes, counted as compact JSON in UTF-8, with no `\u0000` and no unpaired surrogates. Returned with the same keys and values in the order response and in every webhook; the order of the keys is not kept.
**Example: Seller pays the fees**
**cURL**
```bash
curl "https://api.payfiattocrypto.com/v1/orders" \
-H "Authorization: Bearer $PFC_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-A-1001" \
-d '{
"amount": "100.00",
"asset": {
"symbol": "USDC",
"network": "base"
},
"feeMode": "seller",
"sellerWallet": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"partnerFee": {
"rate": "0.01",
"wallet": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
}
}'
```
**JavaScript**
```javascript
const response = await fetch("https://api.payfiattocrypto.com/v1/orders", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PFC_API_KEY}`,
"Content-Type": "application/json",
// One key per order, reused on every retry of that order.
"Idempotency-Key": "order-A-1001",
},
body: JSON.stringify({
"amount": "100.00",
"asset": {
"symbol": "USDC",
"network": "base"
},
"feeMode": "seller",
"sellerWallet": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"partnerFee": {
"rate": "0.01",
"wallet": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
}
}),
});
const order = await response.json().catch(() => null);
if (!response.ok) {
throw new Error(order?.error ? order.error.code + ": " + order.error.message : "HTTP " + response.status);
}
// Send the customer to the hosted checkout (or embed checkout.embedUrl).
console.log(order.checkout.url);
```
**Python**
```python
import os
import requests
response = requests.post(
"https://api.payfiattocrypto.com/v1/orders",
headers={
"Authorization": f"Bearer {os.environ['PFC_API_KEY']}",
# One key per order, reused on every retry of that order.
"Idempotency-Key": "order-A-1001",
},
json={
"amount": "100.00",
"asset": {
"symbol": "USDC",
"network": "base"
},
"feeMode": "seller",
"sellerWallet": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"partnerFee": {
"rate": "0.01",
"wallet": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
}
},
timeout=30,
)
if not response.ok:
try:
error = response.json()["error"]
except (ValueError, KeyError):
response.raise_for_status()
raise RuntimeError(f"{error['code']}: {error['message']}")
order = response.json()
# Send the customer to the hosted checkout (or embed checkout.embedUrl).
print(order["checkout"]["url"])
```
**PHP**
```php
true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("PFC_API_KEY"),
"Content-Type: application/json",
// One key per order, reused on every retry of that order.
"Idempotency-Key: order-A-1001",
],
CURLOPT_POSTFIELDS => json_encode([
"amount" => "100.00",
"asset" => [
"symbol" => "USDC",
"network" => "base",
],
"feeMode" => "seller",
"sellerWallet" => "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"partnerFee" => [
"rate" => "0.01",
"wallet" => "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359",
],
"webhookUrl" => "https://example.com/webhooks/payfiattocrypto",
"metadata" => [
"orderRef" => "A-1001",
],
]),
CURLOPT_TIMEOUT => 30,
]);
$raw = curl_exec($ch);
if ($raw === false) {
// No answer: the order may exist. Retry with the same Idempotency-Key.
throw new RuntimeException("Network error: " . curl_error($ch));
}
$order = json_decode($raw, true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status >= 400) {
throw new RuntimeException(($order["error"]["code"] ?? "HTTP " . $status) . ": " . ($order["error"]["message"] ?? ""));
}
// Send the customer to the hosted checkout (or embed checkout.embedUrl).
echo $order["checkout"]["url"];
```
**Response · 201 Created**
```json
{
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"status": "created",
"deposit": {
"address": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb",
"amount": "100.000000",
"asset": {
"symbol": "USDC",
"network": "base",
"contractAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
},
"breakdown": {
"sellerReceives": "97.998000",
"platformFee": "1.000000",
"partnerFee": "1.000000",
"partnerReceives": "0.998000",
"networkFee": "0.004000"
},
"checkout": {
"token": "kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"url": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"embedUrl": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT?embed=1",
"feeMode": "seller"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
},
"createdAt": "2026-11-16T14:05:09.120Z"
}
```
**Example: Customer pays the fees**
**cURL**
```bash
curl "https://api.payfiattocrypto.com/v1/orders" \
-H "Authorization: Bearer $PFC_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-A-1002" \
-d '{
"amount": "100.00",
"asset": {
"symbol": "USDC",
"network": "base"
},
"sellerWallet": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"partnerFee": {
"rate": "0.01",
"wallet": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"
},
"feeMode": "customer"
}'
```
**JavaScript**
```javascript
const response = await fetch("https://api.payfiattocrypto.com/v1/orders", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PFC_API_KEY}`,
"Content-Type": "application/json",
// One key per order, reused on every retry of that order.
"Idempotency-Key": "order-A-1002",
},
body: JSON.stringify({
"amount": "100.00",
"asset": {
"symbol": "USDC",
"network": "base"
},
"sellerWallet": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"partnerFee": {
"rate": "0.01",
"wallet": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"
},
"feeMode": "customer"
}),
});
const order = await response.json().catch(() => null);
if (!response.ok) {
throw new Error(order?.error ? order.error.code + ": " + order.error.message : "HTTP " + response.status);
}
// Send the customer to the hosted checkout (or embed checkout.embedUrl).
console.log(order.checkout.url);
```
**Python**
```python
import os
import requests
response = requests.post(
"https://api.payfiattocrypto.com/v1/orders",
headers={
"Authorization": f"Bearer {os.environ['PFC_API_KEY']}",
# One key per order, reused on every retry of that order.
"Idempotency-Key": "order-A-1002",
},
json={
"amount": "100.00",
"asset": {
"symbol": "USDC",
"network": "base"
},
"sellerWallet": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"partnerFee": {
"rate": "0.01",
"wallet": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"
},
"feeMode": "customer"
},
timeout=30,
)
if not response.ok:
try:
error = response.json()["error"]
except (ValueError, KeyError):
response.raise_for_status()
raise RuntimeError(f"{error['code']}: {error['message']}")
order = response.json()
# Send the customer to the hosted checkout (or embed checkout.embedUrl).
print(order["checkout"]["url"])
```
**PHP**
```php
true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("PFC_API_KEY"),
"Content-Type: application/json",
// One key per order, reused on every retry of that order.
"Idempotency-Key: order-A-1002",
],
CURLOPT_POSTFIELDS => json_encode([
"amount" => "100.00",
"asset" => [
"symbol" => "USDC",
"network" => "base",
],
"sellerWallet" => "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"partnerFee" => [
"rate" => "0.01",
"wallet" => "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359",
],
"feeMode" => "customer",
]),
CURLOPT_TIMEOUT => 30,
]);
$raw = curl_exec($ch);
if ($raw === false) {
// No answer: the order may exist. Retry with the same Idempotency-Key.
throw new RuntimeException("Network error: " . curl_error($ch));
}
$order = json_decode($raw, true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status >= 400) {
throw new RuntimeException(($order["error"]["code"] ?? "HTTP " . $status) . ": " . ($order["error"]["message"] ?? ""));
}
// Send the customer to the hosted checkout (or embed checkout.embedUrl).
echo $order["checkout"]["url"];
```
**Response · 201 Created**
```json
{
"orderId": "5d0e8b13-27a4-4c6f-b9e1-8f3a2c7d4e60",
"status": "created",
"deposit": {
"address": "0xdDB1e7363870A65Cb0e5d7F40e725123401f8A75",
"amount": "102.042857",
"asset": {
"symbol": "USDC",
"network": "base",
"contractAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
},
"breakdown": {
"sellerReceives": "100.000000",
"platformFee": "1.020429",
"partnerFee": "1.020428",
"partnerReceives": "1.018428",
"networkFee": "0.004000"
},
"checkout": {
"token": "qdWjCHd2SVK86OL6kUVmfl3Crn1N58vh",
"url": "https://payfiattocrypto.com/c/qdWjCHd2SVK86OL6kUVmfl3Crn1N58vh",
"embedUrl": "https://payfiattocrypto.com/c/qdWjCHd2SVK86OL6kUVmfl3Crn1N58vh?embed=1",
"feeMode": "customer"
},
"createdAt": "2026-11-16T14:21:37.904Z"
}
```
**Example: Split payout**
**cURL**
```bash
curl "https://api.payfiattocrypto.com/v1/orders" \
-H "Authorization: Bearer $PFC_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-A-1003" \
-d '{
"amount": "250.00",
"asset": {
"symbol": "USDC",
"network": "base"
},
"feeMode": "seller",
"sellerRecipients": [
{
"wallet": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"share": "0.7"
},
{
"wallet": "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB",
"share": "0.3"
}
],
"partnerFee": {
"rate": "0.02",
"wallet": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"
}
}'
```
**JavaScript**
```javascript
const response = await fetch("https://api.payfiattocrypto.com/v1/orders", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PFC_API_KEY}`,
"Content-Type": "application/json",
// One key per order, reused on every retry of that order.
"Idempotency-Key": "order-A-1003",
},
body: JSON.stringify({
"amount": "250.00",
"asset": {
"symbol": "USDC",
"network": "base"
},
"feeMode": "seller",
"sellerRecipients": [
{
"wallet": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"share": "0.7"
},
{
"wallet": "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB",
"share": "0.3"
}
],
"partnerFee": {
"rate": "0.02",
"wallet": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"
}
}),
});
const order = await response.json().catch(() => null);
if (!response.ok) {
throw new Error(order?.error ? order.error.code + ": " + order.error.message : "HTTP " + response.status);
}
// Send the customer to the hosted checkout (or embed checkout.embedUrl).
console.log(order.checkout.url);
```
**Python**
```python
import os
import requests
response = requests.post(
"https://api.payfiattocrypto.com/v1/orders",
headers={
"Authorization": f"Bearer {os.environ['PFC_API_KEY']}",
# One key per order, reused on every retry of that order.
"Idempotency-Key": "order-A-1003",
},
json={
"amount": "250.00",
"asset": {
"symbol": "USDC",
"network": "base"
},
"feeMode": "seller",
"sellerRecipients": [
{
"wallet": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"share": "0.7"
},
{
"wallet": "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB",
"share": "0.3"
}
],
"partnerFee": {
"rate": "0.02",
"wallet": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"
}
},
timeout=30,
)
if not response.ok:
try:
error = response.json()["error"]
except (ValueError, KeyError):
response.raise_for_status()
raise RuntimeError(f"{error['code']}: {error['message']}")
order = response.json()
# Send the customer to the hosted checkout (or embed checkout.embedUrl).
print(order["checkout"]["url"])
```
**PHP**
```php
true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("PFC_API_KEY"),
"Content-Type: application/json",
// One key per order, reused on every retry of that order.
"Idempotency-Key: order-A-1003",
],
CURLOPT_POSTFIELDS => json_encode([
"amount" => "250.00",
"asset" => [
"symbol" => "USDC",
"network" => "base",
],
"feeMode" => "seller",
"sellerRecipients" => [
[
"wallet" => "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"share" => "0.7",
],
[
"wallet" => "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB",
"share" => "0.3",
],
],
"partnerFee" => [
"rate" => "0.02",
"wallet" => "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359",
],
]),
CURLOPT_TIMEOUT => 30,
]);
$raw = curl_exec($ch);
if ($raw === false) {
// No answer: the order may exist. Retry with the same Idempotency-Key.
throw new RuntimeException("Network error: " . curl_error($ch));
}
$order = json_decode($raw, true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status >= 400) {
throw new RuntimeException(($order["error"]["code"] ?? "HTTP " . $status) . ": " . ($order["error"]["message"] ?? ""));
}
// Send the customer to the hosted checkout (or embed checkout.embedUrl).
echo $order["checkout"]["url"];
```
**Response · 201 Created**
```json
{
"orderId": "5ef19228-38a2-4985-8835-4bd6585bde9b",
"status": "created",
"deposit": {
"address": "0x9115d945aEe713eE3CA1bCD67589e48428A37694",
"amount": "250.000000",
"asset": {
"symbol": "USDC",
"network": "base",
"contractAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
},
"breakdown": {
"sellerReceives": "242.496000",
"platformFee": "2.500000",
"partnerFee": "5.000000",
"partnerReceives": "4.998000",
"networkFee": "0.006000"
},
"checkout": {
"token": "xI8KuUH2kow847UEvl2eWGxxio5u9w9z",
"url": "https://payfiattocrypto.com/c/xI8KuUH2kow847UEvl2eWGxxio5u9w9z",
"embedUrl": "https://payfiattocrypto.com/c/xI8KuUH2kow847UEvl2eWGxxio5u9w9z?embed=1",
"feeMode": "seller"
},
"createdAt": "2026-11-16T14:33:02.471Z"
}
```
**Example: Checkout options**
**cURL**
```bash
curl "https://api.payfiattocrypto.com/v1/orders" \
-H "Authorization: Bearer $PFC_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-A-1004" \
-d '{
"amount": "100.00",
"asset": {
"symbol": "USDC",
"network": "base"
},
"sellerWallet": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"partnerFee": {
"rate": "0.01",
"wallet": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"
},
"feeMode": "customer",
"checkout": {
"payer": {
"currency": "EUR"
},
"returnUrl": "https://example.com/orders/A-1004"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto"
}'
```
**JavaScript**
```javascript
const response = await fetch("https://api.payfiattocrypto.com/v1/orders", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PFC_API_KEY}`,
"Content-Type": "application/json",
// One key per order, reused on every retry of that order.
"Idempotency-Key": "order-A-1004",
},
body: JSON.stringify({
"amount": "100.00",
"asset": {
"symbol": "USDC",
"network": "base"
},
"sellerWallet": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"partnerFee": {
"rate": "0.01",
"wallet": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"
},
"feeMode": "customer",
"checkout": {
"payer": {
"currency": "EUR"
},
"returnUrl": "https://example.com/orders/A-1004"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto"
}),
});
const order = await response.json().catch(() => null);
if (!response.ok) {
throw new Error(order?.error ? order.error.code + ": " + order.error.message : "HTTP " + response.status);
}
// Send the customer to the hosted checkout (or embed checkout.embedUrl).
console.log(order.checkout.url);
```
**Python**
```python
import os
import requests
response = requests.post(
"https://api.payfiattocrypto.com/v1/orders",
headers={
"Authorization": f"Bearer {os.environ['PFC_API_KEY']}",
# One key per order, reused on every retry of that order.
"Idempotency-Key": "order-A-1004",
},
json={
"amount": "100.00",
"asset": {
"symbol": "USDC",
"network": "base"
},
"sellerWallet": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"partnerFee": {
"rate": "0.01",
"wallet": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"
},
"feeMode": "customer",
"checkout": {
"payer": {
"currency": "EUR"
},
"returnUrl": "https://example.com/orders/A-1004"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto"
},
timeout=30,
)
if not response.ok:
try:
error = response.json()["error"]
except (ValueError, KeyError):
response.raise_for_status()
raise RuntimeError(f"{error['code']}: {error['message']}")
order = response.json()
# Send the customer to the hosted checkout (or embed checkout.embedUrl).
print(order["checkout"]["url"])
```
**PHP**
```php
true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("PFC_API_KEY"),
"Content-Type: application/json",
// One key per order, reused on every retry of that order.
"Idempotency-Key: order-A-1004",
],
CURLOPT_POSTFIELDS => json_encode([
"amount" => "100.00",
"asset" => [
"symbol" => "USDC",
"network" => "base",
],
"sellerWallet" => "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed",
"partnerFee" => [
"rate" => "0.01",
"wallet" => "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359",
],
"feeMode" => "customer",
"checkout" => [
"payer" => [
"currency" => "EUR",
],
"returnUrl" => "https://example.com/orders/A-1004",
],
"webhookUrl" => "https://example.com/webhooks/payfiattocrypto",
]),
CURLOPT_TIMEOUT => 30,
]);
$raw = curl_exec($ch);
if ($raw === false) {
// No answer: the order may exist. Retry with the same Idempotency-Key.
throw new RuntimeException("Network error: " . curl_error($ch));
}
$order = json_decode($raw, true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status >= 400) {
throw new RuntimeException(($order["error"]["code"] ?? "HTTP " . $status) . ": " . ($order["error"]["message"] ?? ""));
}
// Send the customer to the hosted checkout (or embed checkout.embedUrl).
echo $order["checkout"]["url"];
```
**Response · 201 Created**
```json
{
"orderId": "73c1c17f-659a-46cb-83bb-fb1ad9493527",
"status": "created",
"deposit": {
"address": "0x313A851457895669BF33710098FF4b41BcB03Fb8",
"amount": "102.042857",
"asset": {
"symbol": "USDC",
"network": "base",
"contractAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
},
"breakdown": {
"sellerReceives": "100.000000",
"platformFee": "1.020429",
"partnerFee": "1.020428",
"partnerReceives": "1.018428",
"networkFee": "0.004000"
},
"checkout": {
"token": "9YPipY-bnA2ZSkB7srGLI_ebb2qzxE99",
"url": "https://payfiattocrypto.com/c/9YPipY-bnA2ZSkB7srGLI_ebb2qzxE99",
"embedUrl": "https://payfiattocrypto.com/c/9YPipY-bnA2ZSkB7srGLI_ebb2qzxE99?embed=1",
"feeMode": "customer",
"payer": {
"currency": "EUR"
},
"returnUrl": "https://example.com/orders/A-1004"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"createdAt": "2026-11-16T14:40:55.318Z"
}
```
**Response fields**
- `orderId` (string · uuid, required): The order id. Use it in `GET /v1/orders/{orderId}`.
- `status` (string, required, one of `created`, `received`, `settling`, `settled`, `settle_failed`, `expired`): Current status. See [order lifecycle](https://payfiattocrypto.com/en/docs#lifecycle).
- `deposit` (object, required): The order's own wallet and how much must reach it.
- `address` (string · evm-address, required): The order's own wallet. Customers who pay in crypto send the stablecoin here; checkout payments are delivered here too. Never reused.
- `amount` (string · decimal, required): Exactly how much of the stablecoin must reach the order wallet. The fees in `breakdown` come out of it.
- `asset` (object, required): Stablecoin and network of the deposit and of every payout.
- `symbol` (string, required, one of `USDC`): Stablecoin symbol.
- `network` (string, required, one of `base`): Network the stablecoin travels on. See [supported assets](https://payfiattocrypto.com/en/docs#assets) for the valid pairs.
- `contractAddress` (string · evm-address, required): The token contract. Only transfers of this contract count as payment.
- `breakdown` (object, required): How the deposit is split: `sellerReceives` + `platformFee` + `partnerReceives` + `networkFee` = `deposit.amount`. See [fees](https://payfiattocrypto.com/en/docs#fees).
- `sellerReceives` (string · decimal, required): Net amount for the seller (all seller wallets together), after the network fee of the seller's own transfers.
- `platformFee` (string · decimal, required): Platform fee: 1% of `deposit.amount`.
- `partnerFee` (string · decimal, required): Your full commission: `partnerFee.rate` × `deposit.amount`. The network fee of your own transfers is paid out of it; what you actually receive is `partnerReceives`.
- `partnerReceives` (string · decimal, required): What your wallet(s) actually receive, all together: `partnerFee` minus the network fee of your own transfers, which is already counted in `networkFee`.
- `networkFee` (string · decimal, required): Network fee of every payout transfer on this order: the seller's and yours.
- `checkout` (object, optional): Only on orders that can be paid by card, bank or digital wallet (USDC on Base). See [checkout](https://payfiattocrypto.com/en/docs#checkout).
- `token` (string, required): Identifies the checkout. The hosted page and the widget use it; it only lets someone see the amount and pay.
- `url` (string · uri, required): The hosted checkout page. Send the customer to this exact URL. Always present when the order has a `checkout`.
- `embedUrl` (string · uri, required): The same page for an `iframe` on your site (widget). Always present when the order has a `checkout`.
- `feeMode` (string, required, one of `seller`, `customer`): Who pays the MDR: the order's `feeMode`.
- `payer` (object, optional): What you told us about the customer.
- `currency` (string, optional, one of `USD`, `EUR`): The currency the customer pays in: `USD` (the default) or `EUR`; lowercase is accepted. Anything else returns `400 INVALID_REQUEST`.
- `returnUrl` (string · uri, optional, up to 2048 characters): Optional. https URL of your site, used unchanged. The hosted page links back to it and, once the payment arrives, sends the customer there; the payment page is given it too. Not proof of payment. See [checkout options](https://payfiattocrypto.com/en/docs#checkout-options).
- `webhookUrl` (string · uri, optional): The `webhookUrl` sent when the order was created. Absent when none was sent.
- `metadata` (object, optional): The `metadata` sent when the order was created. Absent when none was sent.
- `parentOrderId` (string · uuid, optional): Only on a derived order: the order the customer paid again, or paid after it expired. See [derived orders](https://payfiattocrypto.com/en/docs#derived-orders).
- `createdAt` (string · date-time, required): Creation time, ISO 8601 in UTC. The order expires 7 days later, and card and bank payments close 12 hours before that.
**Response headers**
- `Idempotent-Replayed` (string, optional, one of `true`): `true` when this response repeats an order that an earlier request with the same `Idempotency-Key` and body created: nothing new was created. Absent on a newly created order. See [idempotency](https://payfiattocrypto.com/en/docs#idempotency).
**Errors:** [`INVALID_REQUEST`](https://payfiattocrypto.com/en/docs#error-invalid-request), [`INVALID_RECIPIENT_WALLET`](https://payfiattocrypto.com/en/docs#error-invalid-recipient-wallet), [`WALLET_CONFLICT`](https://payfiattocrypto.com/en/docs#error-wallet-conflict), [`PARTNER_PLATFORM_WALLET_CONFLICT`](https://payfiattocrypto.com/en/docs#error-partner-platform-wallet-conflict), [`INVALID_SHARES`](https://payfiattocrypto.com/en/docs#error-invalid-shares), [`RECIPIENT_AMOUNT_TOO_LOW`](https://payfiattocrypto.com/en/docs#error-recipient-amount-too-low), [`AMOUNT_TOO_LOW`](https://payfiattocrypto.com/en/docs#error-amount-too-low), [`PARTNER_FEE_BELOW_GAS`](https://payfiattocrypto.com/en/docs#error-partner-fee-below-gas), [`INVALID_FEE_RATE`](https://payfiattocrypto.com/en/docs#error-invalid-fee-rate), [`UNSUPPORTED_ASSET`](https://payfiattocrypto.com/en/docs#error-unsupported-asset), [`CHECKOUT_UNAVAILABLE`](https://payfiattocrypto.com/en/docs#error-checkout-unavailable), [`UNAUTHORIZED`](https://payfiattocrypto.com/en/docs#error-unauthorized), [`IDEMPOTENCY_KEY_REUSED`](https://payfiattocrypto.com/en/docs#error-idempotency-key-reused), [`REQUEST_IN_PROGRESS`](https://payfiattocrypto.com/en/docs#error-request-in-progress), [`RATE_LIMITED`](https://payfiattocrypto.com/en/docs#error-rate-limited), [`INTERNAL_ERROR`](https://payfiattocrypto.com/en/docs#error-internal-error). See [errors](https://payfiattocrypto.com/en/docs#errors).
### Retrieve an order
`GET https://api.payfiattocrypto.com/v1/orders/{orderId}` · requires an API key
Returns the order in the same shape as the creation response, with its current `status`. Use it to send the customer back to the checkout and to follow the payout.
An order that belongs to another account returns `404 ORDER_NOT_FOUND`, exactly like one that does not exist.
**Path parameters**
- `orderId` (string · uuid, required): The `orderId` returned at creation.
**Headers**
- `Authorization` (string, required): `Bearer `. See [authentication](https://payfiattocrypto.com/en/docs#authentication).
**cURL**
```bash
curl "https://api.payfiattocrypto.com/v1/orders/aa2c9fc7-0940-4060-9055-e7eaa97440a3" \
-H "Authorization: Bearer $PFC_API_KEY"
```
**JavaScript**
```javascript
const response = await fetch("https://api.payfiattocrypto.com/v1/orders/aa2c9fc7-0940-4060-9055-e7eaa97440a3", {
headers: { Authorization: `Bearer ${process.env.PFC_API_KEY}` },
});
const data = await response.json().catch(() => null);
if (!response.ok) {
throw new Error(data?.error ? data.error.code + ": " + data.error.message : "HTTP " + response.status);
}
```
**Python**
```python
import os
import requests
response = requests.get(
"https://api.payfiattocrypto.com/v1/orders/aa2c9fc7-0940-4060-9055-e7eaa97440a3",
headers={"Authorization": f"Bearer {os.environ['PFC_API_KEY']}"},
timeout=30,
)
if not response.ok:
try:
error = response.json()["error"]
except (ValueError, KeyError):
response.raise_for_status()
raise RuntimeError(f"{error['code']}: {error['message']}")
data = response.json()
```
**PHP**
```php
true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("PFC_API_KEY")],
CURLOPT_TIMEOUT => 30,
]);
$raw = curl_exec($ch);
if ($raw === false) {
throw new RuntimeException("Network error: " . curl_error($ch));
}
$data = json_decode($raw, true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status >= 400) {
throw new RuntimeException(($data["error"]["code"] ?? "HTTP " . $status) . ": " . ($data["error"]["message"] ?? ""));
}
```
**Response · 200 OK**
```json
{
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"status": "settled",
"deposit": {
"address": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb",
"amount": "100.000000",
"asset": {
"symbol": "USDC",
"network": "base",
"contractAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
},
"breakdown": {
"sellerReceives": "97.998000",
"platformFee": "1.000000",
"partnerFee": "1.000000",
"partnerReceives": "0.998000",
"networkFee": "0.004000"
},
"checkout": {
"token": "kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"url": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"embedUrl": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT?embed=1",
"feeMode": "seller"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
},
"createdAt": "2026-11-16T14:05:09.120Z"
}
```
**Response fields**
- `orderId` (string · uuid, required): The order id. Use it in `GET /v1/orders/{orderId}`.
- `status` (string, required, one of `created`, `received`, `settling`, `settled`, `settle_failed`, `expired`): Current status. See [order lifecycle](https://payfiattocrypto.com/en/docs#lifecycle).
- `deposit` (object, required): The order's own wallet and how much must reach it.
- `address` (string · evm-address, required): The order's own wallet. Customers who pay in crypto send the stablecoin here; checkout payments are delivered here too. Never reused.
- `amount` (string · decimal, required): Exactly how much of the stablecoin must reach the order wallet. The fees in `breakdown` come out of it.
- `asset` (object, required): Stablecoin and network of the deposit and of every payout.
- `symbol` (string, required, one of `USDC`): Stablecoin symbol.
- `network` (string, required, one of `base`): Network the stablecoin travels on. See [supported assets](https://payfiattocrypto.com/en/docs#assets) for the valid pairs.
- `contractAddress` (string · evm-address, required): The token contract. Only transfers of this contract count as payment.
- `breakdown` (object, required): How the deposit is split: `sellerReceives` + `platformFee` + `partnerReceives` + `networkFee` = `deposit.amount`. See [fees](https://payfiattocrypto.com/en/docs#fees).
- `sellerReceives` (string · decimal, required): Net amount for the seller (all seller wallets together), after the network fee of the seller's own transfers.
- `platformFee` (string · decimal, required): Platform fee: 1% of `deposit.amount`.
- `partnerFee` (string · decimal, required): Your full commission: `partnerFee.rate` × `deposit.amount`. The network fee of your own transfers is paid out of it; what you actually receive is `partnerReceives`.
- `partnerReceives` (string · decimal, required): What your wallet(s) actually receive, all together: `partnerFee` minus the network fee of your own transfers, which is already counted in `networkFee`.
- `networkFee` (string · decimal, required): Network fee of every payout transfer on this order: the seller's and yours.
- `checkout` (object, optional): Only on orders that can be paid by card, bank or digital wallet (USDC on Base). See [checkout](https://payfiattocrypto.com/en/docs#checkout).
- `token` (string, required): Identifies the checkout. The hosted page and the widget use it; it only lets someone see the amount and pay.
- `url` (string · uri, required): The hosted checkout page. Send the customer to this exact URL. Always present when the order has a `checkout`.
- `embedUrl` (string · uri, required): The same page for an `iframe` on your site (widget). Always present when the order has a `checkout`.
- `feeMode` (string, required, one of `seller`, `customer`): Who pays the MDR: the order's `feeMode`.
- `payer` (object, optional): What you told us about the customer.
- `currency` (string, optional, one of `USD`, `EUR`): The currency the customer pays in: `USD` (the default) or `EUR`; lowercase is accepted. Anything else returns `400 INVALID_REQUEST`.
- `returnUrl` (string · uri, optional, up to 2048 characters): Optional. https URL of your site, used unchanged. The hosted page links back to it and, once the payment arrives, sends the customer there; the payment page is given it too. Not proof of payment. See [checkout options](https://payfiattocrypto.com/en/docs#checkout-options).
- `webhookUrl` (string · uri, optional): The `webhookUrl` sent when the order was created. Absent when none was sent.
- `metadata` (object, optional): The `metadata` sent when the order was created. Absent when none was sent.
- `parentOrderId` (string · uuid, optional): Only on a derived order: the order the customer paid again, or paid after it expired. See [derived orders](https://payfiattocrypto.com/en/docs#derived-orders).
- `createdAt` (string · date-time, required): Creation time, ISO 8601 in UTC. The order expires 7 days later, and card and bank payments close 12 hours before that.
**Errors:** [`UNAUTHORIZED`](https://payfiattocrypto.com/en/docs#error-unauthorized), [`ORDER_NOT_FOUND`](https://payfiattocrypto.com/en/docs#error-order-not-found), [`RATE_LIMITED`](https://payfiattocrypto.com/en/docs#error-rate-limited), [`INTERNAL_ERROR`](https://payfiattocrypto.com/en/docs#error-internal-error). See [errors](https://payfiattocrypto.com/en/docs#errors).
### List orders
`GET https://api.payfiattocrypto.com/v1/orders` · requires an API key
Lists the orders created with your account's keys, newest first. Filter by status and creation time, and page with `cursor`. See [pagination](https://payfiattocrypto.com/en/docs#pagination).
Any invalid or unknown query parameter returns `400 INVALID_REQUEST`.
**Query parameters**
- `status` (string, optional, one of `created`, `received`, `settling`, `settled`, `settle_failed`, `expired`): Only orders in this status.
- `from` (string · date-time, optional): Created at or after this time. ISO 8601 with a time zone, for example `2026-11-01T00:00:00-03:00`.
- `to` (string · date-time, optional): Created at or before this time, with a time zone. `from` must not be after `to`.
- `limit` (integer, optional, 1–100, default `30`): Page size.
- `cursor` (string, optional, up to 512 characters): The `nextCursor` of the previous page, unchanged.
**Headers**
- `Authorization` (string, required): `Bearer `. See [authentication](https://payfiattocrypto.com/en/docs#authentication).
**cURL**
```bash
curl "https://api.payfiattocrypto.com/v1/orders?status=settled&limit=50" \
-H "Authorization: Bearer $PFC_API_KEY"
```
**JavaScript**
```javascript
const response = await fetch("https://api.payfiattocrypto.com/v1/orders?status=settled&limit=50", {
headers: { Authorization: `Bearer ${process.env.PFC_API_KEY}` },
});
const data = await response.json().catch(() => null);
if (!response.ok) {
throw new Error(data?.error ? data.error.code + ": " + data.error.message : "HTTP " + response.status);
}
```
**Python**
```python
import os
import requests
response = requests.get(
"https://api.payfiattocrypto.com/v1/orders?status=settled&limit=50",
headers={"Authorization": f"Bearer {os.environ['PFC_API_KEY']}"},
timeout=30,
)
if not response.ok:
try:
error = response.json()["error"]
except (ValueError, KeyError):
response.raise_for_status()
raise RuntimeError(f"{error['code']}: {error['message']}")
data = response.json()
```
**PHP**
```php
true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("PFC_API_KEY")],
CURLOPT_TIMEOUT => 30,
]);
$raw = curl_exec($ch);
if ($raw === false) {
throw new RuntimeException("Network error: " . curl_error($ch));
}
$data = json_decode($raw, true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status >= 400) {
throw new RuntimeException(($data["error"]["code"] ?? "HTTP " . $status) . ": " . ($data["error"]["message"] ?? ""));
}
```
**Response · 200 OK**
```json
{
"orders": [
{
"orderId": "aa2c9fc7-0940-4060-9055-e7eaa97440a3",
"status": "settled",
"deposit": {
"address": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb",
"amount": "100.000000",
"asset": {
"symbol": "USDC",
"network": "base",
"contractAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
},
"breakdown": {
"sellerReceives": "97.998000",
"platformFee": "1.000000",
"partnerFee": "1.000000",
"partnerReceives": "0.998000",
"networkFee": "0.004000"
},
"checkout": {
"token": "kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"url": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT",
"embedUrl": "https://payfiattocrypto.com/c/kV7pQ2mX9aB4cD6eF8gH0jK1lN3oR5sT?embed=1",
"feeMode": "seller"
},
"webhookUrl": "https://example.com/webhooks/payfiattocrypto",
"metadata": {
"orderRef": "A-1001"
},
"createdAt": "2026-11-16T14:05:09.120Z"
}
],
"nextCursor": "eyJjIjoiMjAyNi0xMS0xNlQxNDowNTowOS4xMjBaIiwiaSI6ImFhMmM5ZmM3In0"
}
```
**Response fields**
- `orders` (array of objects, required): Orders on this page.
- `orderId` (string · uuid, required): The order id. Use it in `GET /v1/orders/{orderId}`.
- `status` (string, required, one of `created`, `received`, `settling`, `settled`, `settle_failed`, `expired`): Current status. See [order lifecycle](https://payfiattocrypto.com/en/docs#lifecycle).
- `deposit` (object, required): The order's own wallet and how much must reach it.
- `address` (string · evm-address, required): The order's own wallet. Customers who pay in crypto send the stablecoin here; checkout payments are delivered here too. Never reused.
- `amount` (string · decimal, required): Exactly how much of the stablecoin must reach the order wallet. The fees in `breakdown` come out of it.
- `asset` (object, required): Stablecoin and network of the deposit and of every payout.
- `symbol` (string, required, one of `USDC`): Stablecoin symbol.
- `network` (string, required, one of `base`): Network the stablecoin travels on. See [supported assets](https://payfiattocrypto.com/en/docs#assets) for the valid pairs.
- `contractAddress` (string · evm-address, required): The token contract. Only transfers of this contract count as payment.
- `breakdown` (object, required): How the deposit is split: `sellerReceives` + `platformFee` + `partnerReceives` + `networkFee` = `deposit.amount`. See [fees](https://payfiattocrypto.com/en/docs#fees).
- `sellerReceives` (string · decimal, required): Net amount for the seller (all seller wallets together), after the network fee of the seller's own transfers.
- `platformFee` (string · decimal, required): Platform fee: 1% of `deposit.amount`.
- `partnerFee` (string · decimal, required): Your full commission: `partnerFee.rate` × `deposit.amount`. The network fee of your own transfers is paid out of it; what you actually receive is `partnerReceives`.
- `partnerReceives` (string · decimal, required): What your wallet(s) actually receive, all together: `partnerFee` minus the network fee of your own transfers, which is already counted in `networkFee`.
- `networkFee` (string · decimal, required): Network fee of every payout transfer on this order: the seller's and yours.
- `checkout` (object, optional): Only on orders that can be paid by card, bank or digital wallet (USDC on Base). See [checkout](https://payfiattocrypto.com/en/docs#checkout).
- `token` (string, required): Identifies the checkout. The hosted page and the widget use it; it only lets someone see the amount and pay.
- `url` (string · uri, required): The hosted checkout page. Send the customer to this exact URL. Always present when the order has a `checkout`.
- `embedUrl` (string · uri, required): The same page for an `iframe` on your site (widget). Always present when the order has a `checkout`.
- `feeMode` (string, required, one of `seller`, `customer`): Who pays the MDR: the order's `feeMode`.
- `payer` (object, optional): What you told us about the customer.
- `currency` (string, optional, one of `USD`, `EUR`): The currency the customer pays in: `USD` (the default) or `EUR`; lowercase is accepted. Anything else returns `400 INVALID_REQUEST`.
- `returnUrl` (string · uri, optional, up to 2048 characters): Optional. https URL of your site, used unchanged. The hosted page links back to it and, once the payment arrives, sends the customer there; the payment page is given it too. Not proof of payment. See [checkout options](https://payfiattocrypto.com/en/docs#checkout-options).
- `webhookUrl` (string · uri, optional): The `webhookUrl` sent when the order was created. Absent when none was sent.
- `metadata` (object, optional): The `metadata` sent when the order was created. Absent when none was sent.
- `parentOrderId` (string · uuid, optional): Only on a derived order: the order the customer paid again, or paid after it expired. See [derived orders](https://payfiattocrypto.com/en/docs#derived-orders).
- `createdAt` (string · date-time, required): Creation time, ISO 8601 in UTC. The order expires 7 days later, and card and bank payments close 12 hours before that.
- `nextCursor` (string, optional): Opaque cursor for the next page. Absent on the last page.
**Errors:** [`INVALID_REQUEST`](https://payfiattocrypto.com/en/docs#error-invalid-request), [`UNAUTHORIZED`](https://payfiattocrypto.com/en/docs#error-unauthorized), [`RATE_LIMITED`](https://payfiattocrypto.com/en/docs#error-rate-limited), [`INTERNAL_ERROR`](https://payfiattocrypto.com/en/docs#error-internal-error). See [errors](https://payfiattocrypto.com/en/docs#errors).
### Get the checkout offer
`GET https://api.payfiattocrypto.com/v1/orders/{orderId}/checkout/offers` · requires an API key
Returns what the customer pays for this order in `USD` or `EUR`, split into the order's amount, the service fee and the card processor's fee (`0.00` today). Without `currency`, the order's `checkout.payer.currency` is used, or `USD`.
There is one offer, or none when the amount is below the minimum (US$ 10): an empty list, not an error. The amount is calculated when you ask, with the current exchange rate.
The offer does not say whether a payment is already on its way: it still returns a price while one is being confirmed. From 12 hours before the order expires, it returns `409 ORDER_NOT_PAYABLE`.
The example is an order in `customer` mode with `amount` 100.00 and `deposit.amount` 102.042857: `orderAmount` is the `amount`, and the platform fee, your commission and the network fee are in `serviceFee`.
**Path parameters**
- `orderId` (string · uuid, required): The `orderId` returned at creation.
**Query parameters**
- `currency` (string, optional, one of `USD`, `EUR`): Currency the customer pays in: `USD` or `EUR`, in any case. Without it, the order's `checkout.payer.currency`, or `USD`. Another three-letter code returns `422 CURRENCY_NOT_SUPPORTED`.
**Headers**
- `Authorization` (string, required): `Bearer `. See [authentication](https://payfiattocrypto.com/en/docs#authentication).
**cURL**
```bash
curl "https://api.payfiattocrypto.com/v1/orders/5d0e8b13-27a4-4c6f-b9e1-8f3a2c7d4e60/checkout/offers?currency=USD" \
-H "Authorization: Bearer $PFC_API_KEY"
```
**JavaScript**
```javascript
const response = await fetch("https://api.payfiattocrypto.com/v1/orders/5d0e8b13-27a4-4c6f-b9e1-8f3a2c7d4e60/checkout/offers?currency=USD", {
headers: { Authorization: `Bearer ${process.env.PFC_API_KEY}` },
});
const data = await response.json().catch(() => null);
if (!response.ok) {
throw new Error(data?.error ? data.error.code + ": " + data.error.message : "HTTP " + response.status);
}
```
**Python**
```python
import os
import requests
response = requests.get(
"https://api.payfiattocrypto.com/v1/orders/5d0e8b13-27a4-4c6f-b9e1-8f3a2c7d4e60/checkout/offers?currency=USD",
headers={"Authorization": f"Bearer {os.environ['PFC_API_KEY']}"},
timeout=30,
)
if not response.ok:
try:
error = response.json()["error"]
except (ValueError, KeyError):
response.raise_for_status()
raise RuntimeError(f"{error['code']}: {error['message']}")
data = response.json()
```
**PHP**
```php
true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("PFC_API_KEY")],
CURLOPT_TIMEOUT => 30,
]);
$raw = curl_exec($ch);
if ($raw === false) {
throw new RuntimeException("Network error: " . curl_error($ch));
}
$data = json_decode($raw, true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status >= 400) {
throw new RuntimeException(($data["error"]["code"] ?? "HTTP " . $status) . ": " . ($data["error"]["message"] ?? ""));
}
```
**Response · 200 OK**
```json
{
"currency": "USD",
"offers": [
{
"amount": "109.91",
"currency": "USD",
"orderAmount": "100.00",
"fee": "9.91",
"serviceFee": "9.91",
"processorFee": "0.00"
}
]
}
```
**Response fields**
- `currency` (string, required, one of `USD`, `EUR`): The currency of every amount.
- `offers` (array of objects, required): The offer: one, or none when the amount is below the minimum.
- `amount` (string · decimal, required): What the customer pays, in `currency`.
- `currency` (string, required, one of `USD`, `EUR`): Currency of `amount`.
- `orderAmount` (string · decimal, required): The order as you created it: its `amount`, in the customer's currency, rounded to the cent. Not `deposit.amount`: in `customer` mode the platform fee, your commission and the network fee are in `serviceFee`.
- `fee` (string · decimal, required): All the fees the customer covers: `serviceFee` + `processorFee` = `amount` − `orderAmount`. `0.00` when the order's `feeMode` is `seller`.
- `serviceFee` (string · decimal, required): The service fee: the platform fee, your commission and the network fee, together with the processing fee (the payment provider's MDR, 6.70% + US$ 0.50). `0.00` when the order's `feeMode` is `seller`.
- `processorFee` (string · decimal, required): The card processor's fee: `0.00` today, in either fee mode. The processor is chosen for each payment and its fee is not known in advance, so it is not in the price; when the processor deducts a fee from what it delivers, less reaches the order wallet and the payout is [proportional](https://payfiattocrypto.com/en/docs#amount-differences).
**Errors:** [`INVALID_REQUEST`](https://payfiattocrypto.com/en/docs#error-invalid-request), [`UNAUTHORIZED`](https://payfiattocrypto.com/en/docs#error-unauthorized), [`ORDER_NOT_FOUND`](https://payfiattocrypto.com/en/docs#error-order-not-found), [`ORDER_NOT_PAYABLE`](https://payfiattocrypto.com/en/docs#error-order-not-payable), [`CURRENCY_NOT_SUPPORTED`](https://payfiattocrypto.com/en/docs#error-currency-not-supported), [`RATE_LIMITED`](https://payfiattocrypto.com/en/docs#error-rate-limited), [`EXCHANGE_RATE_UNAVAILABLE`](https://payfiattocrypto.com/en/docs#error-exchange-rate-unavailable), [`INTERNAL_ERROR`](https://payfiattocrypto.com/en/docs#error-internal-error). See [errors](https://payfiattocrypto.com/en/docs#errors).
### Create a ready link
`POST https://api.payfiattocrypto.com/v1/orders/{orderId}/checkout` · requires an API key
Checks that the order can be paid, calculates what the customer pays (in `currency`, or the order's default) and returns `url`: a link to our page in "pay now" mode. Send it to the customer by email, chat or a button. When the order can be paid, it takes the customer straight to the payment page; otherwise it shows the order's state: a payment in progress, already paid, or expired.
The call opens nothing: the payment opens when the customer opens the link, with the exchange rate of that moment (in USD, the same amount). Call it as often as you need; for a given currency the link is always the same. Once a payment is approved, it returns `409 PAYMENT_IN_PROGRESS`.
The body is optional: no body, an empty body (even with `Content-Type: application/json`) and `{}` all mean the order's currency, `checkout.payer.currency` or `USD`; send `{"currency": "EUR"}` to choose. The answer is `201` even though nothing is created.
The example continues the order in the [offers](https://payfiattocrypto.com/en/docs/reference#get-checkout-offers) example.
**Path parameters**
- `orderId` (string · uuid, required): The `orderId` returned at creation.
**Headers**
- `Authorization` (string, required): `Bearer `. See [authentication](https://payfiattocrypto.com/en/docs#authentication).
**Request body**
- `currency` (string, optional, one of `USD`, `EUR`): Currency the customer pays in: `USD` or `EUR`, in any case. Without it, the order's `checkout.payer.currency`, or `USD`. Another three-letter code returns `422 CURRENCY_NOT_SUPPORTED`.
**cURL**
```bash
curl "https://api.payfiattocrypto.com/v1/orders/5d0e8b13-27a4-4c6f-b9e1-8f3a2c7d4e60/checkout" \
-H "Authorization: Bearer $PFC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"currency": "USD"
}'
```
**JavaScript**
```javascript
const response = await fetch("https://api.payfiattocrypto.com/v1/orders/5d0e8b13-27a4-4c6f-b9e1-8f3a2c7d4e60/checkout", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PFC_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"currency": "USD"
}),
});
const data = await response.json().catch(() => null);
if (!response.ok) {
throw new Error(data?.error ? data.error.code + ": " + data.error.message : "HTTP " + response.status);
}
```
**Python**
```python
import os
import requests
response = requests.post(
"https://api.payfiattocrypto.com/v1/orders/5d0e8b13-27a4-4c6f-b9e1-8f3a2c7d4e60/checkout",
headers={"Authorization": f"Bearer {os.environ['PFC_API_KEY']}"},
json={
"currency": "USD"
},
timeout=30,
)
if not response.ok:
try:
error = response.json()["error"]
except (ValueError, KeyError):
response.raise_for_status()
raise RuntimeError(f"{error['code']}: {error['message']}")
data = response.json()
```
**PHP**
```php
true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("PFC_API_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"currency" => "USD",
]),
CURLOPT_TIMEOUT => 30,
]);
$raw = curl_exec($ch);
if ($raw === false) {
throw new RuntimeException("Network error: " . curl_error($ch));
}
$data = json_decode($raw, true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status >= 400) {
throw new RuntimeException(($data["error"]["code"] ?? "HTTP " . $status) . ": " . ($data["error"]["message"] ?? ""));
}
```
**Response · 201 Created**
```json
{
"url": "https://payfiattocrypto.com/c/qdWjCHd2SVK86OL6kUVmfl3Crn1N58vh?pay=USD",
"amount": "109.91",
"currency": "USD",
"orderAmount": "100.00",
"fee": "9.91",
"serviceFee": "9.91",
"processorFee": "0.00"
}
```
**Response fields**
- `url` (string · uri, required): The ready link: our page in "pay now" mode. Send the customer to this exact URL; it stays the same for this order and currency.
- `amount` (string · decimal, required): What the customer pays, in `currency`.
- `currency` (string, required, one of `USD`, `EUR`): Currency of `amount`.
- `orderAmount` (string · decimal, required): The order as you created it: its `amount`, in the customer's currency, rounded to the cent. Not `deposit.amount`: in `customer` mode the platform fee, your commission and the network fee are in `serviceFee`.
- `fee` (string · decimal, required): All the fees the customer covers: `serviceFee` + `processorFee` = `amount` − `orderAmount`. `0.00` when the order's `feeMode` is `seller`.
- `serviceFee` (string · decimal, required): The service fee: the platform fee, your commission and the network fee, together with the processing fee (the payment provider's MDR, 6.70% + US$ 0.50). `0.00` when the order's `feeMode` is `seller`.
- `processorFee` (string · decimal, required): The card processor's fee: `0.00` today, in either fee mode. The processor is chosen for each payment and its fee is not known in advance, so it is not in the price; when the processor deducts a fee from what it delivers, less reaches the order wallet and the payout is [proportional](https://payfiattocrypto.com/en/docs#amount-differences).
**Errors:** [`INVALID_REQUEST`](https://payfiattocrypto.com/en/docs#error-invalid-request), [`UNAUTHORIZED`](https://payfiattocrypto.com/en/docs#error-unauthorized), [`ORDER_NOT_FOUND`](https://payfiattocrypto.com/en/docs#error-order-not-found), [`ORDER_NOT_PAYABLE`](https://payfiattocrypto.com/en/docs#error-order-not-payable), [`PAYMENT_IN_PROGRESS`](https://payfiattocrypto.com/en/docs#error-payment-in-progress), [`CURRENCY_NOT_SUPPORTED`](https://payfiattocrypto.com/en/docs#error-currency-not-supported), [`AMOUNT_BELOW_MINIMUM`](https://payfiattocrypto.com/en/docs#error-amount-below-minimum), [`RATE_LIMITED`](https://payfiattocrypto.com/en/docs#error-rate-limited), [`EXCHANGE_RATE_UNAVAILABLE`](https://payfiattocrypto.com/en/docs#error-exchange-rate-unavailable), [`INTERNAL_ERROR`](https://payfiattocrypto.com/en/docs#error-internal-error). See [errors](https://payfiattocrypto.com/en/docs#errors).
## Postman, Insomnia and generated clients
Every endpoint, field, example and error is in the OpenAPI 3.1 file at [https://payfiattocrypto.com/openapi.json](https://payfiattocrypto.com/openapi.json). Import it instead of typing requests by hand:
- **Postman:** choose **Import**, paste the URL above, and keep the generated collection. Set its authorization to **Bearer Token** with your API key.
- **Insomnia, Bruno and Hoppscotch** import the same URL as an OpenAPI document.
- **Generated clients:** OpenAPI Generator, `openapi-typescript` and similar tools read the same file and produce typed code for your language.
- Some rules are only in the field descriptions, because generators drop them: exactly one of `sellerWallet` and `sellerRecipients` (and of `partnerFee.wallet` and `partnerFee.recipients`), the size of `metadata` and the host rules of `webhookUrl`.
- Import the file again when the date at the end of these pages changes: it always matches the API as built.
## For AI agents and LLMs
This documentation is published in formats that AI assistants and coding agents can read directly:
| Resource | URL | Contents |
| --- | --- | --- |
| llms.txt | [https://payfiattocrypto.com/llms.txt](https://payfiattocrypto.com/llms.txt) | Short index of the API and its documentation. |
| llms-full.txt | [https://payfiattocrypto.com/llms-full.txt](https://payfiattocrypto.com/llms-full.txt) | The entire documentation as Markdown, in one file. |
| OpenAPI 3.1 | [https://payfiattocrypto.com/openapi.json](https://payfiattocrypto.com/openapi.json) | Machine-readable contract: every endpoint, field and error. |
**Prompt for your AI assistant**
```text
Read https://payfiattocrypto.com/llms-full.txt and https://payfiattocrypto.com/openapi.json, then help me integrate the Pay Fiat to Crypto API into my project. Use only the endpoints and fields documented there.
```
Rules for agents that write an integration:
- Use only the documented endpoints and fields. Unknown fields are rejected.
- Send money as decimal strings, and send an `Idempotency-Key` on every `POST /v1/orders`, reused on retries.
- Keep the API key in server-side configuration; never hard-code it or send it to a browser.
- Copy wallet addresses exactly, preserving upper and lower case. Never lowercase them.
- Treat a payment as arrived only when the status read from the API is `received`, `settling`, `settled` or `settle_failed`; at `received`, what arrived can be less than `deposit.amount`.
- Send the customer only to the `checkout.url`, `checkout.embedUrl` or ready link `url` the API returns; never build one yourself.
- Offer card or bank payment only for orders that come with a `checkout` (USDC on Base), in `USD` or `EUR`.
- Verify the signature of every webhook, store each event id once, respond 2xx quickly, and act on the order's current status read with `GET /v1/orders/{orderId}`.