Getting started
Regoria is a merchant of record: your buyers pay Regoria, Regoria collects US sales tax, holds a rolling reserve and pays you out monthly. The API gives your server what it needs around that: a catalog, hosted checkout sessions, orders to fulfil, customers and their saved cards, subscriptions, refunds, your balance and payouts, and webhooks that tell you when something happened.
What you need
- A merchant account on Regoria with access to the dashboard.
- An API key. In the dashboard open Developers → API keys and create a key in test mode with the scopes you need (start with
v1.products.write,v1.checkout_sessions.write,v1.orders.read,v1.webhook_endpoints.manage). The key is shown once: copy it into your server's secret store. - A server that can make HTTPS calls and receive them. The API never talks to a browser directly.
Two environments
| Live | Sandbox | |
|---|---|---|
| Base URL | https://api.staging.regoria.com |
https://api.sandbox.staging.regoria.com |
| Keys | mor_live_… |
mor_test_… |
| Money | real cards, real payouts | test cards, nothing moves |
A test key is refused on the live base URL and a live key on the sandbox. Everything in these guides runs on the sandbox until you say otherwise. See Test mode and the sandbox.
Conventions in one minute
- JSON in, JSON out. Every amount is an integer in cents (
2900is $29.00); the currency isUSD. - The key goes in the
Authorizationheader as a bearer token. See Authentication and API keys. - Ids are prefixed:
prd_product,prc_price,pln_plan,cks_checkout session,ord_order,chg_charge,rfd_refund,sub_subscription,pm_saved card,cus_customer,dsp_dispute,whk_webhook endpoint,key_API key. - Lists are plain JSON arrays with the paging in headers (
X-Total-Count,Link). See Pagination, sorting and filtering. - Errors are
{"errors": [{"key": "…", "message": "…"}]}with stable keys. See Errors. - A
POSTthat creates money state takes anIdempotency-Keyheader. See Idempotency.
1. Your first call
curl https://api.sandbox.staging.regoria.com/v1/merchants/me \
-H "Authorization: Bearer $API_KEY"
You get your merchant profile back: id (mer_…), display_name, status, support_email, timezone. If you get 401, the key is wrong or on the wrong base URL; 403 insufficient_scope means the key lacks v1.merchants.read.
2. A product with a price
curl -X POST https://api.sandbox.staging.regoria.com/v1/products \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Starter pack", "type": "one_off", "amount_cents": 2900}'
The answer is the product with its active_price (prc_…). A product is one_off (bought once) or plan (billed on a schedule; add a plan with POST /v1/plans). A new price for the same product is POST /v1/prices; the old one stays on the orders that used it.
3. A hosted checkout
curl -X POST https://api.sandbox.staging.regoria.com/v1/checkout-sessions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"lines": [{"price_id": "prc_…", "quantity": 1}],
"customer_ref": "cus_A1B2",
"reference": "INV-1001",
"success_url": "https://shop.example.com/thanks",
"cancel_url": "https://shop.example.com/cart"
}'
Send the buyer to the session's url. Regoria shows the hosted page, quotes the sales tax for the buyer's address, takes the card and captures. The buyer lands on your success_url; your server learns about the sale from the order.paid webhook, never from the redirect alone. Sessions expire after 30 minutes. The whole flow, with the webhook handler, is in Hosted checkout end to end.
4. A webhook endpoint
curl -X POST https://api.sandbox.staging.regoria.com/v1/webhook-endpoints \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://shop.example.com/webhooks", "events": ["order.paid", "refund.issued"]}'
The answer carries the signing secret once. Store it; every delivery is signed with it. Webhooks has the verification code and the retry schedule.
Where next
- The API reference lists every operation with its scope, examples and code samples; the same document is
openapi.json. - Subscriptions, Refunds and disputes, Balance and payouts.
- Integrating with a coding agent: Build with AI.
- Questions: support@staging.regoria.com.