ROKIConnect
Conectores Empezar API SDK Migrar MCP Portal EN
DocumentaciónReferencia del API

Referencia del API

41 operaciones. Esta pagina se genera desde la especificacion OpenAPI, asi que no puede describir un contrato que el API ya no tenga.

Base: https://aura.roki.systems/api/connect/v1. El entorno lo determina el prefijo de la llave: sk_test_ es sandbox y sk_live_ es produccion, con las mismas rutas.

Merchant

GET/meWhich merchant does this key belong to
curl "https://aura.roki.systems/api/connect/v1/me" \
  -H "Authorization: Bearer $ROKI_SECRET_KEY" \
  -H "Accept: application/json"
<?php

$request = curl_init('https://aura.roki.systems/api/connect/v1/me');
curl_setopt_array($request, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer ' . getenv('ROKI_SECRET_KEY'),
    'Accept: application/json'
  ],
]);
$response = curl_exec($request);
echo $response;
const response1 = await fetch("https://aura.roki.systems/api/connect/v1/me", {
  method: "GET",
  headers: {
    "Authorization": "Bearer " + process.env.ROKI_SECRET_KEY,
    "Accept": "application/json"
  },
});
console.log(await response1.text());
import os
from urllib.request import Request, urlopen

request = Request(
  "https://aura.roki.systems/api/connect/v1/me",
  method="GET",
  headers={
    "Authorization": "Bearer " + os.environ["ROKI_SECRET_KEY"],
    "Accept": "application/json"
  },
)
with urlopen(request) as response:
    print(response.read().decode())
using System;
using System.Net.Http;
using System.Text;

using var client = new HttpClient();

using var request1 = new HttpRequestMessage(HttpMethod.Get,
    "https://aura.roki.systems/api/connect/v1/me");
request1.Headers.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("ROKI_SECRET_KEY"));
request1.Headers.Add("Accept", "application/json");
using var response1 = await client.SendAsync(request1);
Console.WriteLine(await response1.Content.ReadAsStringAsync());
Ver contrato

Returns the merchant account the API key belongs to: the same id shown in the ROKI portal, the commercial name, and which environment the key operates in. Use it in your integration's diagnostics. The key is the only thing that identifies a merchant, so without this route the best a connector can tell someone is "the key works" - never *whose* key it is. A merchant with two ROKI accounts who pastes the wrong one gets a green light and starts taking money into the wrong account, and nothing catches it because from the API's point of view nothing is wrong. Show business_name and environment on your settings screen and that whole class of mistake becomes visible. environment is sandbox for an sk_test_ key and live for an sk_live_ key. It is worth reading rather than inferring from the key prefix: the prefix is a string convention, this field is the API stating it. Unlike the other routes there is no envelope: the three fields come back at the top level. Added 2026-08-24. Verified against the live sandbox the same day.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Respuestas

CódigoSignifica
200
The merchant this key belongs to.
401
The Authorization header is missing or the key is invalid.

Payments

GET/paymentsList payments
Ver contrato

Returns the merchant's payments, newest first, paginated. Scoped to the key's merchant and environment: a sandbox key never sees production payments. This is what makes reconciliation possible - before it existed, a payment whose id you had lost was unreachable.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.
per_page
query
no
Page size. Defaults to 20. Note limit is ignored - only per_page changes the page size.
page
query
no
1-based page number. Use meta.last_page to know when to stop.
status
query
no
Filter by payment status. An unrecognized value returns 422 rather than being ignored.
external_reference
query
no
Filter by your own order id. Since external_reference is not unique, this can return more than one payment.
from
query
no
Start of a creation-date range, YYYY-MM-DD, Honduras time.
to
query
no
End of the creation-date range, inclusive.

Respuestas

CódigoSignifica
200
A page of payments, newest first.
401
The Authorization header is missing or the key is invalid.
422
An invalid filter value, for example an unknown status.
POST/paymentsCreate a payment
Ver contrato

Creates a payment and returns a checkout_url (mode 1) plus a payment id. Set amount to the exact total your platform needs to charge for this checkout - take it from the order or cart in your backend. ROKI does not read the amount from your site. Always send Idempotency-Key so a network retry cannot create a duplicate payment.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.
Idempotency-Key
header
no
Recommended on every payment creation. Replaying the same key returns the same payment. Verified deviation from the industry standard: the same key with a different body returns the original payment with no error. The key wins and the body is ignored on replay. Derive the key from the order's content, not only from its identifier. Without it, repeating the same external_reference creates distinct payments: external_reference is not unique. On the saved-card charge endpoints this header is mandatory, not optional.

Cuerpo

CampoTipoObligatorioNotas
amount
number
sí
The exact total to charge in this checkout, in decimal units (150.50 = L 150.50), not cents. Take it from the invoice or cart in your backend. The API enforces no maximum and accepts numeric strings; enforce a sane ceiling on your side.
external_reference
string
sí
Your order id. Not unique - duplicate protection comes from Idempotency-Key.
name
string
sí
Payment label shown to the customer at checkout.
currency_code
string
no
ISO 4217 numeric code ("340" = HNL). Defaults to the terminal's currency. Only currencies enabled on that terminal are accepted.
description
string
no
metadata
object
no
Merchant-defined key/value pairs, returned untouched on retrieval and in every webhook. Not shown to the customer.
success_url
string
no
Return URL after payment. Landing there does not confirm payment. The API accepts http:// although the docs require HTTPS; always use HTTPS.
cancel_url
string
no
expires_at
string
no
Link expiry in Honduras time (UTC-6), must be in the future. Accepts YYYY-MM-DD HH:MM:SS and ISO 8601.
customer
any
no
lock_customer_fields
boolean
no
When true, every prefilled field that carries a non-empty value becomes read-only at checkout. Customer fields you do not send stay blank and remain editable even when this is true. Echoed back in create, retrieve, list and payment webhooks (verified 2026-10-28; it was not echoed before 2026-08-13).
reusable
boolean
no
false (default) makes the payment single-use: it is consumed after an approved charge. true keeps the link payable until it expires or is disabled - recommended for mode 2 remounts. With true, creating again with the same external_reference, or the same customer email/identity plus amount and currency, may return the existing payment id while it is still payable.
sales_tax_type
string
no
Tax mode. If not none, sales_tax_value is required. Computed on the subtotal only.
sales_tax_value
number
no
Fixed amount or percentage. As a percentage it cannot exceed 100.
tip_enabled
boolean
no
When true, define exactly one mode: a fixed tip (tip_type + tip_value) or customer selection (tip_customer_selectable: true). Omitting both returns 422.
tip_type
string
no
tip_value
number
no
tip_customer_selectable
boolean
no
The customer picks the tip at checkout, so the total at creation excludes it.
tip_preset_percentages
array
no
tip_allow_custom
boolean
no
tip_min_amount
number
no
Cannot exceed amount.
tip_max_amount
number
no
Cannot exceed amount - a larger value returns 422 ("Tip limits cannot be greater than the plan amount.").
service_fee_enabled
boolean
no
Per-request switch. true passes ROKI's processing costs to the customer: the checkout total is increased by reverse calculation so the merchant nets the original amount. Omitted or false means no service fee. Do not replicate the calculation. Rates, the fixed 3-D Secure charge and the threshold are per-merchant configuration. Read service_fee_amount and total from the response. Exact field name: service_fee_enabled. Variants such as service_fee or pass_fees_to_customer are silently ignored and produce a payment with no fee.

