Developer documentationDocsGet API keys

Errors

Every failure has the same shape, whatever went wrong.

{
  "error": {
    "type": "card_error",
    "code": "card_declined",
    "message": "Insufficient funds.",
    "decline_code": "insufficient_funds",
    "payment": "pay_7f3a2c…",
    "doc_url": "https://ronda.am/docs/errors#card_declined"
  }
}

type tells you how to react; code is the stable machine-readable identifier; message is safe to show a human. param appears when a specific field was at fault, and a decline carries payment — the id of the failed payment, which you can fetch like any other. A few errors carry one more field: payment on charge_pending and subscription_busy (the charge they wait on), amount on amount_changed, charged on subscription_changed, and period_charge on plan_unchanged. Internal detail — bank payloads, SQL, stack traces — never crosses this boundary.

Every response, success or failure, carries a ronda-request-id header. Quote it when you ask us about a request — it finds the exact line in our logs.

Error types

TypeStatusWhat it means
invalid_request_error400 / 404 / 409Something about the request was wrong: a missing parameter, a bad value, an unknown object (404) — or the object is not in a state for it yet (409: charge_pending, subscription_busy, amount_changed).
authentication_error401The API key was missing, malformed, unknown or revoked.
permission_error403Authenticated, but not allowed: a missing scope, a blocked IP, a suspended account, or live payments not open for this business yet.
card_error402The bank declined. Look at decline_code.
rate_limit_error429Too many requests. Retry-After tells you when.
idempotency_error409An Idempotency-Key was re-used with a different body, or is still in flight.
api_error500Something failed on our side. Retry; the payment intent is already recorded.

Error codes

