ROKIConnect

API reference

12 operations. This page is generated from the OpenAPI specification, so it cannot describe a contract the API no longer has.

Base: https://aura.roki.systems/api/connect/v1. The environment is decided by the key prefix: sk_test_ is sandbox and sk_live_ is production, over identical routes.

GET/paymentsList payments

Parameters

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

Responses

CodeMeans
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

Body

FieldTypeRequiredNotes
amountnumberyesThe exact total to charge in this checkout, in decimal units (150.50 = L 150.50),
external_referencestringyesYour order id. **Not unique** - duplicate protection comes from `Idempotency-Key`.
namestringyesPayment 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

Responses

CodeMeans
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

Parameters

NameInRequiredDescription
idpathyesNumeric payment identifier returned at creation.

Responses

CodeMeans
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

Parameters

NameInRequiredDescription
transaction_idpathyesThe **transaction** UUID from the payment response - not the numeric payment `id`.

Body

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

Responses

CodeMeans
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

Parameters

NameInRequiredDescription
transaction_idpathyesThe **transaction** UUID from the payment response - not the numeric payment `id`.

Body

FieldTypeRequiredNotes
amountnumberyesAmount to refund, up to the remaining refundable amount.
reasonstringno

Responses

CodeMeans
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

Parameters

NameInRequiredDescription
transaction_idpathyesThe **transaction** UUID from the payment response - not the numeric payment `id`.

Responses

CodeMeans
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

Parameters

NameInRequiredDescription
transaction_idpathyesThe **transaction** UUID from the payment response - not the numeric payment `id`.

Responses

CodeMeans
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

Parameters

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

Responses

CodeMeans
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

Parameters

NameInRequiredDescription
payment_method_idpathyesOpaque saved-card reference, prefixed `pm_`.

Responses

CodeMeans
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

Parameters

NameInRequiredDescription
payment_method_idpathyesOpaque saved-card reference, prefixed `pm_`.

Body

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

Responses

CodeMeans
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)

Body

FieldTypeRequiredNotes
payment_tokenstringyesThe saved payment method reference.
amountnumberyes
currency_codestringno
external_referencestringno
metadataobjectno

Responses

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

Body

FieldTypeRequiredNotes
amountnumberyes
currency_codestringyesAccepts `"HNL"` or the numeric `"340"`.
payment_tokenstringyesThe `tok_*` produced by the browser SDK after the customer submits the card.
publishable_keystringyesThe same publishable key the SDK was mounted with.
external_referencestringno
success_redirect_urlstringno
failed_redirect_urlstringno
descriptionstringno
metadataobjectno

Responses

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