Respuestas

CódigoSignifica
201
Payment created.
401
The Authorization header is missing or the key is invalid.
422
Validation failed or a business rule was violated: required field, length, type, currency not enabled on the terminal, tip above the amount, tax percentage above 100, expiry in the past, or a missing mandatory Idempotency-Key on the charge endpoints.
GET/payments/{id}Retrieve a payment
Ver contrato

Returns the current state of the payment. Together with webhooks, this is the source of truth for confirming a charge. A customer landing on success_url is NOT payment confirmation - anyone can navigate to that URL. Confirm with this call or with the payment.approved webhook. Once paid, transaction_id holds the UUID you need for void, refund and receipts.

Parámetros

NombreEnObligatorioDescripción
id
path
sí
Numeric payment identifier returned at creation.
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Respuestas

CódigoSignifica
200
Payment found.
401
The Authorization header is missing or the key is invalid.
404
code: "payment_not_found" - no payment with that id exists for the key in use, often an id from the other environment. Three different failures share HTTP 404 here; tell them apart by code, never by the message, which is localised: - payment_not_found - well-formed identifier, no such record. - transaction_id_expected - a transaction route was given the numeric payment id. - not_found - the path is not in the router at all. This one, and only this one, carries the raw framework prose "The route ... could not be found." and stays in English.

Transaction actions

POST/payments/{transaction_id}/voidVoid a transaction
Ver contrato

Cancels an eligible transaction before settlement. Full amount only. Void acts on a transaction, identified by the transaction_id UUID from the payment response - not by the payment id. On a reusable payment link this voids only that customer's transaction; the link's other transactions are untouched. Eligibility is governed by the transaction's configured time window, not only by settlement state. Once a transaction is no longer voidable, use refund instead. Typical cases: the customer changed their mind right after paying, the order was placed by mistake, or fraud was detected before settlement.

Parámetros

NombreEnObligatorioDescripción
transaction_id
path
sí
The transaction UUID from the payment response - not the numeric payment id. Passing a numeric payment id returns 404 with code: "transaction_id_expected" and a message naming the identifier it wanted. The endpoint exists and answered; only the kind of identifier was wrong. This used to be a routing 404 ("The route ... could not be found."). It is not any more, verified 2026-08-21. Client code that classifies this error by matching the message text for "could not be found" now files it under "no such payment" and sends the developer hunting for a bad id instead of a bad identifier type. Branch on code.
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Cuerpo

CampoTipoObligatorioNotas
reason
string
no
Optional free-text reason, stored with the void.

Respuestas

CódigoSignifica
200
Transaction voided.
401
The Authorization header is missing or the key is invalid.
404
code: "payment_not_found" - transaction not found, or not owned by this merchant. If you instead get code: "transaction_id_expected", you passed the numeric payment id where a transaction UUID is required. That is a live endpoint rejecting the identifier, not a missing route. Until 2026-08-21 this case answered the routing 404 instead, so older integrations that switch on "could not be found" now misfile it as "no such payment".
422
Not voidable. errors.void carries the reason: already voided, already refunded (use refund), not in a voidable state, or already settled (use refund).
POST/payments/{transaction_id}/refundRefund a transaction
Ver contrato

Refunds part or all of an eligible settled transaction. Partial refunds leave the payment partially_refunded; a full refund sets refunded. Like void, this acts on a transaction UUID, not a payment id, so on a reusable link only that customer's transaction is refunded. Eligibility also depends on the transaction's configured time window. Attempting a refund before the transaction is eligible can return 422 with a processor rejection such as "Invalid transaction" - that text comes from the payment processor and is not a response guaranteed by ROKI. For eligible pre-settlement cancellations use void instead. Refund works identically for any Connect transaction regardless of the mode that created it, including an embedded checkout (mode 2) or a saved-card charge (mode 3A). There is no separate refund endpoint for token charges: use the id returned by the charge as the transaction_id here.

Parámetros

NombreEnObligatorioDescripción
transaction_id
path
sí
The transaction UUID from the payment response - not the numeric payment id. Passing a numeric payment id returns 404 with code: "transaction_id_expected" and a message naming the identifier it wanted. The endpoint exists and answered; only the kind of identifier was wrong. This used to be a routing 404 ("The route ... could not be found."). It is not any more, verified 2026-08-21. Client code that classifies this error by matching the message text for "could not be found" now files it under "no such payment" and sends the developer hunting for a bad id instead of a bad identifier type. Branch on code.
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Cuerpo

CampoTipoObligatorioNotas
amount
number
sí
Amount to refund, up to the remaining refundable amount.
reason
string
no

Respuestas

CódigoSignifica
200
Refund applied.
401
The Authorization header is missing or the key is invalid.
404
code: "payment_not_found" - transaction not found, or not owned by this merchant. If you instead get code: "transaction_id_expected", you passed the numeric payment id where a transaction UUID is required. That is a live endpoint rejecting the identifier, not a missing route. Until 2026-08-21 this case answered the routing 404 instead, so older integrations that switch on "could not be found" now misfile it as "no such payment".
422
Rejected. errors.amount: below 0.01, or above the remaining refundable amount. errors.refund: transaction is voided (a voided transaction cannot be refunded), not in a refundable state, or a processor rejection such as "Invalid transaction".
GET/payments/{transaction_id}/receiptGet receipt metadata
Ver contrato

Receipt metadata for one transaction. Receipts remain available after a void or refund as long as the original charge still has a transaction.

Parámetros

