Every endpoint, with the request and response you can expect. All examples use test keys; swap in a live key and the same calls move real money.
The people who pay you. Created automatically at checkout, or by hand.
/v1/portal/sessionsscope: customers:writeA customer-portal link for a customer who is signed in to your product — redirect them to url and they can update their card, see payments, cancel or pause (as your portal settings allow). Valid for an hour. Pass return_url (http or https) and the portal shows a "Back to" link to it. Secret key only.
{ "customer": "cus_1b4c…", "return_url": "https://yourapp.am/account" }{
"object": "portal_session",
"customer": "cus_1b4c…",
"url": "https://ronda.am/portal/session/…",
"return_url": "https://yourapp.am/account",
"expires_at": 1790361234,
"mode": "test"
}/v1/customersscope: customers:writeCreate a customer. Every field is optional: email, name, phone, description, locale, metadata. locale (hy or en) is the language their checkout, invoices, customer page and emails open in; leave it out and they follow your business's setting. A customer can still switch on any page, unless you send allow_language_switch: false: then their pages and emails stay in locale and show no switch (null, the default, follows your business's setting). Ronda does not merge by email — calling this twice makes two customers — so store the cus_ id on your user and reuse it. credit_balances lists their account credit, one entry per currency (empty when there is none).
{
"email": "anna@example.am",
"name": "Anna Hakobyan",
"locale": "en",
"metadata": { "crm_id": "8891" }
}{
"id": "cus_1b4cf2ceec9356f1e53a3cab",
"object": "customer",
"email": "anna@example.am",
"name": "Anna Hakobyan",
"phone": null,
"description": null,
"locale": "en",
"allow_language_switch": null,
"billing": { "name": null, "tax_id": null, "address": null },
"metadata": { "crm_id": "8891" },
"credit_balances": [],
"created": 1786998562
}/v1/customersscope: customers:readList customers, newest first — supports ?email= (the whole address, any case). Deleted customers are left out.
/v1/customers/:idscope: customers:readRetrieve a customer
/v1/customers/:idscope: customers:writeUpdate a customer: email, name, phone, description (each a string, or null to clear it), locale (hy, en or null for your business's setting), allow_language_switch (false fixes their language, true gives the switch back, null follows your business's setting), metadata (replaces the whole object) and default_payment_method (pm_… — one of this customer's active cards), the card new subscriptions use and renewals fall back to when a subscription's own card is removed. Changing the default card does not retry a past-due subscription; set payment_method on the subscription for that.
/v1/customers/:id/credit_transactionsscope: customers:writeGive a customer account credit (amount > 0) or take it back (amount < 0), in one currency. It comes off their next subscription checkout's first payment, a change_plan with billing_cycle_anchor "now", or their next renewal — in that currency only, never converted. A take-back larger than the balance is refused with insufficient_credit and changes nothing. Honours Idempotency-Key. Sends customer.credit_adjusted.
{ "amount": 3000, "currency": "AMD", "description": "Referral reward", "metadata": { "referral": "ref_812" } }{
"id": "cbt_9a4e…",
"object": "credit_transaction",
"customer": "cus_1b4c…",
"amount": 3000,
"currency": "AMD",
"balance_after": 3000,
"description": "Referral reward",
"source": "manual",
"metadata": { "referral": "ref_812" },
"created": 1790419200,
"credit_balances": [{ "currency": "AMD", "amount": 3000 }]
}/v1/customers/:id/credit_transactionsscope: customers:readList a customer's credit transactions, newest first: what you granted or took back (source: manual) and what a prorated downgrade credited (source: downgrade). What checkouts, plan changes and renewals spent is not listed here — it is the credit line of each paid invoice.
/v1/customers/:idscope: customers:writeDelete a customer — clears personal data, deactivates saved cards, keeps the financial record
What you sell. A product owns its prices, so one product can be sold monthly and yearly without pretending to be two unrelated things.
/v1/productsscope: plans:writeCreate a product. name is required; description, statement_descriptor (up to 60 characters) and metadata are optional.
{
"name": "Pro",
"description": "For growing teams"
}{
"id": "prod_6f21…",
"object": "product",
"name": "Pro",
"description": "For growing teams",
"statement_descriptor": null,
"active": true,
"metadata": {},
"created": 1786998563
}/v1/productsscope: plans:readList products
/v1/products/:idscope: plans:readRetrieve a product
/v1/products/:idscope: plans:writeUpdate a product: name, description, statement_descriptor (null clears either), active and metadata
/v1/products/:idscope: plans:writeArchive a product and every price under it. Existing subscriptions keep billing.
An amount and an interval, belonging to a product. Changing a price's amount applies to its existing subscribers from their next renewal — never to a period already paid. Omit `product` and the `name` creates one, so selling something takes a single call.
/v1/plansscope: plans:writeCreate a price. name, amount and currency (AMD, USD or EUR — there is no default) are required. interval is day, week, month or year (default month) and interval_count 1–52 (default 1), so month × 3 is quarterly. trial_days (0–365) is the free trial every new subscription to it gets. With product, name is the price's own nickname ("Monthly"); without it, a product called name is created and the price has no nickname. In the response name is the display name — the product's, plus the nickname when there is one. In live mode a USD or EUR price is refused until your bank and you have switched that currency on (currency_not_enabled, currency_off_at_bank).
{
"product": "prod_6f21…",
"name": "Monthly",
"amount": 12900,
"currency": "AMD",
"interval": "month",
"interval_count": 1,
"trial_days": 14
}{
"id": "plan_3911175476653e621be07025",
"object": "plan",
"product": "prod_6f21…",
"product_name": "Pro",
"name": "Pro — Monthly",
"nickname": "Monthly",
"description": null,
"amount": 12900,
"currency": "AMD",
"interval": "month",
"interval_count": 1,
"trial_days": 14,
"active": true,
"metadata": {},
"created": 1786998563
}/v1/plansscope: plans:readList prices
/v1/plans/:idscope: plans:readRetrieve a price
/v1/plans/:idscope: plans:writeUpdate a price: name, description, amount, trial_days, metadata, and active (false archives it, true restores it). A new amount applies to existing subscribers from their next renewal. Currency and interval cannot change — create a new price.
The recurring core. A customer, a plan, a saved card and a schedule.
/v1/subscriptionsscope: subscriptions:writeCreate a subscription on a card the customer has already saved. customer and plan are required; payment_method (one of that customer's cards — default: their default card), quantity (1–1000, default 1; the charge is the plan's amount × quantity), trial_days (overrides the plan's) and metadata are optional. Without a trial, a payment method is required and the first period is charged now. With a trial nothing is charged and no card is needed until it ends. The response carries that charge as latest_payment. If it was declined the subscription is past_due and the recovery ladder retries it; latest_payment.failure_code says why. Statuses: trialing, active, past_due, paused, canceled — and incomplete while the first charge is in flight (subscription.created can carry it). If the bank's reply is lost, the subscription stays incomplete with latest_payment processing — not past_due, not charged again — until the bank answers: subscription.activated, or subscription.past_due on a decline. If the request fails after the charge was reserved, it still answers 201 with that subscription under your Idempotency-Key, so a retry never creates a second one.
{
"customer": "cus_1b4c…",
"plan": "plan_3911…",
"payment_method": "pm_77a2…",
"quantity": 1
}{
"id": "sub_5c1e…",
"object": "subscription",
"status": "active",
"customer": "cus_1b4c…",
"plan": "plan_3911…",
"quantity": 1,
"current_period_start": 1786998600,
"current_period_end": 1789590600,
"trial_end": null,
"cancel_at_period_end": false,
"cancellation_details": null,
"pause": null,
"payment_method": "pm_77a2…",
"dunning_attempt": 0,
"next_attempt": null,
"metadata": {},
"created": 1786998600,
"latest_payment": { "id": "pay_a348…", "object": "payment", "status": "succeeded", "amount": 12900, "currency": "AMD", "failure_code": null, "failure_message": null, "…": "the full payment object" }
}/v1/subscriptionsscope: subscriptions:readList subscriptions, newest first — supports ?status= (incomplete, trialing, active, past_due, paused or canceled; anything else is a 400) and ?customer=cus_…. List items carry no discount; retrieve one for that.
/v1/subscriptions/:idscope: subscriptions:readRetrieve a subscription. Adds discount — { id: di_…, coupon: the coupon object, periods_applied } or null — as every single-subscription response except create does. While past_due, next_attempt is when the next retry runs and dunning_attempt how many tries have failed; pause is { source, resumes_at, scheduled } once a pause is asked for (scheduled: true while the paid period is still running).
/v1/subscriptions/:id/change_planscope: subscriptions:writeChange plan with proration (prorate defaults to true). An upgrade charges the difference to the card now: declined, or the bank asks for 3-D Secure → 402 card_declined and the plan is not changed; the bank's reply lost → 409 charge_pending, and the plan changes when the bank confirms (subscription.plan_changed). A downgrade adds the difference to the customer's credit_balances, spent on later renewals in that currency. prorate: false switches with no money movement. quantity (1–1000) changes the seats in the same call. The period end does not move. The new plan must be in the same currency; a canceled subscription cannot change. Honours Idempotency-Key.
{ "plan": "plan_bigger…", "prorate": true }{
"id": "sub_5c1e…",
"status": "active",
"plan": "plan_bigger…",
"billing_cycle_anchor": "unchanged",
"proration": { "charged": 19677, "credited": 0, "currency": "AMD", "payment": "pay_aa31…" }
}/v1/subscriptions/:id/change_planscope: subscriptions:writeWith billing_cycle_anchor: "now": charge the new plan's full price today and start a new period, one interval of the new plan long (monthly → annual works — and it is the way to do it: a prorated change between a monthly and a yearly price is refused with plan_interval_mismatch). No credit for unused time. The subscription's discount and the customer's account credit come off as on a renewal. Declined → 402 and nothing changes. Only an active or trialing subscription that is not set to cancel, has no pause scheduled and is not about to renew; prorate: true is refused (400 billing_cycle_anchor_conflict); the other refusals are subscription_paused, subscription_past_due, subscription_not_active, subscription_ending, subscription_pause_scheduled, subscription_invoiced and renewal_due. If the bank's reply is lost: 409 charge_pending, nothing changes yet — the plan changes when the bank confirms (subscription.plan_changed); if it declines, or the subscription changed meanwhile and the charge is refunded, subscription.plan_change_failed. A retry after success answers with that same change and charges nothing. Send expected_amount (the amount you showed) and a different amount is refused with 409 amount_changed and the new amount in error.amount. One money operation per subscription at a time: while a renewal or plan change on it is unfinished (at the bank, a lost reply, applied but not finished), any other plan change or quantity update is 409 subscription_busy (error.payment when there is one); the very same request repeated gets that operation's outcome. While the renewal is due or being charged, a reset is 400 renewal_due. subscription_changed carries charged: false (stale read, nothing charged) or charged: true with payment (canceled or paused while the charge was at the bank; the charge is refunded). Already on the plan and not a recognisable retry: 400 plan_unchanged — this request charged nothing — with error.period_charge, the change that put it there (or null).
{ "plan": "plan_annual…", "billing_cycle_anchor": "now" }{
"id": "sub_5c1e…",
"status": "active",
"plan": "plan_annual…",
"current_period_start": 1790419200,
"current_period_end": 1821955200,
"billing_cycle_anchor": "now",
"proration": null,
"period_charge": {
"payment": "pay_bb02…", "plan": "plan_annual…", "quantity": 1, "status": "succeeded",
"amount": 97000, "currency": "AMD", "subtotal": 100000, "discount": 0, "credit_applied": 3000,
"period_start": 1790419200, "period_end": 1821955200, "invoice": "inv_7c1d…"
}
}/v1/subscriptions/:id/cancelscope: subscriptions:writeCancel now, or at period end with { "at_period_end": true }. Optionally record why: reason is one of too_expensive, not_using, missing_feature, switching, temporary, other, plus a free-text comment. They come back in cancellation_details, with canceled_by: merchant, customer (from the portal) or payment_failed.
{ "at_period_end": true, "reason": "switching", "comment": "Moving to annual invoicing" }/v1/subscriptions/:id/pausescope: subscriptions:writePause billing without canceling. No body. Any subscription that is not canceled is paused now and nothing is charged while it is (pause.source: merchant). Not while its first charge is still being processed: 400 subscription_incomplete.
/v1/subscriptions/:id/resumescope: subscriptions:writeResume where it stood — a trial keeps its end, a paid period keeps its end; one that ran out while paused, or was paused owing money, is charged now
/v1/subscriptions/:idscope: subscriptions:writeUpdate quantity, metadata, the card it is charged to (payment_method — a past-due subscription is retried on it now), or withdraw a scheduled cancel ({ "cancel_at_period_end": false }). A quantity change is prorated like a plan change — an increase is charged now, prorate: false skips the money — and the response then adds the same proration object as change_plan. metadata replaces the whole object. Honours Idempotency-Key.
{ "quantity": 3, "payment_method": "pm_77a2…", "metadata": { "seat_plan": "team" } }/v1/subscriptions/:id/simulate_renewalscope: subscriptions:writeTest mode only: run the next renewal now — the trial ends, or the next period or retry is charged — through the same path as the real schedule, with the same emails and webhooks. Refused with a live key.
/v1/subscriptions/:id/retryscope: subscriptions:writePast due: try the payment now instead of at next_attempt — after the customer fixed their card in your app. A decline counts as one of the retries. Up to three a day. If this period's retry is already at the bank, the answer is that payment (latest_payment) — never a second charge; a new charge always has a new payment id, so a known id means the in-flight one. Only past_due: an active subscription is 400. If more than one period was missed, the business's Recovery setting decides: "start fresh" (the default) charges once and starts the period now (period_reanchored: true on subscription.updated); "charge missed periods" charges each one.
Every charge, one-off and recurring.
/v1/paymentsscope: payments:writeCharge a saved card off-session — the same call the recurring engine makes. amount and currency are required (no default currency); send payment_method (pm_…) or a customer, whose default card is charged. A payment_method sent together with a customer must be that customer's card (400 otherwise), and a removed card is refused (payment_method_inactive) before the bank is asked. Always send an Idempotency-Key. 201 with status succeeded is money taken. A decline is a 402 card_declined carrying decline_code and the failed payment's id. 201 with status requires_action means the card's bank insists on 3-D Secure: send the customer through a checkout instead. 201 with status processing means the bank took the order and has not said how it ended — do not charge again; payment.succeeded or payment.failed follows. card is the card that paid, for display only: brand, last4, expiry and country — where it was issued, as the bank reports it (AM, another two-letter code, ZZ when the bank does not know, which in practice is a foreign card, or null). A refused payment keeps its card too, so a decline says which card it was. Statuses: pending, processing, succeeded, requires_action, failed, canceled, refunded, partially_refunded. type is one_off, subscription or link.
{
"amount": 45000,
"currency": "AMD",
"customer": "cus_1b4c…",
"description": "September retainer"
}{
"id": "pay_a348cb5b0664660d4c29d890",
"object": "payment",
"amount": 45000,
"currency": "AMD",
"status": "succeeded",
"type": "one_off",
"method": "card",
"description": "September retainer",
"customer": "cus_1b4c…",
"subscription": null,
"payment_method": "pm_77a2…",
"card": { "brand": "Visa", "last4": "4242", "exp_month": 12, "exp_year": 2030, "country": "AM" },
"amount_refunded": 0,
"approval_code": "482913",
"attempt": 1,
"is_recovery": false,
"failure_code": null,
"failure_message": null,
"metadata": {},
"created": 1786998900
}/v1/paymentsscope: payments:readList payments — supports ?status= (pending, processing, requires_action, succeeded, failed, canceled, refunded, partially_refunded or incomplete; anything else is a 400) and ?customer=. Checkouts nobody finished are left out; ?status=incomplete lists them. Each payment carries method: card, or idram for a one-time payment from an Idram wallet
/v1/payments/:idscope: payments:readRetrieve a payment
/v1/payments/:id/refundscope: refunds:writeRefund in whole or part: leave amount out to refund everything not yet refunded. reason (up to 200 characters) and metadata are optional. It goes to the bank at once and the money returns to the same card; the payment becomes refunded or partially_refunded and its amount_refunded grows. The platform fee on the refunded amount is reversed. A refund does not cancel a subscription. Only a succeeded or partly refunded payment: 400 payment_not_refundable; more than is left: refund_exceeds_balance; the bank refused: refund_failed; a payment made with Idram (method: idram) cannot be refunded here: refund_not_supported — the business returns it from its Idram account and records it in the dashboard. If the bank does not answer: 400 refund_outcome_unknown — the refund stays pending and Ronda settles it with the bank, so never send it again. Honours Idempotency-Key. At most 50 refunds per business in 24 hours.
{ "amount": 20000, "reason": "duplicate" }{
"id": "re_66b1…",
"object": "refund",
"payment": "pay_a348…",
"amount": 20000,
"currency": "AMD",
"status": "succeeded",
"reason": "duplicate",
"failure_reason": null,
"metadata": {},
"created": 1786999200
}/v1/refundsscope: payments:readList refunds — supports ?payment=pay_…. Statuses: pending, succeeded, failed, canceled.
/v1/refunds/:idscope: payments:readRetrieve a refund
The only way a card enters the system. Works with a publishable key for your own plans only.
/v1/checkout/sessionsscope: payments:write · publishable: plans onlyOpen a hosted checkout. type is payment, setup or subscription. method is card (the default) or idram: an Idram checkout is paid from the customer's Idram wallet, for a one-time payment in AMD only, when the business has switched Idram on (else 400 idram_unavailable or idram_not_supported); you rarely need to send it, because a card checkout that could be paid with Idram shows a second Pay with Idram button by itself. The session and its payment both carry method. The bank's order is registered as the session is created, so it comes back already processing and stays so while the customer is on the page or at the bank; it ends completed, failed, expired or canceled. (open is only ever seen if the bank could not be reached at creation.) Send the customer to url — our page, which forwards to the bank. bank_url is the bank's own card page, for an integration that must redirect there directly; prefer url, which also shows the test banner, the amount and the result. After payment the receipt shows a Continue button to success_url; with auto_redirect: true (secret key only) it sends the customer there by itself 3 seconds after the receipt appears. fallback_url (secret key only) is where the customer goes when the payment cannot be taken here: if the bank's page fails before a card is entered, Ronda closes the checkout (it ends expired, and checkout.session.expired is sent) and sends the customer to fallback_url with ronda_checkout=<session id> and ronda_reason=bank_unavailable added; after a refused card the result page offers a Pay another way button to the same address with ronda_reason=payment_failed. Without it the customer stays on the page and can try again. locale (hy or en) opens the page and the bank's card page in that language; without it, the customer's own language, else your business's setting. The customer can still switch — unless you send allow_language_switch: false, which fixes this checkout in locale: no Հայ/Eng switch on the page, the customer's saved choice ignored, the receipt in that language. Left out, the customer's own setting decides, else your business's (Settings → Language switch). Most specific wins: checkout, then customer, then business. For a subscription opened with a secret key: the customer's account credit (with customer) comes off the first payment, and the newest checkout for a customer takes the credit over from their older unpaid ones; coupon (cpn_… or its code) takes a discount off it from the start, shown on the page by its name, never its code; allow_promotion_codes: true puts a discount-code box on the page, which accepts only coupons marked redeemable_at_checkout — both secret key only. A typed code opens a new session for the new amount and the page moves to it; the old one ends canceled with superseded_by. amount is what is charged today; subtotal, discount and credit_applied say what it is made of. If nothing is left to charge the bank only saves the card. A publishable key (public — it sits in your page source) may only open type subscription with one of your plans, which sets the price and the name on the page: amount, any other type (the default is payment) or description with a publishable key is refused with 400 publishable_key_needs_price. Create those on your server with the secret key. amount needs its currency; a subscription uses its plan's. A checkout that charges nothing today — setup, or a subscription whose plan has a free trial — still sends the card to the bank to be saved: some banks will not save a card for nothing, so Ronda charges ֏100, $1 or €1 as a check and reverses it at once (never in test mode, never a payment of yours). The session lasts 30 minutes. After a decline the customer can press Try again, which opens a new session — a new cs_ id with your metadata copied plus retry_of — so match completions on your metadata or customer, not on the first id. If your business has turned on the unfinished-payment email (Settings → Emails; off by default), a checkout that ended unpaid can be started again from that email for seven days, the same way. metadata may not use the keys purpose and invoice_id. Honours Idempotency-Key.
{
"type": "payment",
"amount": 25000,
"currency": "AMD",
"description": "September membership",
"customer_email": "anna@example.am",
"save_card": true,
"locale": "en",
"success_url": "https://yourapp.am/thanks",
"auto_redirect": true
}{
"id": "cs_f4accee46724b73fae2ced5a",
"object": "checkout_session",
"type": "payment",
"status": "processing",
"amount": 25000,
"currency": "AMD",
"description": "September membership",
"customer_email": "anna@example.am",
"customer": null,
"plan": null,
"mode": "test",
"method": "card",
"url": "https://ronda.am/checkout/cs_f4ac…",
"bank_url": "https://…bank…/payments/…",
"payment": null,
"subscription": null,
"expires_at": 1787000363,
"success_url": "https://yourapp.am/thanks",
"cancel_url": null,
"fallback_url": null,
"auto_redirect": true,
"locale": "en",
"allow_language_switch": null,
"allow_promotion_codes": false,
"coupon": null,
"subtotal": null,
"discount": 0,
"credit_applied": 0,
"superseded_by": null,
"metadata": {},
"created": 1786998563
}/v1/checkout/sessions/:idscope: payments:read · publishableRetrieve a session and its outcome. Once completed it carries customer, payment (pay_…, or null when nothing was charged — a trial or a card-only setup) and subscription (sub_…). Works with a secret or a publishable key of the same mode.
Saved cards. Ronda holds the bank's token, brand and last four digits — never a card number.
/v1/payment_methodsscope: customers:readList saved cards — supports ?customer=cus_…. A card is only ever saved by a checkout (subscription, setup, or payment with save_card). active is false once it is detached or the bank retires it.
{
"object": "list",
"url": "/v1/payment_methods",
"has_more": false,
"data": [
{
"id": "pm_77a2c1d0e9f8a7b6c5d4e3f2",
"object": "payment_method",
"type": "card",
"customer": "cus_1b4c…",
"brand": "Visa",
"last4": "4242",
"exp_month": 12,
"exp_year": 2030,
"is_default": true,
"active": true,
"created": 1786998700
}
]
}/v1/payment_methods/:idscope: customers:writeDetach a card and deactivate the binding at the bank
A shareable URL. Point one at a plan and it starts a real subscription.
/v1/payment_linksscope: links:writeCreate a payment link: a fixed amount with its currency, allow_custom_amount: true (the customer types the amount, at least ֏100, $1 or €1, in the currency you name), or plan (it starts a subscription, in the plan's currency). name, description, max_uses, expires_at (unix seconds) and metadata are optional. locale (hy or en) and allow_language_switch give the link its own language and say whether its customers may switch; left out, your business's setting. Both travel to every checkout the link opens. A link is reusable: every payer gets their own checkout, whose metadata carries payment_link and whose payment has type link; use_count counts the completed ones. url is what you share — add ?email= to it to fill in a customer you know. success_url is where its customers go after paying: a Continue button on the receipt, or with auto_redirect: true the receipt sends them there by itself after 3 seconds. Without success_url the button goes to your website from Settings. A link to a plan can carry coupon (a cpn_ id or code, taken off the first payment of every checkout it opens, then for the coupon's duration; 400 coupon_not_usable if it cannot be used now) and allow_promotion_codes (a discount-code box; only coupons marked redeemable_at_checkout can be typed). Its customers then see the price and discount on Ronda's checkout page before the bank's.
{
"name": "September invoice",
"amount": 45000,
"currency": "AMD",
"success_url": "https://yourapp.am/thanks",
"auto_redirect": true
}{
"id": "link_71c2…",
"object": "payment_link",
"url": "https://ronda.am/pay/pl_8f1c…",
"code": "pl_8f1c…",
"name": "September invoice",
"description": null,
"amount": 45000,
"currency": "AMD",
"plan": null,
"allow_custom_amount": false,
"max_uses": null,
"use_count": 0,
"expires_at": null,
"status": "active",
"metadata": {},
"success_url": "https://yourapp.am/thanks",
"auto_redirect": true,
"coupon": null,
"allow_promotion_codes": false,
"created": 1786998563
}/v1/payment_linksscope: links:readList links
/v1/payment_links/:idscope: links:readRetrieve a link
/v1/payment_links/:idscope: links:writeUpdate a link: status, name, description, metadata, success_url ("" or null removes it, and turns auto_redirect off) and auto_redirect. status is active or inactive. Amount, currency, plan and coupon cannot change — make a new link.
The document behind a charge — and the way to bill a company that will not hand over a card. Every subscription cycle writes one; you can also raise one directly. Sent invoices carry a due date and a hosted page the customer can pay from.
/v1/invoicesscope: payments:writeRaise an invoice and send it. customer, currency and lines (1–50, each a description, a quantity that defaults to 1 and a unit_amount) are required; days_until_due, memo and metadata are optional. It is created open, with a number, and Ronda emails the customer a link to hosted_url, where they pay by card on the bank's page; it reminds them once when overdue and marks it uncollectible 30 days after due. An invoice made through the API is always one the customer pays: collection_method charge_automatically — what a subscription's own invoices use — is refused with a 400. To charge a saved card, use POST /v1/payments. Statuses: draft, open, paid, void, uncollectible. Honours Idempotency-Key.
{
"customer": "cus_1b4c…",
"currency": "AMD",
"collection_method": "send_invoice",
"days_until_due": 14,
"memo": "Thank you",
"lines": [
{ "description": "Consulting, March", "quantity": 2, "unit_amount": 150000 }
]
}{
"id": "inv_9d02…",
"object": "invoice",
"number": "2026-0042",
"status": "open",
"customer": "cus_1b4c…",
"subscription": null,
"payment": null,
"collection_method": "send_invoice",
"currency": "AMD",
"subtotal": 300000,
"discount": 0,
"credit": 0,
"total": 300000,
"amount_paid": 0,
"period_start": null,
"period_end": null,
"due": 1788208563,
"memo": "Thank you",
"hosted_url": "https://ronda.am/invoice/ivt_…",
"paid": false,
"paid_at": null,
"metadata": {},
"created": 1786998563,
"lines": [
{ "description": "Consulting, March", "quantity": 2, "unit_amount": 150000, "amount": 300000, "period_start": null, "period_end": null }
]
}/v1/invoicesscope: payments:readList invoices — supports ?customer=cus_… and ?status= (one, or several separated by commas: open,uncollectible). List items carry no lines.
/v1/invoices/:idscope: payments:readRetrieve an invoice with its line items
/v1/invoices/:id/voidscope: payments:writeVoid an invoice. It keeps its number — the sequence stays gapless — and stops being payable. A paid invoice cannot be voided — refund its payment instead.
A reusable discount rule. Attaching one to a subscription creates a discount with its own clock, so archiving the coupon never re-prices someone already on it — archiving stops new redemptions only. max_redemptions is enforced at checkout: every open checkout holding the coupon counts against it until it closes, and one that cannot take it gets coupon_invalid (a typed code: promotion_code_invalid; a payment link: full price, said on the page). Discounts do not stack.
/v1/couponsscope: plans:writeCreate a coupon — a percentage or a fixed amount, never both. A fixed amount_off needs its currency and applies only to prices in it. redeemable_at_checkout: true lets customers type its code in a checkout's discount-code box (default false; a coupon you pass on a checkout yourself works either way). code is 3–40 letters, digits, - or _. duration is once (the next charge only — the default), repeating (with duration_in_months) or forever. max_redemptions and redeem_by (unix seconds) limit how often and until when it can be taken. valid says whether it can be redeemed now: active, not past redeem_by, redemptions left. currency means something only beside amount_off: a percentage coupon's object shows AMD and still applies to prices in every currency.
{
"code": "SUMMER25",
"percent_off": 25,
"duration": "repeating",
"duration_in_months": 3,
"max_redemptions": 100,
"redeemable_at_checkout": true
}{
"id": "cpn_74b1…",
"object": "coupon",
"code": "SUMMER25",
"name": null,
"percent_off": 25,
"amount_off": null,
"currency": "AMD",
"duration": "repeating",
"duration_in_months": 3,
"max_redemptions": 100,
"times_redeemed": 0,
"redeem_by": null,
"active": true,
"redeemable_at_checkout": true,
"valid": true,
"created": 1786998563
}/v1/couponsscope: plans:readList coupons
/v1/coupons/:idscope: plans:readRetrieve a coupon by id or by code
/v1/coupons/:idscope: plans:writeChange what cannot alter a discount already given: redeemable_at_checkout, name, max_redemptions (raised or null — never lowered: max_redemptions_lowered) and redeem_by (new redemptions only). The code and what it gives — percent_off, amount_off, currency, duration — are fixed: 400 coupon_field_fixed. An archived coupon: 400 coupon_archived.
{ "name": "Spring offer", "max_redemptions": 200, "redeemable_at_checkout": true }/v1/coupons/:idscope: plans:writeArchive a coupon. It can no longer be redeemed; subscriptions that already have it keep their discount.
/v1/subscriptions/:id/discountscope: subscriptions:writeApply a coupon (its cpn_ id or its code) to a subscription. It takes effect from the next charge; the response is the subscription with its discount. An amount-off coupon in another currency than the subscription's is refused: coupon_currency_mismatch.
{ "coupon": "SUMMER25" }/v1/subscriptions/:id/discountscope: subscriptions:writeRemove the discount; full price from the next renewal
Everything else you need to reconcile.
/v1/webhook_endpointsscope: webhooks:writeRegister an endpoint. The signing secret is returned once — here, and when you roll it. enabled_events is the list of event types to send (up to 60); leave it out for all of them (["*"]). An unknown type is a 400. The url must be https, on a public address, port 80 or 443. An endpoint belongs to the mode of the key that made it: test events never reach a live endpoint. Idempotency-Key is not honoured here — list before you add.
{ "url": "https://yourapp.am/ronda/webhook", "enabled_events": ["payment.succeeded"] }{
"id": "we_2d4f…",
"object": "webhook_endpoint",
"url": "https://yourapp.am/ronda/webhook",
"description": null,
"enabled_events": ["payment.succeeded"],
"status": "enabled",
"mode": "test",
"consecutive_failures": 0,
"secret": "whsec_Hk2…",
"created": 1786998563
}/v1/webhook_endpointsscope: webhooks:readList endpoints. All of them in one response — this list is not paginated — and without their secrets.
/v1/webhook_endpoints/:idscope: webhooks:readRetrieve an endpoint
/v1/webhook_endpoints/:idscope: webhooks:writeUpdate url, description or enabled_events, or disable/enable it with { "disabled": true|false }. Enabling resets its failure count.
{ "disabled": false }/v1/webhook_endpoints/:id/testscope: webhooks:writeSend a signed webhook.test event now. The response is the delivery, with your server's HTTP status. One attempt, never retried, never counted toward auto-disable.
/v1/webhook_endpoints/:id/roll_secretscope: webhooks:writeReplace the signing secret. The new secret is in the response, once; the old one stops verifying immediately.
/v1/webhook_endpoints/:idscope: webhooks:writeDelete an endpoint
/v1/eventsscope: events:readList events, newest first — supports ?type= (one exact type, such as subscription.canceled). The same events your webhooks receive, to backfill or reconcile.
/v1/events/:idscope: events:readRetrieve an event. related_object is the id of what it is about; it is on the API's event only, not in the webhook payload.
{
"id": "evt_9f3a2c…",
"object": "event",
"type": "subscription.activated",
"mode": "test",
"data": { "object": { "id": "sub_5c1e…", "object": "subscription", "status": "active", "…": "the subscription" } },
"related_object": "sub_5c1e…",
"created": 1786998900
}/v1/disputesscope: payments:readList chargebacks. Statuses: needs_response, under_review, won, lost, warning_closed. Reading only — evidence is added in the dashboard.
/v1/disputes/:idscope: payments:readRetrieve a chargeback: payment, amount, currency, reason, status, evidence_due_by and opened
/v1/balancescope: payments:readDerived from the ledger, one currency at a time: ?currency=AMD, USD or EUR (AMD when left out) — amounts are never added up across currencies, and currencies lists every one this account has money in. gross is everything collected; refunded and fees come off it. available (= settled) has reached your bank account; on_its_way is collected but not there yet, pending is the part of on_its_way still clearing at the bank, and overdue the part that is past your bank's usual payout day and not yet seen arriving. Your bank pays you directly — Ronda never holds the money.
{
"object": "balance",
"currency": "AMD",
"available": 1180000,
"on_its_way": 207900,
"pending": 96000,
"overdue": 0,
"gross": 1420000,
"refunded": 25000,
"fees": 7100,
"settled": 1180000,
"currencies": ["AMD"],
"mode": "live"
}