ROKIConnect

Referencia del API

12 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.

GET/paymentsList payments

Parametros

NombreEnObligatorioDescripcion
per_pagequerynoPage size. Defaults to 20. **Note `limit` is ignored** - only `per_page` changes the
pagequeryno1-based page number. Use `meta.last_page` to know when to stop.
statusquerynoFilter by payment status. An unrecognized value returns `422` rather than being ignored.
external_referencequerynoFilter by your own order id. Since `external_reference` is not unique, this can return
fromquerynoStart of a creation-date range, `YYYY-MM-DD`, Honduras time.
toquerynoEnd of the creation-date range, inclusive.

Respuestas

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

Cuerpo

CampoTipoObligatorioNotas
amountnumbersiThe exact total to charge in this checkout, in decimal units (150.50 = L 150.50),
external_referencestringsiYour order id. **Not unique** - duplicate protection comes from `Idempotency-Key`.
namestringsiPayment label shown to the customer at checkout.
currency_codestringnoISO 4217 **numeric** code (`"340"` = HNL). Defaults to the terminal's currency. Only
descriptionstringno
metadataobjectnoMerchant-defined key/value pairs, returned untouched on retrieval and in every webhook.
success_urlstringnoReturn URL after payment. **Landing there does not confirm payment.** The API accepts
cancel_urlstringno
expires_atstringnoLink expiry in Honduras time (UTC-6), must be in the future. Accepts
customeranyno
lock_customer_fieldsbooleannoWhen `true`, every prefilled field that carries a non-empty value becomes read-only at
reusablebooleanno`false` (default) makes the payment single-use: it is consumed after an approved charge.
sales_tax_typestringnoTax mode. If not `none`, `sales_tax_value` is required. Computed on the subtotal only.
sales_tax_valuenumbernoFixed amount or percentage. As a percentage it cannot exceed 100.
tip_enabledbooleannoWhen `true`, define exactly one mode: a fixed tip (`tip_type` + `tip_value`) or customer
tip_typestringno
tip_valuenumberno
tip_customer_selectablebooleannoThe customer picks the tip at checkout, so the total at creation excludes it.
tip_preset_percentagesarrayno
tip_allow_custombooleanno
tip_min_amountnumbernoCannot exceed `amount`.
tip_max_amountnumbernoCannot exceed `amount` - a larger value returns `422`
service_fee_enabledbooleannoPer-request switch. `true` passes ROKI's processing costs to the customer: the checkout

Respuestas

CodigoSignifica
201Payment created.
401The `Authorization` header is missing or the key is invalid.
422Validation failed or a business rule was violated: required field, length, type, currency
GET/payments/{id}Retrieve a payment

Parametros

NombreEnObligatorioDescripcion
idpathsiNumeric payment identifier returned at creation.

Respuestas

CodigoSignifica
200Payment found.
401The `Authorization` header is missing or the key is invalid.
404No payment with that id exists for the key in use - often an id from the other environment.
POST/payments/{transaction_id}/voidVoid a transaction

Parametros

NombreEnObligatorioDescripcion
transaction_idpathsiThe **transaction** UUID from the payment response - not the numeric payment `id`.

Cuerpo

CampoTipoObligatorioNotas
reasonstringnoOptional free-text reason, stored with the void.

Respuestas

CodigoSignifica
200Transaction voided.
401The `Authorization` header is missing or the key is invalid.
404Transaction not found, or not owned by this merchant.
422Not voidable. `errors.void` carries the reason: already voided, already refunded
POST/payments/{transaction_id}/refundRefund a transaction

Parametros

NombreEnObligatorioDescripcion
transaction_idpathsiThe **transaction** UUID from the payment response - not the numeric payment `id`.

Cuerpo

CampoTipoObligatorioNotas
amountnumbersiAmount to refund, up to the remaining refundable amount.
reasonstringno

Respuestas

CodigoSignifica
200Refund applied.
401The `Authorization` header is missing or the key is invalid.
404Transaction not found, or not owned by this merchant.
422Rejected. `errors.amount`: below 0.01, or above the remaining refundable amount.
GET/payments/{transaction_id}/receiptGet receipt metadata

Parametros

NombreEnObligatorioDescripcion
transaction_idpathsiThe **transaction** UUID from the payment response - not the numeric payment `id`.

Respuestas

CodigoSignifica
200Receipt metadata.
401The `Authorization` header is missing or the key is invalid.
404Transaction not found, or not owned by this merchant.
GET/payments/{transaction_id}/receipt/downloadDownload the receipt PDF

Parametros

NombreEnObligatorioDescripcion
transaction_idpathsiThe **transaction** UUID from the payment response - not the numeric payment `id`.

Respuestas

CodigoSignifica
200PDF document.
401The `Authorization` header is missing or the key is invalid.
404Transaction not found, or not owned by this merchant.
GET/payment-methodsList a customer's saved cards

Parametros

NombreEnObligatorioDescripcion
customer[identity_number]querynoNational identity number of the customer. Preferred identifier.
customer[email]querynoCustomer email, when the identity number is unknown.

Respuestas

CodigoSignifica
200The customer's saved methods. An empty list is a normal `200` with `data: []`,
401The `Authorization` header is missing or the key is invalid.
DELETE/payment-methods/{payment_method_id}Revoke a saved card

Parametros

NombreEnObligatorioDescripcion
payment_method_idpathsiOpaque saved-card reference, prefixed `pm_`.

Respuestas

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

Parametros

NombreEnObligatorioDescripcion
payment_method_idpathsiOpaque saved-card reference, prefixed `pm_`.

Cuerpo

CampoTipoObligatorioNotas
amountnumbersi
currency_codestringnoAccepts the alphabetic code here (`"HNL"`), unlike payment creation which uses the
external_referencestringno
metadataobjectno

Respuestas

CodigoSignifica
201Charge processed.
401The `Authorization` header is missing or the key is invalid.
404Payment method not found or not owned by this merchant.
422Validation failure (including a missing `Idempotency-Key`), or a processor decline
POST/payments/token-chargeCharge a saved card (alias)

Cuerpo

CampoTipoObligatorioNotas
payment_tokenstringsiThe saved payment method reference.
amountnumbersi
currency_codestringno
external_referencestringno
metadataobjectno

Respuestas

CodigoSignifica
200Charge processed.
401The `Authorization` header is missing or the key is invalid.
422Validation failure or processor decline.
POST/confirmConfirm an embedded-components payment

Cuerpo

CampoTipoObligatorioNotas
amountnumbersi
currency_codestringsiAccepts `"HNL"` or the numeric `"340"`.
payment_tokenstringsiThe `tok_*` produced by the browser SDK after the customer submits the card.
publishable_keystringsiThe same publishable key the SDK was mounted with.
external_referencestringno
success_redirect_urlstringno
failed_redirect_urlstringno
descriptionstringno
metadataobjectno

Respuestas

CodigoSignifica
200Outcome of the charge. Inspect `status`: `approved`, `declined` or `pending`.
401The `Authorization` header is missing or the key is invalid.
422Validation failure or processor decline.