NombreEnObligatorioDescripción
transaction_id
path
sí
The transaction UUID from the payment response - not the numeric payment id. Passing a numeric payment id returns 404 with code: "transaction_id_expected" and a message naming the identifier it wanted. The endpoint exists and answered; only the kind of identifier was wrong. This used to be a routing 404 ("The route ... could not be found."). It is not any more, verified 2026-08-21. Client code that classifies this error by matching the message text for "could not be found" now files it under "no such payment" and sends the developer hunting for a bad id instead of a bad identifier type. Branch on code.

Respuestas

CódigoSignifica
200
Receipt metadata.
401
The Authorization header is missing or the key is invalid.
404
code: "payment_not_found" - transaction not found, or not owned by this merchant. If you instead get code: "transaction_id_expected", you passed the numeric payment id where a transaction UUID is required. That is a live endpoint rejecting the identifier, not a missing route. Until 2026-08-21 this case answered the routing 404 instead, so older integrations that switch on "could not be found" now misfile it as "no such payment".
GET/payments/{transaction_id}/receipt/downloadDownload the receipt PDF
Ver contrato

Returns the receipt as a PDF for that exact transaction.

Parámetros

NombreEnObligatorioDescripción
transaction_id
path
sí
The transaction UUID from the payment response - not the numeric payment id. Passing a numeric payment id returns 404 with code: "transaction_id_expected" and a message naming the identifier it wanted. The endpoint exists and answered; only the kind of identifier was wrong. This used to be a routing 404 ("The route ... could not be found."). It is not any more, verified 2026-08-21. Client code that classifies this error by matching the message text for "could not be found" now files it under "no such payment" and sends the developer hunting for a bad id instead of a bad identifier type. Branch on code.

Respuestas

CódigoSignifica
200
PDF document.
401
The Authorization header is missing or the key is invalid.
404
code: "payment_not_found" - transaction not found, or not owned by this merchant. If you instead get code: "transaction_id_expected", you passed the numeric payment id where a transaction UUID is required. That is a live endpoint rejecting the identifier, not a missing route. Until 2026-08-21 this case answered the routing 404 instead, so older integrations that switch on "could not be found" now misfile it as "no such payment".

Saved cards

GET/payment-methodsList a customer's saved cards
Ver contrato

Returns the saved payment methods for one customer, identified the same way as in Payments. Send customer[identity_number] (preferred) or customer[email]. A card is saved only when the customer explicitly ticks "save my card" during a normal Connect checkout. ROKI stores the processor's own token - never the card number - and emits the payment_method.saved webhook with the opaque pm_* reference. On a platform without mode 3A enabled this route answers 422 tokenized_charge_disabled, before looking at the customer. Verified 2026-09-27 on both sandbox merchants checked.

Parámetros

NombreEnObligatorioDescripción
customer[identity_number]
query
no
National identity number of the customer. Preferred identifier.
customer[email]
query
no
Customer email, when the identity number is unknown.

Respuestas

CódigoSignifica
200
The customer's saved methods, on a platform with mode 3A enabled. There, a customer with no saved cards is a normal 200 with data: [], not a 404. Without mode 3A the route never reaches this: it answers 422 tokenized_charge_disabled.
401
The Authorization header is missing or the key is invalid.
422
code: "tokenized_charge_disabled" - mode 3A (saved cards) is not enabled on this platform. Returned by GET /payment-methods, POST /payment-methods/{id}/charge and POST /payments/token-charge, before any other validation. DELETE /payment-methods/{id} is not gated and keeps answering normally. Branch on code, not on the errors key. The key changes with the route - customer on the list, payment_method_id on charge, payment_token on token-charge - so this reads like a validation error on that field, and it is not: no value of that field will fix it. Show the merchant "saved cards are not enabled for this account" and ask ROKI to enable it. The message is localized by Accept-Language ("Tokenized one-click charging is not enabled on this platform." in English). New since 2026-09-23. Before that the list answered 200 with data: [] even with the feature off, which is why an empty list used to be ambiguous.
DELETE/payment-methods/{payment_method_id}Revoke a saved card
Ver contrato

Removes a saved payment method. Later charges against it fail; revocation is not silent.

Parámetros

NombreEnObligatorioDescripción
payment_method_id
path
sí
Opaque saved-card reference, prefixed pm_.

Respuestas

CódigoSignifica
200
Payment method revoked.
401
The Authorization header is missing or the key is invalid.
404
Payment method not found.
POST/payment-methods/{payment_method_id}/chargeCharge a saved card
Ver contrato

Charges a card the customer already saved, with no new card entry. ROKI verifies that the payment method belongs to you, in the right environment, and is still usable (not revoked or expired), then charges the stored processor token. Neither your server nor the customer's browser ever sees that token. Never call this from a browser. It requires sk_*. On success, use the returned id as the transaction_id for void, refund and receipts.

Parámetros

NombreEnObligatorioDescripción
payment_method_id
path
sí
Opaque saved-card reference, prefixed pm_.
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.
Idempotency-Key
header
sí
Mandatory on this endpoint - unlike payment creation, where it is merely recommended. Use a unique key per charge attempt so a network retry can never charge twice. Omitting it returns 422.

Cuerpo

CampoTipoObligatorioNotas
amount
number
sí
currency_code
string
no
Accepts the alphabetic code here ("HNL"), unlike payment creation which uses the numeric code ("340").
external_reference
string
no
metadata
object
no

Respuestas

CódigoSignifica
201
Charge processed.
401
The Authorization header is missing or the key is invalid.
404
Payment method not found or not owned by this merchant.
422
Validation failure (including a missing Idempotency-Key), or a processor decline carrying IsoResponseCode and Errors. On a platform without mode 3A enabled, every call answers code: "tokenized_charge_disabled" - checked before anything else, so it wins even over a missing Idempotency-Key. See TokenizedChargeDisabled.
POST/payments/token-chargeCharge a saved card (alias)
Ver contrato

Equivalent to POST /payment-methods/{payment_method_id}/charge, with the saved pm_* passed in the body instead of the path. Suited to subscription renewals. Requires sk_* and Idempotency-Key. Never call it from a browser.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.
Idempotency-Key
header
sí
Mandatory. Unique per charge attempt.

Cuerpo

CampoTipoObligatorioNotas
payment_token
string
sí
The saved payment method reference.
amount
number
sí
currency_code
string
no
external_reference
string
no
metadata
object
no

Respuestas

CódigoSignifica
200
Charge processed.
401
The Authorization header is missing or the key is invalid.
422
Validation failure or processor decline. On a platform without mode 3A enabled, every call answers code: "tokenized_charge_disabled", before any other check - see TokenizedChargeDisabled.

