Errors
The error shape and every code the API returns.
Every non-2xx response has the same body. Branch on type and code; message is for people and may change.
{
"error": {
"type": "invalid_request_error",
"code": "invalid_amount",
"message": "amount is required, in minor units (e.g. 1999 for $19.99).",
"param": "amount",
"request_id": "req_01KA4XZY8T2R5M7P1Q4W6E8R0T",
"doc_url": "https://runepay.co/docs/api/errors#invalid_amount"
}
}| Field | |
|---|---|
type | One of the 6 types below. |
code | A stable, machine-readable code from the tables below. |
message | A human-readable explanation. |
param | The parameter at fault, as a path such as enabled_events[1], when there is one. |
object_id | Only on secret_not_replayable: the object the original request created or changed. |
request_id | The same value as the Request-Id response header. Quote it when you contact support. |
doc_url | A link to this page, at the code. |
Unknown body parameters are rejected with parameter_unknown, so typos fail loudly instead of being ignored.
invalid_request_error
The request was wrong: a missing or malformed parameter, an object that does not exist, or one in the wrong state. Fix the request before retrying.
| Code | Status | Meaning |
|---|---|---|
invalid_json | 400 | The request body is not valid JSON or is not a JSON object. |
body_too_large | 413 | The request body is larger than 256 KB. |
invalid_line_items | 400 | Pass 1–100 valid inline price_data line items. |
invalid_expires_at | 400 | expires_at must be 30 minutes to 24 hours from now. |
parameter_missing | 400 | A required parameter is missing. |
parameter_unknown | 400 | The request has a parameter this endpoint does not accept. |
parameter_invalid_string | 400 | The parameter must be a string. |
parameter_invalid_integer | 400 | The parameter must be an integer. |
parameter_invalid_number | 400 | The parameter must be a number. |
parameter_invalid_boolean | 400 | The parameter must be true or false. |
parameter_invalid_array | 400 | The parameter must be an array. |
parameter_invalid_object | 400 | The parameter must be an object. |
parameter_invalid_empty | 400 | The parameter must not be empty. |
parameter_invalid_value | 400 | The parameter's value is not allowed (out of range, wrong format, or not one of the listed values). |
invalid_limit | 400 | limit must be an integer from 1 to 100. |
invalid_cursor | 400 | starting_after is not an object this key can see. |
invalid_created | 400 | A created[…] filter is not a unix timestamp in seconds. |
invalid_status | 400 | status is not one of the allowed values. |
invalid_amount | 400 | The amount is missing, not a positive integer in minor units, or outside what the object allows. |
invalid_currency | 400 | The currency is not a three-letter ISO 4217 code. |
unsupported_currency | 400 | The currency is not enabled for this account. |
invalid_url | 400 | The URL is not an allowed absolute URL (http(s) for redirects, public HTTPS for webhooks). |
invalid_email | 400 | The email address is not valid. |
invalid_name | 400 | name is missing or too long. |
invalid_description | 400 | description is not a string or is too long. |
invalid_active | 400 | active must be true or false. |
invalid_events | 400 | enabled_events must be a nonempty list of event types. |
invalid_event | 400 | event_id is required. |
invalid_immediate | 400 | immediate must be a boolean. |
invalid_request | 400 | Required parameters are missing or malformed. |
invalid_input | 400 | The hosted checkout request is malformed. |
invalid_action | 400 | The hosted checkout action is not recognised. |
invalid_dispute | 400 | The dispute data from the processor is not valid. |
missing_payment | 400 | payment is required. |
missing_token | 400 | The card token is missing. |
unsupported | 400 | The operation is not supported for this payment or processor. |
not_found | 404 | No such object for this key's organization and mode. |
payment_link_unavailable | 404 | The payment link cannot take payments right now (503 when the cause is temporary). |
payment_link_inactive | 410 | The payment link is deactivated. |
checkout_expired | 410 | The checkout session has expired. |
checkout_closed | 409 | The checkout session is already complete. |
amount_out_of_range | 400 | The buyer-chosen amount is outside the payment link's min_amount and max_amount. |
invalid_payment_transition | 409 | The payment cannot move to that status from its current one. |
payment_in_progress | 409 | The payment already has a processor attempt in progress. |
payment_not_confirmable | 409 | The payment cannot be confirmed in its current status. |
not_refundable | 409 | The payment cannot be refunded in its current status, or the amount exceeds what is left. |
refund_not_ready | 409 | The processor reported a refund before RunePay recorded it. |
processor_mismatch | 409 | The processor's data does not match the payment. |
endpoint_disabled | 409 | The webhook endpoint is disabled. Enable it first. |
rotation_in_progress | 409 | A previous signing secret is still in its overlap window. Wait, or rotate with immediate: true. |
authentication_error
No API key, or an unknown or revoked one.
| Code | Status | Meaning |
|---|---|---|
invalid_api_key | 401 | No API key, or the key is unknown or revoked. Send Authorization: Bearer sk_…. |
permission_error
The key is valid but may not do this: a publishable key, a live key on an account that is not live yet, or a paused account.
| Code | Status | Meaning |
|---|---|---|
secret_key_required | 403 | The endpoint needs a secret key (sk_…); publishable keys are refused. |
permission_denied | 403 | The key lacks the scope this endpoint needs. Reserved for restricted keys (rk_…). |
account_not_ready | 403 | The merchant account is not set up to take payments. |
account_not_live | 403 | The organization is not approved for live payments yet; use a test key. |
account_paused | 403 | Payments are paused for this account. |
checkout_challenge_required | 403 | The buyer must complete a challenge before paying. |
checkout_challenge_invalid | 403 | The buyer's challenge response is not valid. |
idempotency_error
The Idempotency-Key conflicts with an earlier request. See Idempotency.
| Code | Status | Meaning |
|---|---|---|
key_reused | 422 | The Idempotency-Key was already used with a different request. |
in_progress | 409 | A request with this Idempotency-Key is still in progress. |
secret_not_replayable | 409 | The request with this Idempotency-Key succeeded, but its response held a secret that is never stored. object_id names the object: retrieve it, or rotate its secret. |
rate_limit_error
Too many requests. Back off and retry.
| Code | Status | Meaning |
|---|---|---|
rate_limited | 429 | Too many requests. Reserved; rate limits are not enforced yet. |
checkout_rate_limited | 429 | Too many checkout attempts from this buyer. Try again later. |
checkout_attempt_limit | 429 | Too many payment attempts on this checkout. |
api_error
A problem on RunePay's side or upstream. A retry with the same Idempotency-Key returns this same stored error and never runs the operation twice; see Idempotency before retrying with a new key.
| Code | Status | Meaning |
|---|---|---|
not_configured | 503 | The API is not configured on this deployment. |
internal | 500 | Something went wrong on RunePay's side. Retry with the same Idempotency-Key. |
checkout_unavailable | 503 | Checkout is temporarily unavailable. |
payment_unavailable | 503 | The payment could not be processed right now. Try again. |
processor_unavailable | 503 | The card processor is unavailable. Try again. |
risk_screening_unavailable | 503 | Risk screening is unavailable, so the payment was not attempted. Try again. |
no_test_processor | 500 | Test mode has no processor configured. |