API reference

Base URL https://app.satsrail.com. Merchant endpoints, under /api/v1/m/, take a secret key (sk_live_…, or sk_test_… in test mode) as Authorization: Bearer. Public endpoints, under /api/v1/pub/, take a publishable key (pk_live_…) where they need one.

A live secret key works on the Pro and Enterprise plans. On Free or Starter it is answered 403 with the error plan_feature_unavailable (details.feature is api); test keys and publishable keys (pay.js) work on every plan.

This page draws the full reference with JavaScript. The same reference as text, with every parameter, request field and example response: Markdown. The document it is drawn from: OpenAPI 3.1 (JSON). Every page of these docs in one file: llms-full.txt.

Merchant API

MethodPathSummary
POST/api/v1/m/sessionsSign a person in on a POS
DELETE/api/v1/m/sessionsSign this device out
POST/api/v1/m/sessions/activateGet a key for this device
POST/api/v1/m/sessions/renewKeep this device's key
GET/api/v1/m/api_tokenRead the key you are calling with
GET/api/v1/m/api_tokens/{id}/usageRead a key's usage
GET/api/v1/m/merchantRead the merchant
GET/api/v1/m/locationsList locations
POST/api/v1/m/locationsCreate a location
GET/api/v1/m/locations/{id}Read a location
PATCH/api/v1/m/locations/{id}Change a location
POST/api/v1/m/locations/{id}/archiveArchive a location
POST/api/v1/m/locations/{id}/restoreRestore a location
GET/api/v1/m/catalogRead the whole catalog
GET/api/v1/m/catalog/versionAsk whether the catalog changed
GET/api/v1/m/productsList products
POST/api/v1/m/productsCreate a product
GET/api/v1/m/products/{id}Read a product
PATCH/api/v1/m/products/{id}Change a product
DELETE/api/v1/m/products/{id}Delete a product
POST/api/v1/m/products/{product_id}/media_keysLink a media key to a product
DELETE/api/v1/m/products/{product_id}/media_keys/{id}Unlink a media key from a product
GET/api/v1/m/product_typesList product types
POST/api/v1/m/product_typesCreate a product type
GET/api/v1/m/product_types/{id}Read a product type
PATCH/api/v1/m/product_types/{id}Change a product type
DELETE/api/v1/m/product_types/{id}Delete a product type
GET/api/v1/m/ordersList orders
POST/api/v1/m/ordersCreate an order
GET/api/v1/m/orders/{id}Read an order
PATCH/api/v1/m/orders/{id}Change an order
DELETE/api/v1/m/orders/{id}Cancel an order
POST/api/v1/m/invoices/generateGenerate an invoice for an order
GET/api/v1/m/invoices/{id}Read an invoice
GET/api/v1/m/invoices/{id}/qrGet the invoice as a QR code
POST/api/v1/m/invoices/{id}/simulate_expiryMake a test invoice run out
POST/api/v1/m/invoices/{id}/simulate_paymentPay a test invoice
GET/api/v1/m/invoices/{id}/statusAsk whether an invoice was paid
POST/api/v1/m/payment_requestsAsk for a payment of an amount
GET/api/v1/m/payment_requests/{id}Read a payment request
GET/api/v1/m/payment_requests/{id}/statusAsk whether a payment request was paid
GET/api/v1/m/paymentsList payments
GET/api/v1/m/payments/{id}Read a payment
GET/api/v1/m/checkout_sessionsList checkout sessions
POST/api/v1/m/checkout_sessionsCreate a checkout session
GET/api/v1/m/checkout_sessions/{id}Read a checkout session
GET/api/v1/m/webhooksList webhook endpoints
POST/api/v1/m/webhooksCreate a webhook endpoint
GET/api/v1/m/webhooks/{id}Read a webhook endpoint
PATCH/api/v1/m/webhooks/{id}Change a webhook endpoint
DELETE/api/v1/m/webhooks/{id}Delete a webhook endpoint
GET/api/v1/m/salesList sales
GET/api/v1/m/sales/{id}Read a sale
GET/api/v1/m/walletsList wallets
GET/api/v1/m/wallets/{id}Read a wallet
GET/api/v1/m/media_keysList media keys
POST/api/v1/m/media_keysCreate a media key
GET/api/v1/m/media_keys/{id}Read a media key
PATCH/api/v1/m/media_keys/{id}Change a media key
DELETE/api/v1/m/media_keys/{id}Delete a media key
POST/api/v1/m/media_keys/{id}/clear_old_keyClear a rotated key's old key
GET/api/v1/m/media_keys/{id}/keyRead a media key's secret
POST/api/v1/m/media_keys/{id}/productsLink products to a media key
DELETE/api/v1/m/media_keys/{id}/products/{product_id}Unlink a product from a media key
POST/api/v1/m/media_keys/{id}/rotateRotate a media key
POST/api/v1/m/access/verifyCheck a buyer's access token

Public API

MethodPathSummary
GET/api/v1/pub/orders/{id}Confirm a paid order
POST/api/v1/pub/checkout_sessionsCreate a checkout session from a web page
POST/api/v1/pub/access/verifyCheck a buyer's access token from a web page