Embedded components

POST/embed/confirmConfirm an embedded-components payment
Ver contrato

Completes a mode 2 payment. The browser tokenizes the card inside the ROKI iframe using pk_* and receives a tok_*; your backend then calls this endpoint with sk_*, the token and the amount. Full path: https://aura.roki.systems/api/connect/v1/embed/confirm The route moved under /v1. The old https://aura.roki.systems/api/connect/embed/confirm now answers 308 Permanent Redirect to this one, with an HTML body (verified 2026-10-28). A 308 keeps the method and body, so clients that follow redirects keep working - but PHP's cURL does not follow by default, and gets an HTML page where it expected JSON. Point the code at the /v1 path instead of relying on the redirect. Unknown top-level keys are rejected here with 422 unknown_field, one entry per field in errors - unlike POST /payments, which still accepts them with warnings. Extra merchant data goes in metadata. **Never put sk_* in the browser.** The frontend sends tok_* to your own server, and your server calls this endpoint. Three outcomes: approved (with full transaction_details), declined (with the processor's IsoResponseCode and Errors), or pending with an authentication_url that must be loaded so the customer can complete 3-D Secure.

Cuerpo

CampoTipoObligatorioNotas
amount
number
sí
currency_code
string
sí
Accepts "HNL" or the numeric "340".
payment_token
string
sí
The tok_* produced by the browser SDK after the customer submits the card.
publishable_key
string
sí
The same publishable key the SDK was mounted with.
external_reference
string
no
success_redirect_url
string
no
Required (verified 2026-10-28 - omitting it answers 422 success_redirect_url_required).
failed_redirect_url
string
no
Required. Means "the charge failed", not "the customer backed out".
description
string
no
metadata
object
no
Strings and numbers only. Values with 12+ digits are dropped (PAN protection) - send identity as customer.identity_number.
customer
object
no
Accepted on confirm (verified 2026-10-28) and echoed in the payment.approved webhook.
locale
string
no
Accepted (verified 2026-10-28). Alternative to the Accept-Language header for API messages.

Respuestas

CódigoSignifica
200
Outcome of the charge. Inspect status: approved, declined or pending.
401
The Authorization header is missing or the key is invalid.
422
Validation failure or processor decline.
POST/embed/checkouts/{checkout_id}/confirmConfirm an embedded checkout created by the server (obligations)
Ver contrato

Confirms a mode 2 checkout whose amount was locked on the server - today, the checkout that POST /obligations/{obligation_id}/pay creates in embed mode. Send the tok_* and the pk_*; the amount is not yours to send, it is the obligation's. Do not use POST /embed/confirm for obligations. That route charges whatever amount your backend sends and would leave the obligation unpaid. Verified 2026-10-28: an unknown id answers 404 with code: "checkout_not_found". The approved path was not exercised (it needs a real obligation and a card).

Parámetros

NombreEnObligatorioDescripción
checkout_id
path
sí
The payment id returned by POST /obligations/{obligation_id}/pay in embed mode.
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Cuerpo

CampoTipoObligatorioNotas
payment_token
string
sí
publishable_key
string
sí

Respuestas

CódigoSignifica
200
Outcome of the charge - same shapes as POST /embed/confirm.
401
The Authorization header is missing or the key is invalid.
404
code: "checkout_not_found".
422
Validation failed or a business rule was violated: required field, length, type, currency not enabled on the terminal, tip above the amount, tax percentage above 100, expiry in the past, or a missing mandatory Idempotency-Key on the charge endpoints.

Webhooks management

GET/webhooksRead the webhook endpoint of this key's environment
Ver contrato

One endpoint per environment: sk_test_* reads the sandbox endpoint, sk_live_* the production one. Returned even when status is disabled. The signing secret is always masked here (signing_secret_revealed: false). Verified 2026-10-28: 404 webhook_not_found when none is configured; 200 with the shape below when one is.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Respuestas

CódigoSignifica
200
The configured endpoint.
401
The Authorization header is missing or the key is invalid.
404
code: "webhook_not_found" - no webhook endpoint is configured for this environment.
POST/webhooksCreate the webhook endpoint, or change its URL
Ver contrato

Creates the endpoint if none exists (201, with the full whsec_* shown once and signing_secret_revealed: true), or updates the URL of the existing one (200, secret masked) - which also re-enables a disabled endpoint and merges any newly documented event types into enabled_events. Idempotency-Key is mandatory. Same key and same body replays safely; same key with a different body answers 409 idempotency_conflict. Use a fresh key for every new action. Verified 2026-10-28: no key answers 422 idempotency_key_required; an http:// URL answers 422 webhook_url_https. Creation and update were not exercised against a real merchant endpoint, to avoid replacing a live integration's URL.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.
Idempotency-Key
header
sí
Mandatory on this route. Same key and same body replays the original result; same key with a different body answers 409 idempotency_conflict - here, unlike payment creation, the body is fingerprinted. Use a fresh key for every new action. A missing key is reported as idempotency_key_required on most routes, but as idempotency_key_invalid on POST /obligations/{obligation_id}/pay (verified 2026-10-28).

Cuerpo

CampoTipoObligatorioNotas
webhook_url
string
sí

Respuestas

CódigoSignifica
200
URL updated. Secret masked.
201
Endpoint created. The only response that carries the full signing secret, besides rotation.
401
The Authorization header is missing or the key is invalid.
409
code: "idempotency_conflict" - the same Idempotency-Key was already used with a different body.
422
idempotency_key_required, or webhook_url_https when the URL is not https.
POST/webhooks/rotate-secretIssue a new signing secret
Ver contrato

Returns the new whsec_* in plain text, once. Idempotency-Key is mandatory: replaying the same key returns the same secret instead of rotating again; a new key rotates again. Works on a disabled endpoint. 404 webhook_not_found when there is no endpoint. Rotating breaks signature verification on your server until you deploy the new secret. Update the server first, then rotate. Not exercised by us for that reason.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.
Idempotency-Key
header
sí
Mandatory on this route. Same key and same body replays the original result; same key with a different body answers 409 idempotency_conflict - here, unlike payment creation, the body is fingerprinted. Use a fresh key for every new action. A missing key is reported as idempotency_key_required on most routes, but as idempotency_key_invalid on POST /obligations/{obligation_id}/pay (verified 2026-10-28).

Respuestas

