# Mayarin API

Version: `2026-08-11`

Create fiat-denominated commerce requests, accept supported crypto assets, and settle merchants in stablecoins. Versioned operations live under `/v1`; buyer-facing checkout, invoice, and health routes are intentionally unversioned.

## Servers

- `https://api.mayarin.xyz`: Mainnet
- `https://api-testnet.mayarin.xyz`: Testnet
- `http://localhost:3000`: Local development

## Endpoints

### Payment intents

Immutable requests for payment.

- [`GET /v1/payment-intents`](/api-reference/payment-intents#listpaymentintents): List payment intents
- [`POST /v1/payment-intents`](/api-reference/payment-intents#createpaymentintent): Create a payment intent
- [`POST /v1/payment-intents/validate`](/api-reference/payment-intents#validatepaymentintent): Validate a payment intent
- [`GET /v1/rails`](/api-reference/payment-intents#listrails): List the rails a merchant is paid on
- [`GET /v1/payment-intents/{id}`](/api-reference/payment-intents#getpaymentintent): Get a payment intent
- [`POST /v1/payment-intents/{id}/confirm`](/api-reference/payment-intents#confirmpaymentintent): Confirm a payment intent
- [`POST /v1/payment-intents/{id}/cancel`](/api-reference/payment-intents#cancelpaymentintent): Cancel a payment intent
- [`POST /v1/payment-intents/{id}/simulate-deposit`](/api-reference/payment-intents#simulatepaymentintentdeposit): Simulate a deposit (testnet only)

### Payments

Clearing status, execution, and refunds.

- [`GET /v1/payments/stream`](/api-reference/payments#streampayments): Stream finished payments
- [`GET /v1/payments/{id}`](/api-reference/payments#getpayment): Get payment status
- [`POST /v1/payments/{id}/retry`](/api-reference/payments#retrypayment): Retry a failed payment whose funds arrived
- [`GET /v1/payments/{id}/invoice.pdf`](/api-reference/payments#getpaymentinvoicepdf): Download the payment's invoice
- [`GET /v1/payments/{id}/receipt.pdf`](/api-reference/payments#getpaymentreceiptpdf): Download the payment's receipt
- [`GET /v1/payments/{id}/contract-call`](/api-reference/payments#getpaymentcontractcall): Get fresh contract call data
- [`GET /v1/payments/{id}/escrow`](/api-reference/payments#getpaymentescrow): Get an escrowed payment's hold
- [`GET /v1/payments/{id}/refunds`](/api-reference/payments#listpaymentrefunds): List refunds for a payment
- [`POST /v1/payments/{id}/refunds`](/api-reference/payments#createpaymentrefund): Create a refund

### Quotes

Payer-asset previews and guarded pricing.

- [`POST /v1/quotes`](/api-reference/quotes#createquote): Preview payer-asset quotes

### Catalog

Merchant products and cart checkout.

- [`GET /v1/catalog/products`](/api-reference/catalog#listproducts): List catalog products
- [`POST /v1/catalog/products`](/api-reference/catalog#createproduct): Create a product
- [`GET /v1/catalog/products/{id}`](/api-reference/catalog#getproduct): Get a product
- [`PATCH /v1/catalog/products/{id}`](/api-reference/catalog#updateproduct): Update a product
- [`POST /v1/carts/checkout`](/api-reference/catalog#checkoutcart): Check out a cart

### Payment links

Shareable hosted checkout links.

- [`GET /v1/payment-links`](/api-reference/payment-links#listpaymentlinks): List payment links
- [`POST /v1/payment-links`](/api-reference/payment-links#createpaymentlink): Create a payment link
- [`GET /v1/payment-links/{id}`](/api-reference/payment-links#getpaymentlink): Get a payment link
- [`POST /v1/payment-links/{id}/disable`](/api-reference/payment-links#disablepaymentlink): Disable a payment link
- [`POST /v1/payment-links/{id}/list`](/api-reference/payment-links#listpaymentlink): List a payment link in the public payable index
- [`POST /v1/payment-links/{id}/unlist`](/api-reference/payment-links#unlistpaymentlink): Remove a payment link from the public payable index
- [`POST /v1/payment-links/{id}/checkout`](/api-reference/payment-links#checkoutpaymentlink): Check out a payment link

### Invoices

Numbered requests with buyers and due dates.

- [`GET /v1/invoices`](/api-reference/invoices#listinvoices): List invoices
- [`POST /v1/invoices`](/api-reference/invoices#createinvoice): Create a draft invoice
- [`GET /v1/invoices/{id}`](/api-reference/invoices#getinvoice): Get an invoice
- [`PATCH /v1/invoices/{id}`](/api-reference/invoices#updateinvoice): Update a draft invoice
- [`POST /v1/invoices/{id}/issue`](/api-reference/invoices#issueinvoice): Issue an invoice
- [`POST /v1/invoices/{id}/void`](/api-reference/invoices#voidinvoice): Void an invoice
- [`POST /v1/invoices/{id}/list`](/api-reference/invoices#listinvoice): List an invoice in the public payable index
- [`POST /v1/invoices/{id}/unlist`](/api-reference/invoices#unlistinvoice): Remove an invoice from the public payable index
- [`POST /v1/invoices/{id}/checkout`](/api-reference/invoices#checkoutinvoice): Check out an issued invoice

### Subscriptions

Recurring plans, billed as one invoice per cycle.

- [`GET /v1/subscriptions`](/api-reference/subscriptions#listsubscriptions): List subscriptions
- [`POST /v1/subscriptions`](/api-reference/subscriptions#createsubscription): Create a subscription
- [`GET /v1/subscriptions/{id}`](/api-reference/subscriptions#getsubscription): Get a subscription and its cycles
- [`POST /v1/subscriptions/{id}/pause`](/api-reference/subscriptions#pausesubscription): Pause a subscription
- [`POST /v1/subscriptions/{id}/resume`](/api-reference/subscriptions#resumesubscription): Resume a subscription
- [`POST /v1/subscriptions/{id}/cancel`](/api-reference/subscriptions#cancelsubscription): Cancel a subscription

### Analytics

Revenue, orders, settlements and payment performance for a date range.

- [`GET /v1/analytics`](/api-reference/analytics#getanalytics): Get analytics

### Risk

Payments the fraud rules flagged or blocked.

- [`GET /v1/risk/flags`](/api-reference/risk#listriskflags): List flagged payments

### Disputes

Disputes buyers open on escrowed payments: read the thread, answer it.

- [`GET /v1/disputes`](/api-reference/disputes#listdisputes): List disputes
- [`GET /v1/disputes/{id}`](/api-reference/disputes#getdispute): Get a dispute and its thread
- [`POST /v1/disputes/{id}/messages`](/api-reference/disputes#replytodispute): Answer in a dispute

### x402 resources

Per-call resources an agent pays for over the x402 rail.

- [`GET /v1/x402/resources`](/api-reference/x402-resources#listx402resources): List your registered resources
- [`POST /v1/x402/resources`](/api-reference/x402-resources#registerx402resource): Register a resource
- [`DELETE /v1/x402/resources/{id}`](/api-reference/x402-resources#removex402resource): Remove a resource
- [`POST /v1/x402/resources/{id}/list`](/api-reference/x402-resources#listx402resource): List a resource in the public index
- [`POST /v1/x402/resources/{id}/unlist`](/api-reference/x402-resources#unlistx402resource): Remove a resource from the public index

### x402

The payer-facing facilitator surface: public, unversioned, keyless. Quote, verify, settle.

- [`GET /x402/resources`](/api-reference/x402#discoverx402resources): What is for sale, across every merchant
- [`GET /x402/payables`](/api-reference/x402#listx402payables): Every listed obligation an agent can pay
- [`GET /x402/payables/{kind}/{id}`](/api-reference/x402#payx402payable): Quote one invoice or link — or settle it
- [`GET /x402/resources/{id}/rail`](/api-reference/x402#getx402rail): Which rail to pay on, and why
- [`GET /x402/resources/{id}/payment-required`](/api-reference/x402#getx402paymentrequired): Quote a resource without calling it
- [`POST /x402/resources/{id}/verify`](/api-reference/x402#verifyx402payment): Would this authorization go through?
- [`POST /x402/resources/{id}/settle`](/api-reference/x402#settlex402payment): Broadcast it, and credit the merchant

### Webhooks

Provider signals into Mayarin.

- [`POST /v1/webhooks/{provider}`](/api-reference/webhooks#receiveproviderwebhook): Receive a provider webhook

### Unversioned

Buyer-facing routes that stay at the root forever. A printed QR and a shared link encode them, so a version bump must never move them.

- [`GET /health`](/api-reference/unversioned#gethealth): Deployment health probe
- [`GET /checkout/{id}`](/api-reference/unversioned#getcheckoutpage): Hosted checkout page
- [`GET /checkout/pay/{intentId}`](/api-reference/unversioned#getcheckoutpaypage): Hosted pay page for one intent
- [`GET /checkout/qr`](/api-reference/unversioned#getcheckoutqr): Render a QR as SVG
- [`GET /checkout/events/{intentId}`](/api-reference/unversioned#getcheckoutevents): Live payment status stream
- [`GET /invoices/{id}/view`](/api-reference/unversioned#getinvoiceviewpage): Hosted invoice page

### Platform

- [`GET /v1/platform/merchants`](/api-reference/platform#listplatformmerchants): List your merchants
- [`POST /v1/platform/merchants`](/api-reference/platform#createplatformmerchant): Create a merchant
- [`GET /v1/platform/merchants/{id}`](/api-reference/platform#getplatformmerchant): Get a merchant
- [`PATCH /v1/platform/merchants/{id}`](/api-reference/platform#updateplatformmerchant): Update a merchant
- [`GET /v1/platform/merchants/{id}/keys`](/api-reference/platform#listplatformmerchantkeys): List a merchant's keys
- [`POST /v1/platform/merchants/{id}/keys`](/api-reference/platform#createplatformmerchantkey): Mint a key for a merchant
- [`POST /v1/platform/merchants/{id}/keys/{keyId}/deactivate`](/api-reference/platform#deactivateplatformmerchantkey): Deactivate a merchant's key