CodeWhat to do
parameter_invalidA value was the wrong type, out of range or malformed. `param` names the field.
parameter_missingA required field was not sent. `param` names it.
parameter_unknownA field this endpoint does not take — usually a typo; the message suggests the name you probably meant. Unknown fields are refused rather than ignored, so a request never quietly does less than you wrote.
resource_missingNo object with that id exists for this key's merchant and mode. A test-mode id never resolves with a live key, or the other way round.
api_key_missingNo key was sent. Use `Authorization: Bearer sk_test_…`.
invalid_api_keyThe key is not one Ronda issued, or it has been rolled.
api_key_revokedThe key was revoked on the Developers page.
publishable_key_not_allowedA publishable key (pk_…) can only create checkout sessions. Use a secret key from your server.
publishable_key_needs_priceA publishable key can open a checkout only for a price you set up in Ronda: type `subscription` with a `plan`. An `amount`, any other `type` (it defaults to `payment`), or a `description` is refused, and `param` names which. Create that checkout on your server with a secret key, or share a payment link.
missing_scopeA restricted key without the scope this endpoint needs.
ip_not_allowedThe key has an IP allowlist and this request came from elsewhere.
idempotency_key_in_useThe same Idempotency-Key was sent with a different body, or the first request is still running. Use a new key for a new operation.
currency_requiredAn amount was sent without its `currency`. There is no default: send AMD, USD or EUR with every amount — prices, payments, invoices, links, checkout sessions with an amount, credit, and coupons with `amount_off`.
currency_mismatchA `currency` different from the price's, on something built on a `plan` (a subscription checkout or a plan's payment link). Leave it out, or send the price's own.
currency_not_enabledLive mode, USD or EUR: this currency is not switched on for the business yet. Turn it on in Settings → Bank once the bank has enabled it on the terminal. Nothing was created.
currency_off_at_bankLive mode, USD or EUR: switched on in Ronda, but the bank says the terminal does not take it. The business has to ask its bank.
amount_too_largeMore than one charge or price may be: ֏100 000 000, or 250 000.00 in USD/EUR. Usually a typo with extra zeros.
amount_too_smallA customer typed less than the minimum into a choose-your-amount payment link: ֏100, $1.00 or €1.00.
promotion_codes_need_secret_key`coupon` and `allow_promotion_codes` on a checkout session need a secret key: a publishable key is public, and anyone could use it to try codes.
auto_redirect_needs_secret_key`auto_redirect` on a checkout session needs a secret key. With a publishable key the receipt shows a Continue button instead.
success_url_required`auto_redirect: true` was sent without a `success_url` to send the customer to.
insufficient_creditA credit take-back larger than the customer's balance in that currency. Nothing changed; the message names the balance.
refund_exceeds_balanceThe refund is more than what is left on the payment after earlier refunds.
refund_not_supportedThe payment was made with Idram (`method: idram`). Idram has no refund request: the business returns the money from its Idram account and records the refund on the payment's page in the dashboard.
idram_unavailable`method: idram` on a checkout session, but Idram is not switched on for this business in this mode (Dashboard → Settings → Payment methods).
idram_not_supported`method: idram` on a checkout that Idram cannot pay: it takes one-time payments in AMD only — not subscriptions, saved cards or other currencies.
method_unavailableThe `method` named on a checkout session is not available (`telcell`).
payment_method_inactive`POST /v1/payments` named a card that has been removed. Nothing was sent to the bank.
payment_not_refundableOnly a succeeded (or partly refunded) payment can be refunded.
refund_outcome_unknownThe bank did not answer a refund, or an earlier refund on this payment is still unconfirmed. Do not refund again: the refund stays pending, its amount stays reserved, and Ronda settles it with the bank. Check `GET /v1/refunds?payment=…` later.
plan_inactiveThe price is archived. Restore it, or use one that is still offered.
velocity_ip_blockedToo many card attempts from one address in a short time — Ronda's card-testing guard. Real customers rarely see it; wait and retry.
velocity_customer_blockedToo many card attempts for one customer in a short time. Wait and retry.
velocity_merchant_blockedLive mode only: too many card attempts, or too many declined ones, for this business in a short time, whatever address they came from. New card attempts pause for the window and Ronda is alerted. If it is real traffic, contact support to raise the ceiling.
coupon_invalidThe `coupon` on a checkout session cannot be applied: it is archived, past its `redeem_by` date, used up — including when every remaining redemption is held by other open checkouts — or takes an amount off in another currency.
coupon_not_usableThe `coupon` on a payment link cannot be used now, for the same reasons as coupon_invalid.
promotion_code_invalidA code a customer typed on the hosted checkout was not accepted. They see "This code isn't valid." whatever the reason.
coupon_field_fixedWhat a coupon gives — `percent_off`, `amount_off`, `currency`, `duration`, `duration_in_months` — and its `code` cannot change once it exists; `param` names the field. Make a new coupon. To archive one, use DELETE.
coupon_archivedAn archived coupon cannot be edited or applied.
coupon_changedThe coupon was changed by someone else while this update was being made. Read it again and retry.
max_redemptions_lowered`max_redemptions` can be raised or removed (null), never lowered or set below `times_redeemed`.
coupon_currency_mismatchAn amount-off coupon is in one currency and the subscription is billed in another. Use a percentage coupon, or one in the subscription's currency.
test_mode_onlyOnly possible with a test key — simulating a renewal, for example.
charge_pending409: the bank has not answered about a charge yet; `payment` names it. Nothing changed. Ronda asks the bank and finishes it — for a plan change, `subscription.plan_changed` or `subscription.plan_change_failed` says how it ended.
subscription_busy409: a renewal or plan change on this subscription has not finished — it is at the bank, waiting for a lost reply, or applied but not yet complete; `payment` names its charge when there is one. Nothing was changed or charged. Retry after the event that ends it: a renewal's subscription.updated / recovered / past_due / canceled, a plan change's subscription.plan_changed / plan_change_failed, a first charge's subscription.activated.
subscription_changed400: the subscription changed under a plan or quantity change. `charged: false` — it changed after you read it; nothing was charged; read it again and retry. `charged: true` with `payment` — a reset or prorated/quantity change whose subscription was canceled or paused while its charge was at the bank; the plan did not change and that charge is being refunded: refund.succeeded and payment.refunded follow when the bank confirms (refund.failed first if it refuses — Ronda keeps at it); do not retry blindly.
plan_interval_mismatch400: a prorated plan change between two prices on different schedules (monthly and yearly, or a different `interval_count`). The difference for the days left cannot be worked out. Send `billing_cycle_anchor: "now"` to charge the full new price and start a new period, or `prorate: false` to change the plan with no money now.
billing_cycle_anchor_conflict400: `prorate: true` beside `billing_cycle_anchor: "now"`. A reset charges the new plan in full and gives no credit, so it cannot be prorated. Leave `prorate` out or send false.
subscription_paused400: a paused subscription cannot start a new period (`billing_cycle_anchor: "now"`). Resume it first.
subscription_past_due400: the subscription has a failed payment. Collect it first — `retry`, or a new card — then change the plan.
subscription_not_active400: only an active or trialing subscription can start a new period.
subscription_ending400: the subscription is set to cancel at the end of its period. Withdraw the cancel (`cancel_at_period_end: false`), then change the plan.
subscription_pause_scheduled400: the customer has a pause scheduled. It has to be withdrawn before the plan can change with a new period.
subscription_invoiced400: the subscription is billed by invoice, so there is no card to charge now.
renewal_due400: the subscription's renewal is due within ten minutes, overdue, or being charged. Try the change again once the renewal has gone through.
subscription_incomplete400: a pause asked for while the subscription's first charge is still being processed. Wait for subscription.activated or subscription.past_due, then pause.
idempotency_amount_mismatch409, prorated changes and quantity updates only (never a reset): a charge already exists under Ronda's own key for this change (not your Idempotency-Key) for a different amount; nothing was charged. Never permanent — a left-behind charge is given up after 10 minutes and the next request becomes a new attempt. Retry later with a fresh Idempotency-Key.
amount_changed409: the amount to charge is no longer the `expected_amount` you sent; `amount` is the new one. Nothing was charged. Show it and send it again.
plan_unchanged400: the subscription is already on that plan and quantity, so this request changed and charged nothing. `period_charge` is the earlier change that put it there, or null.
refund_failedThe bank refused the refund. The message carries its reason; nothing was refunded.
dispute_closedThe chargeback is decided or past its evidence deadline, so evidence can no longer be added.
bank_not_connectedLive payments need a bank connected on the Settings page. Test mode works without one.
onboarding_incompleteThe account has not finished onboarding, so live payments are not available yet.
live_not_openLive payments are not open for this business's bank yet. Test mode works meanwhile; retrying does not help.
fee_card_requiredLive mode: the business has not added the card Ronda bills its own fee to (Take real payments in the dashboard), so a real checkout cannot be opened yet. Test mode works without it.
url_invalidA webhook URL that does not parse as a URL.
url_insecureA webhook URL that is not https.
url_port_blockedA webhook URL on a port other than 80 or 443.
url_credentialsA webhook URL with a username or password in it. Authenticate with the signature instead.
url_blockedA webhook host that can never be reached: localhost, *.internal, *.local.
url_unresolvableThe webhook's hostname does not resolve in DNS.
url_private_addressThe webhook's hostname resolves to a private, loopback or link-local address.
own_vpos_requiredLive payments need the business's own vPOS. Test mode works without one.
account_suspendedProcessing is suspended on this account, usually for an unpaid Ronda invoice. The dashboard's Billing page says why.
rate_limit_exceededToo many requests. Wait for the number of seconds in Retry-After.
request_too_largeThe request body is over the size limit of 256 KB.
internal_errorSomething failed on Ronda's side. Retrying with the same Idempotency-Key is safe.