CódigoSignifica
200
New secret, revealed once.
401
The Authorization header is missing or the key is invalid.
404
code: "webhook_not_found" - no webhook endpoint is configured for this environment.
409
code: "idempotency_conflict" - the same Idempotency-Key was already used with a different body.
POST/webhooks/disablePause delivery
Ver contrato

Sets status: disabled. No event of any type is delivered while paused, and POST /webhooks/test is refused. URL and secret are kept. No Idempotency-Key needed. Events that occur while paused are not queued for later - catch up with GET /payments.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Respuestas

CódigoSignifica
200
Endpoint, secret masked.
401
The Authorization header is missing or the key is invalid.
404
code: "webhook_not_found" - no webhook endpoint is configured for this environment.
POST/webhooks/enableResume delivery
Ver contrato

Sets status: active again, without changing URL or secret. No Idempotency-Key needed.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Respuestas

CódigoSignifica
200
Endpoint, secret masked.
401
The Authorization header is missing or the key is invalid.
404
code: "webhook_not_found" - no webhook endpoint is configured for this environment.
POST/webhooks/testSend a signed webhook.test ping
Ver contrato

ROKI posts a signed webhook.test event to the saved URL. It is not written to the delivery history. The HTTP status of this call is 200 whenever ROKI could run the ping; whether your server accepted it is in the body: delivered and code (webhook_test_delivered for a 2xx, webhook_test_failed for any other status, webhook_test_unreachable for a timeout or connection error). 422 webhook_disabled while the endpoint is paused. Use it to check that your signature verification accepts ROKI's real signature.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Respuestas

CódigoSignifica
200
The ping ran. Read delivered.
401
The Authorization header is missing or the key is invalid.
404
code: "webhook_not_found" - no webhook endpoint is configured for this environment.
422
Validation failed or a business rule was violated: required field, length, type, currency not enabled on the terminal, tip above the amount, tax percentage above 100, expiry in the past, or a missing mandatory Idempotency-Key on the charge endpoints.
GET/webhooks/deliveriesList recent delivery attempts
Ver contrato

Outgoing deliveries of real events for this environment's endpoint (never webhook.test). Rows are processed by a queue worker; if it is stopped they stay pending. 404 webhook_not_found when no endpoint is configured. Verified 2026-10-28 in production (read only): paginated {data, meta} with the fields below.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.
status
query
no
page
query
no
per_page
query
no

Respuestas

CódigoSignifica
200
A page of delivery attempts.
401
The Authorization header is missing or the key is invalid.
404
code: "webhook_not_found" - no webhook endpoint is configured for this environment.

Obligations

GET/obligationsLook up a customer's open obligations (Collections, Education)
Ver contrato

Finds the payer by at least one identifier and lists what they owe: Collections invoices (col_inv_{id}, payable), Education installments (edu_inst_{id}, payable unless an earlier unpaid installment blocks them) and fiscal invoices (fis_inv_{id}, informative only - pay the linked Collections invoice instead). Verified 2026-10-28: no identifier answers 422 identifier_invalid; an unknown identifier answers 200 with empty obligations and meta.count: 0, not a 404.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.
national_id
query
no
rtn
query
no
student_code
query
no
customer_code
query
no
CUST-{id}.

Respuestas

CódigoSignifica
200
The matching party and their obligations.
401
The Authorization header is missing or the key is invalid.
422
identifier_invalid - none of national_id, rtn, student_code or customer_code was sent.
GET/obligations/{obligation_id}Read one obligation
Ver contrato

