A REST API for recurring payments in Armenia. Save a card once on your bank's hosted page, then charge it on a schedule — merchant-initiated, with no customer present.
https://api.ronda.am/v1Every request is JSON in and JSON out. The API is server-to-server: a secret key must never reach a browser or a mobile app.
Send your secret key as a bearer token. The key itself decides both the merchant and the mode — there is no account or mode parameter to get wrong.
curl https://api.ronda.am/v1/customers \
-H "Authorization: Bearer sk_test_…"| Key | Where it belongs | What it can do |
|---|---|---|
pk_test_… / pk_live_… | Anywhere, including a browser | Open a checkout for one of your plans, at the plan's price, and read that session back |
sk_test_… / sk_live_… | Your server only | Everything, subject to the key's scopes |
Secret keys are stored as a hash and shown once at creation. If you lose one, rotate it — Ronda cannot recover it, which is the point.
The key is also accepted as HTTP Basic auth with the key as the username and no password (curl -u sk_test_…:), or in a ronda-api-key header.
A publishable key can call two things only: POST /v1/checkout/sessions — for type: "subscription" with one of your plans, nothing else — and GET /v1/checkout/sessions/:id. On any other endpoint it gets 401 publishable_key_not_allowed; a checkout with an amount, another type or a description gets 400 publishable_key_needs_price.
A secret key made in the dashboard has full access. You can limit it to your servers' IP addresses there; a call from anywhere else gets 403 ip_not_allowed. A key restricted to some scopes gets 403 missing_scope outside them. The scopes are customers:read, customers:write, plans:read, plans:write (products, prices and coupons), subscriptions:read, subscriptions:write, payments:read (payments, refunds, invoices, disputes and the balance), payments:write (payments, checkout sessions and invoices), refunds:write, links:read, links:write, webhooks:read, webhooks:write and events:read. The API reference names the scope each endpoint needs.
Each mode has its own keys and its own data. A test key literally cannot address a live object: mode is a column on every row and is derived from the key, never from the request. Test payments never accrue a platform fee.
cus_ customer, prod_ product, plan_ price, sub_ subscription, pay_ payment, pm_ saved card, re_ refund, inv_ invoice, cs_ checkout session, link_ payment link, cpn_ coupon, di_ discount, dp_ dispute, we_ webhook endpoint, evt_ event, whd_ webhook delivery, cbt_ credit transaction. A payment link's public address carries its own pl_ code, and a webhook signing secret starts whsec_.12900 means ֏ 12 900. USD and EUR are in cents: 1999 is $19.99. Never send a decimal. Currency codes are case-insensitive.AMD, USD or EUR — there is no default, and an amount sent without one is refused with 400 currency_required. Anything built on a price (a subscription, or a checkout or link for a plan) is in that price's currency; naming a different one is 400 currency_mismatch. Money is never converted: a dollar price is charged in dollars. One amount may be at most ֏100 000 000, or 250 000.00 in USD or EUR.currency_not_enabled or currency_off_at_bank. Test mode takes all three.400 parameter_unknown that suggests the name you probably meant.metadata — up to 50 keys of your own data (strings up to 500 characters, numbers, booleans or null), returned untouched. An update replaces the whole object, so send every key you want to keep.{ object: "list", url, has_more, data: [...] }.ronda-request-id header. Quote it when you ask us about a request.Send an Idempotency-Key header on every create. A repeat of the same key returns the original response instead of acting again, and carries Idempotent-Replay: true. Re-using a key with a different body is rejected with 409 rather than silently doing something new.
The key is honoured when creating customers, products, plans, subscriptions, payments, refunds, coupons, invoices, checkout sessions, payment links and credit transactions, and on POST /v1/subscriptions/:id and change_plan. Other POSTs ignore it. Retry, cancel, pause and resume act on the subscription's state, so repeating one is refused or changes nothing. Portal sessions and webhook endpoints make a new object every time: a portal link is a sign-in for your customer, so Ronda never keeps a copy to replay. List endpoints before adding one.
A key is at most 255 characters and belongs to one mode. The body is compared whatever order its fields are in. If the first request failed, the key is free again and the same request can be retried under it; a declined charge retried with the same key returns the same decline without charging again, so use a new key to try the card again. While the first request is still running, a repeat gets 409 idempotency_key_in_use.
curl -X POST https://api.ronda.am/v1/payments \
-H "Authorization: Bearer sk_test_…" \
-H "Idempotency-Key: order-3391-charge" \
-H "Content-Type: application/json" \
-d '{"amount": 12900, "currency": "AMD", "customer": "cus_…"}'GET /v1/payments?limit=25
GET /v1/payments?limit=25&starting_after=pay_9f3a…Cursors are object ids, not offsets, so a page never skips a row because new payments arrived while you were reading. Lists are newest first. limit is 1 to 100 and defaults to 25. For the next page send the last item's id as starting_after while has_more is true; ending_before pages back towards newer items. Each list takes only the filters its entry in the API reference names. GET /v1/webhook_endpoints is the one list that is not paginated.
Some things are set in the dashboard only: connecting your bank and switching currencies on, the retry schedule for failed payments and what happens when a payment recovers after missed periods, what customers may do in the portal, which emails Ronda sends your customers, tax receipts (e-HDM), payouts, answering a chargeback with evidence, your team and your API keys.