Decline codes

Normalised across banks, so your handling does not change when Ronda adds a second bank.

CodeWhat to do
card_declinedThe issuer refused without a specific reason. Ask the customer to try another card.
insufficient_fundsNot enough money on the card. The most common real decline — worth retrying later, which is what dunning does.
expired_cardThe card has expired. Only the customer can fix this; send them a portal link.
incorrect_cvcThe security code did not match.
authentication_required3-D Secure was required and not completed.
binding_inactiveThe saved card is no longer valid at the bank. Ask the customer to add a card again.
limit_exceededThe amount is above the card's limit.
attempts_exhaustedThe customer used every try the bank's page allows on one order, and each was refused. The bank reports only that, not why each try failed. A new checkout starts fresh.
processing_errorThe bank could not process the card. Safe to retry.
recurring_revokedThe cardholder told their bank to stop this business's automatic payments. Ronda never charges that card again: the subscription is canceled at once and the saved card is retired. The customer can add a card again in the portal.

Retrying safely

A 500 or a network timeout does not mean the payment failed — it means you do not know. Retry the request with the same Idempotency-Key: if the first attempt succeeded you get the original payment back, and if it did not, the charge happens exactly once. Never retry with a fresh key.

Rate limits

300 requests per minute per API key, and 120 per minute per IP on the unauthenticated surfaces. A publishable key also allows each visitor's IP 30 a minute, so one visitor cannot use up the key for everyone else. A 429 carries a Retry-After header in seconds. Card-testing velocity limits apply separately to checkout attempts: 10 per IP (for checkouts opened with a publishable key, where the caller is the customer's browser) and 6 per customer in a ten-minute window, and in live mode 100 per business, or 20 declined ones, across every address. A business can make at most 50 refunds in 24 hours, and POST /v1/subscriptions/:id/retry runs at most three times a day for one subscription.