Verified 2026-10-28: an obligation that does not exist (or is not this merchant's) answers 422 with code: "obligation_invalid", not 404.

Parámetros

NombreEnObligatorioDescripción
obligation_id
path
sí
Public obligation id: col_inv_{id} (Collections invoice), edu_inst_{id} (Education installment) or fis_inv_{id} (fiscal invoice - informative, not payable).
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Respuestas

CódigoSignifica
200
The obligation.
401
The Authorization header is missing or the key is invalid.
422
code: "obligation_invalid" - the obligation does not exist or is not this merchant's. Note the status: 422, not 404 (verified 2026-10-28).
POST/obligations/{obligation_id}/payCreate a payment locked to an obligation's amount
Ver contrato

mode: embed (default, mode 2) returns a checkout id to confirm with POST /embed/checkouts/{checkout_id}/confirm - not POST /embed/confirm. mode: hosted (mode 1) returns a checkout_url with the payer's contact details locked. After approval ROKI marks the obligation paid and sends payment.approved. Idempotency-Key is mandatory: the same key for the same obligation returns the existing payment; the same key for another obligation answers 409 idempotency_conflict. The optional amount must equal the obligation's locked total. Verified 2026-10-28: missing key answers 422 with code: "idempotency_key_invalid" (not _required as on other routes); an invalid mode answers 422 mode_invalid; an unknown obligation 422 obligation_invalid. The success path needs a real obligation and was not exercised.

Parámetros

NombreEnObligatorioDescripción
obligation_id
path
sí
Public obligation id: col_inv_{id} (Collections invoice), edu_inst_{id} (Education installment) or fis_inv_{id} (fiscal invoice - informative, not payable).
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.
Idempotency-Key
header
sí
Mandatory on this route. Same key and same body replays the original result; same key with a different body answers 409 idempotency_conflict - here, unlike payment creation, the body is fingerprinted. Use a fresh key for every new action. A missing key is reported as idempotency_key_required on most routes, but as idempotency_key_invalid on POST /obligations/{obligation_id}/pay (verified 2026-10-28).

Cuerpo

CampoTipoObligatorioNotas
mode
string
no
external_reference
string
no
amount
number
no
Must equal the obligation total when sent.

Respuestas

CódigoSignifica
200
The payment for this obligation.
401
The Authorization header is missing or the key is invalid.
409
code: "idempotency_conflict" - the same Idempotency-Key was already used with a different body.
422
code: "obligation_invalid" - the obligation does not exist or is not this merchant's. Note the status: 422, not 404 (verified 2026-10-28).

Automatic debit

GET/automatic-debit/agreementRead the merchant's automatic-debit agreement
Ver contrato

The active agreement template (template.name, template.terms_text as HTML, localized by Accept-Language), whether enrolment is possible (ready) and the allowed scopes. Show terms_text to the customer before enrolling. Verified 2026-10-28 on a merchant with no template: 200 with ready: false, template: null and a message explaining why - not an error status.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Respuestas

CódigoSignifica
200
The agreement, or why there is none.
401
The Authorization header is missing or the key is invalid.
POST/automatic-debit/authorizationsEnrol a card for automatic debit (1.00 HNL + 3DS + void)
Ver contrato

Same flow as the merchant portal: ROKI charges 1.00 HNL with 3-D Secure, voids it, and saves the card (pm_* plus the signed agreement) only if the processor returns a PAN token. This is not capture/release of a hold. This route takes the card number (card_pan, card_cvv) in your backend's request. That puts your server in PCI scope for card data - it is the one Connect route that does. Prefer sharing the merchant's hosted enrolment URL (/automatic-debit/{merchant-slug}) when you can. The answer is status: requires_action with an authentication_url (signed, expiring): redirect the customer there. Final states: succeeded (has payment_method_id), incomplete (3DS and void succeeded but no PAN token - do not charge), failed. Verified 2026-10-28 on a merchant with no agreement template: 422 automatic_debit_not_configured, returned before the Idempotency-Key check. The enrolment itself was not exercised.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.
Idempotency-Key
header
sí
Mandatory on this route. Same key and same body replays the original result; same key with a different body answers 409 idempotency_conflict - here, unlike payment creation, the body is fingerprinted. Use a fresh key for every new action. A missing key is reported as idempotency_key_required on most routes, but as idempotency_key_invalid on POST /obligations/{obligation_id}/pay (verified 2026-10-28).

Cuerpo

CampoTipoObligatorioNotas
customer
object
sí
internal_reference
string
sí
The "contract / account number" reference, as in the portal.
card_pan
string
sí
Card number. Puts your backend in PCI scope.
card_expiry_month
string
sí
card_expiry_year
string
sí
card_cvv
string
sí
scope
string
sí
cap_per_charge
number
no
Optional ceiling per charge.
terms_accepted
boolean | string | integer
sí
Must be true (also accepts 1, "true", "1", "yes", "on").
signature
string
no
Optional PNG data-URL.
success_url
string
no
cancel_url
string
no

Respuestas

CódigoSignifica
201
Created; 3DS required.
401
The Authorization header is missing or the key is invalid.
409
code: "idempotency_conflict" - the same Idempotency-Key was already used with a different body.
422
automatic_debit_not_configured when the merchant has no active agreement template, or a validation error.
GET/automatic-debit/authorizations/{authorization_id}Read an enrolment
Ver contrato

Verified 2026-10-28: an unknown id answers 422 with code: "automatic_debit_authorization_not_found", not 404.

Parámetros

NombreEnObligatorioDescripción
authorization_id
path
sí
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Respuestas

CódigoSignifica
200
The enrolment.
401
The Authorization header is missing or the key is invalid.
422
Validation failed or a business rule was violated: required field, length, type, currency not enabled on the terminal, tip above the amount, tax percentage above 100, expiry in the past, or a missing mandatory Idempotency-Key on the charge endpoints.

Payment authorizations

POST/payment-authorizationsCreate a hold (authorize now, capture or release later)
Ver contrato

A generic authorization hold - not a sale, not automatic debit. Send the customer to pay_url (card + 3DS). Once authorized, capture the full amount or release it. Idempotency-Key is mandatory (max 64). expires_at is Honduras time Y-m-d H:i:s, future and within 30 days. Verified 2026-10-28: - 201 with status: active, a reference like PAH-2026-00001 (its sequence is not the id) and pay_url; customer is always an object, all-null when none was sent. - currency_code must be numeric ("340"): "HNL" answers 422 currency_code_invalid, unlike POST /embed/confirm and POST /sales/sessions, which take either. - Unknown fields are dropped with no warnings - the response gives no sign a misspelled field was ignored. Validate locally. - expires_at 40 days out answers 422 expires_at_invalid. - No key: 422 idempotency_key_required once the body is otherwise valid; with an invalid body the field errors come first.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.
Idempotency-Key
header
sí
Mandatory on this route. Same key and same body replays the original result; same key with a different body answers 409 idempotency_conflict - here, unlike payment creation, the body is fingerprinted. Use a fresh key for every new action. A missing key is reported as idempotency_key_required on most routes, but as idempotency_key_invalid on POST /obligations/{obligation_id}/pay (verified 2026-10-28).

Cuerpo

CampoTipoObligatorioNotas
amount
number
sí
currency_code
string
sí
Numeric only - "HNL" answers 422 currency_code_invalid.
expires_at
string
sí
Honduras time Y-m-d H:i:s, future, within 30 days.
success_url
string
sí
cancel_url
string
sí
description
string
no
customer
object
no

Respuestas

CódigoSignifica
200
Idempotent replay of the same key and body - the original hold.
201
Hold created, status: active.
401
The Authorization header is missing or the key is invalid.
409
code: "idempotency_conflict" - the same Idempotency-Key was already used with a different body.
422
Validation failed or a business rule was violated: required field, length, type, currency not enabled on the terminal, tip above the amount, tax percentage above 100, expiry in the past, or a missing mandatory Idempotency-Key on the charge endpoints.
GET/payment-authorizations/{payment_authorization_id}Read a hold
Ver contrato

States: active, authorized, captured, released, expired. Verified 2026-10-28: an unknown id answers 404 with the generic code: "not_found" (no specific code).

Parámetros

NombreEnObligatorioDescripción
payment_authorization_id
path
sí
The numeric id of the hold (not its PAH-... reference).
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Respuestas

CódigoSignifica
200
The hold.
401
The Authorization header is missing or the key is invalid.
404
code: "not_found".
POST/payment-authorizations/{payment_authorization_id}/captureCapture the full authorized amount
Ver contrato

Only from authorized; no partial capture. On success the hold becomes captured and ROKI emits payment.approved with data.object = "payment_authorization". Verified 2026-10-28: capturing an active (not yet authorized) hold answers 422 payment_authorization_invalid. A successful capture needs a card through 3DS and was not exercised.

Parámetros

NombreEnObligatorioDescripción
payment_authorization_id
path
sí
The numeric id of the hold (not its PAH-... reference).
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Respuestas

CódigoSignifica
200
Captured.
401
The Authorization header is missing or the key is invalid.
422
Validation failed or a business rule was violated: required field, length, type, currency not enabled on the terminal, tip above the amount, tax percentage above 100, expiry in the past, or a missing mandatory Idempotency-Key on the charge endpoints.
POST/payment-authorizations/{payment_authorization_id}/releaseRelease (void) an authorized hold
Ver contrato

reason is required (max 255), notes optional (max 2000); both are echoed as release_reason / release_notes. The row is kept with status: released. Verified 2026-10-28: no reason answers 422 reason_invalid; releasing an active hold answers 422 payment_authorization_invalid - an unauthorized hold cannot be released, it simply expires.

Parámetros

NombreEnObligatorioDescripción
payment_authorization_id
path
sí
The numeric id of the hold (not its PAH-... reference).
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Cuerpo

CampoTipoObligatorioNotas
reason
string
sí
notes
string
no

Respuestas

CódigoSignifica
200
Released.
401
The Authorization header is missing or the key is invalid.
422
Validation failed or a business rule was violated: required field, length, type, currency not enabled on the terminal, tip above the amount, tax percentage above 100, expiry in the past, or a missing mandatory Idempotency-Key on the charge endpoints.

Recurring

GET/recurringList recurring arrangements
Ver contrato

Verified 2026-10-28: paginated {data, meta}. The status filter is not validated - ?status=bogus answers 200 (unlike GET /payments, which answers 422 status_invalid), so a typo in the filter silently returns an unfiltered or empty list.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.
status
query
no
per_page
query
no
page
query
no

Respuestas

CódigoSignifica
200
A page of arrangements.
401
The Authorization header is missing or the key is invalid.
POST/recurringCreate a recurring arrangement on a saved card
Ver contrato

Anchored to a saved pm_* (enrolled through automatic debit). Starts as pending_activation; the first successful charge makes it active. frequency: weekly, biweekly, monthly, quarterly, yearly. billing_day (1-31) applies to monthly, quarterly and yearly only. Verified 2026-10-28 on a platform without recurring enabled: 422 with code: "payment_method_id_invalid" and the message "Recurring payments are not enabled on this platform." - in English whatever Accept-Language says, and filed under payment_method_id although no value of that field will fix it. frequency: daily answers 422 frequency_invalid. Creation itself was not exercised.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Cuerpo

CampoTipoObligatorioNotas
payment_method_id
string
sí
amount
number
sí
currency_code
string
sí
frequency
string
sí
billing_day
integer
no
monthly / quarterly / yearly only.
description
string
no
external_reference
string
no

Respuestas

CódigoSignifica
201
Created, pending_activation.
401
The Authorization header is missing or the key is invalid.
422
Validation failed or a business rule was violated: required field, length, type, currency not enabled on the terminal, tip above the amount, tax percentage above 100, expiry in the past, or a missing mandatory Idempotency-Key on the charge endpoints.
DELETE/recurring/{recurring_id}Cancel a recurring arrangement
Ver contrato

No refund is issued. Idempotent: cancelling again answers 200. The pm_* is not revoked.

Parámetros

NombreEnObligatorioDescripción
recurring_id
path
sí
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Respuestas

CódigoSignifica
200
Cancelled.
401
The Authorization header is missing or the key is invalid.
404
code: "not_found".
GET/recurring/{recurring_id}Read a recurring arrangement
Ver contrato

Verified 2026-10-28: an unknown id answers 404 with the generic code: "not_found" and the message "Recurring arrangement not found." in English whatever Accept-Language says - the recurring routes are not localized yet. Branch on code.

Parámetros

NombreEnObligatorioDescripción
recurring_id
path
sí
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Respuestas

CódigoSignifica
200
The arrangement.
401
The Authorization header is missing or the key is invalid.
404
code: "not_found".
POST/recurring/{recurring_id}/chargeTrigger a merchant-initiated charge (no 3DS)
Ver contrato

Off-session MIT charge (ThreeDSecure:false, Recurring:true at the processor). Amount defaults to the plan's; send amount to override. Idempotency-Key is mandatory - the same key returns the existing charge without charging again. On success next_billing_at advances and a pending_activation arrangement becomes active. A decline answers 200 with status: "failed" - not a 4xx. Check status. Verified 2026-10-28: no key answers 422 idempotency_key_required. A real charge was not exercised.

Parámetros

NombreEnObligatorioDescripción
recurring_id
path
sí
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.
Idempotency-Key
header
sí
Mandatory on this route. Same key and same body replays the original result; same key with a different body answers 409 idempotency_conflict - here, unlike payment creation, the body is fingerprinted. Use a fresh key for every new action. A missing key is reported as idempotency_key_required on most routes, but as idempotency_key_invalid on POST /obligations/{obligation_id}/pay (verified 2026-10-28).

Cuerpo

CampoTipoObligatorioNotas
amount
number
no

Respuestas

CódigoSignifica
200
Charge declined (status: failed) - or an idempotent replay.
201
Charge approved.
401
The Authorization header is missing or the key is invalid.
404
code: "not_found".
422
Validation failed or a business rule was violated: required field, length, type, currency not enabled on the terminal, tip above the amount, tax percentage above 100, expiry in the past, or a missing mandatory Idempotency-Key on the charge endpoints.

Hosted fields

POST/sales/sessionsCreate a locked sale session (mode 4, hosted fields)
Ver contrato

Mode 4: you build the whole checkout page; ROKI hosts only three iframes (card number, expiry, CVV) mounted with pk_* + this session's client_secret. Amount, currency and customer are locked here, server-side - the browser cannot change them. There is no tok_* and no separate confirm: fields.pay() charges the session. Fulfil from the signed payment.approved / payment.failed webhooks, as in every other mode. Idempotency-Key is mandatory. expires_at (Honduras time) is optional; the default is 30 minutes after creation. Verified 2026-10-28: - 201 with session_id and client_secret (only in this first response), status: open. - Same key and body answers 200 with the same session and no client_secret; same key with another body answers 409 idempotency_conflict. - currency_code is echoed as sent: "HNL" comes back "HNL", "340" comes back "340". Do not compare it against a fixed form. - Unknown fields are ignored and reported in warnings, like POST /payments. - Missing fields are all reported at once; code names one of them (see the multi-error trap in ValidationError). A past expires_at answers 422 expires_at_invalid.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.
Idempotency-Key
header
sí
Mandatory on this route. Same key and same body replays the original result; same key with a different body answers 409 idempotency_conflict - here, unlike payment creation, the body is fingerprinted. Use a fresh key for every new action. A missing key is reported as idempotency_key_required on most routes, but as idempotency_key_invalid on POST /obligations/{obligation_id}/pay (verified 2026-10-28).

Cuerpo

CampoTipoObligatorioNotas
amount
number
sí
currency_code
string
sí
"HNL" or "340"; echoed back as sent.
external_reference
string
sí
description
string
no
metadata
object
no
expires_at
string
no
Honduras time, future. Default: 30 minutes after creation.
three_ds_return_url
string
no
Optional; not the challenge URL - mode 4 runs 3DS in a modal.
customer
object
sí

Respuestas

CódigoSignifica
200
Idempotent replay - same session, without client_secret.
201
Session created. Send client_secret to your frontend; it is not shown again.
401
The Authorization header is missing or the key is invalid.
409
code: "idempotency_conflict" - the same Idempotency-Key was already used with a different body.
422
Validation failed or a business rule was violated: required field, length, type, currency not enabled on the terminal, tip above the amount, tax percentage above 100, expiry in the past, or a missing mandatory Idempotency-Key on the charge endpoints.
GET/sales/sessions/{session_id}Read a sale session's state
Ver contrato

open, paid (adds transaction_id, brand, last4, paid_at), or closed/expired. This is a status check, not the webhook body. Verified 2026-10-28: 200 for an open session; unknown id answers 404 with code: "not_found".

Parámetros

NombreEnObligatorioDescripción
session_id
path
sí
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Respuestas

CódigoSignifica
200
The session (never includes client_secret).
401
The Authorization header is missing or the key is invalid.
404
code: "not_found".

OAuth

POST/oauth/account-lookupDoes this email already have a ROKI merchant account (partners only)
Ver contrato

For OAuth partners, before starting "Continue with Roki". HTTP Basic only: user = OAuth client_id, password = the partner secret ps_* ROKI issues with the app. Not a merchant sk_* - a Bearer secret key is refused. 60 requests per minute per client (429 account_lookup_rate_limited with Retry-After). exists: true does not mean Connect is ready for that merchant; still run authorize. Verified 2026-10-28: without Basic auth, with a Bearer sk_*, or with an unknown client, 401 with code: "account_lookup_unauthorized". A successful lookup needs partner credentials we do not have.

Parámetros

NombreEnObligatorioDescripción
Accept-Language
header
no
Language of API messages and validation errors, es or en. Regional variants such as en-US or es-HN resolve to their base language. Spanish is the default: requests with no header, an empty header or an unsupported language get Spanish. Does not affect routing errors (404 route not found, 405), which are always English. In mode 2 the SDK locale option controls the iframe; send Accept-Language separately on confirm.

Cuerpo

CampoTipoObligatorioNotas
email
string
sí

Respuestas

CódigoSignifica
200
Lookup result.
401
account_lookup_unauthorized.
429
account_lookup_rate_limited; honour Retry-After.
POST/oauth/tokenExchange an authorization code, or refresh a token (Continue with Roki)
Ver contrato

application/x-www-form-urlencoded, public PKCE client - there is no client secret. - grant_type=authorization_code with client_id, the exact same redirect_uri used in authorize, code (single use) and code_verifier. - grant_type=refresh_token with client_id and refresh_token. Refresh tokens rotate: each success revokes the one you sent; store only the newest. Omit scope to keep the grant (you can only narrow it, never widen it). Access tokens last about an hour (expires_in, or the JWT exp); refresh tokens about 30 days. Use the access token as Authorization: Bearer on Connect routes; the refresh token is valid only here. Errors are OAuth JSON - error (stable, English) and error_description (localized): invalid_client, invalid_grant (redirect mismatch, reused code or rotated refresh token), invalid_scope. Verified 2026-10-28: an unknown client_id answers 401 {"error":"invalid_client"} for both grants. A real exchange needs a registered partner app.

Base: https://aura.roki.systems

Cuerpo

CampoTipoObligatorioNotas
grant_type
string
sí
client_id
string
sí
redirect_uri
string
no
code
string
no
code_verifier
string
no
refresh_token
string
no
scope
string
no

Respuestas

CódigoSignifica
200
Tokens.
400
OAuth error.
401
invalid_client.
GET/oauth/authorizeStart Continue with Roki (browser redirect, Authorization Code + PKCE)
Ver contrato

A URL you redirect the merchant's browser to, not an API call. The merchant signs in to the ROKI portal and approves (or reduces) the requested scopes; ROKI redirects to redirect_uri with code and your state, or with error=access_denied if they cancel. Verify state before exchanging the code. Scopes: connect (full access) or any of connect.identity, connect.payments, connect.payment_methods, connect.webhooks, connect.obligations, connect.automatic_debit, connect.payment_authorizations, connect.recurring, connect.sales. A Connect call without the needed scope answers 403 insufficient_scope. sk_* keys are never scope-limited. Partner apps are provisioned by ROKI (sandbox and live have different client_ids and an allow-list of exact redirect URIs). Verified 2026-10-28: an unknown client_id answers 401 invalid_client as JSON rather than redirecting.

Base: https://aura.roki.systems

Parámetros

NombreEnObligatorioDescripción
client_id
query
sí
redirect_uri
query
sí
response_type
query
sí
scope
query
sí
state
query
sí
code_challenge
query
sí
Base64-URL(SHA-256(code_verifier)).
code_challenge_method
query
sí
locale
query
no
prompt
query
no
consent forces the Allow screen every time.

Respuestas

CódigoSignifica
302
Redirect to the ROKI sign-in / consent screen
401
invalid_client.

Webhooks entrantes

POSTpaymentEventPayment event sent by ROKI
Ver contrato

ROKI sends a signed POST to the HTTPS endpoint registered in the portal (/merchant/connect/webhooks), with separate URLs and signing secrets per environment. Signature verification (mandatory): header ROKI-Signature: t={timestamp},v1={hex}. Compute HMAC-SHA256(timestamp + "." + raw body, secret) over the raw request body - the exact bytes received, before any JSON parsing - and compare in constant time. Invalid signature: respond 400. Valid: respond 200 within 15 seconds and process asynchronously. Retries (ROKI's documented schedule, not timed by us): any non-2xx or timeout is retried - 5 attempts in all, 1 immediate then after 1 min, 5 min, 15 min and 1 h (about 81 minutes), always with the same event id. Deduplicate on it. There is no resend from the portal; recover with GET /payments. Since 2026-10-28 the endpoint can also be managed by API (/webhooks), and a webhook.test ping can be requested with POST /webhooks/test. Void and refund events are emitted whether the action came from the API or from the portal.

Parámetros

NombreEnObligatorioDescripción
ROKI-Signature
header
sí

Cuerpo

CampoTipoObligatorioNotas
id
string
sí
Unique event id. Deduplicate on it - events can be redelivered.
type
any
sí
created_at
string
sí
data
object
sí
For payment events, the affected payment (refund events add refund_amount, refunded_at and refund_reason). For payment_method.saved, a PaymentMethod object.

Respuestas

CódigoSignifica
200
Event accepted.
400
Invalid signature - the merchant rejects the event.