Create, list, and fetch orders. Pick an SDK or integrate with cURL; all examples use the same HMAC authentication.
Creates a payment order and returns payment_url, public_token, and initial status. Optionally send items[] to compute the amount from the catalog without creating a sales_order.
Parameters
merchant_referencerequiredstringUnique identifier in your system.
amount_in_centsoptionalnumberAmount in cents. Required without items[]; optional with items[] to validate the computed total.
currency_idoptionaluuidCurrency UUID. Required without items[]; with items[] it is derived from the catalog.
country_idrequireduuidCountry UUID (eligibility and shipping with items[]).
itemsoptionalarrayLines { variant_id, quantity }. Server computes prices; detail stored in metadata.
shipping_in_centsoptionalstringOnly with items[]. Shipping override; computed if omitted.
tax_in_centsoptionalstringOnly with items[]. Tax in cents.
discount_in_centsoptionalstringOnly with items[]. Discount in cents.
descriptionoptionalstringText shown on checkout.
customer_emailoptionalstringPayer email.
success_urloptionalstringRedirect after successful payment.
cancel_urloptionalstringRedirect if the user cancels.
expires_atoptionalstringISO 8601 expiry (UTC).
metadataoptionalobjectArbitrary JSON (merged with catalog_items when items[] is sent).
const order = await client.createPaymentOrder({
merchant_reference: 'orden-124',
amount_in_cents: 50000,
currency_id: process.env.HANIX_CURRENCY_ID!,
country_id: process.env.HANIX_COUNTRY_ID!,
description: 'opcional',
customer_email: 'opcional@email.com',
success_url: 'https://tu-tienda.com/ok',
cancel_url: 'https://tu-tienda.com/cancel',
expires_at: '2026-05-16T12:00:00.000Z',
metadata: { sku: 'ABC' },
});
// order.payment_url → enlace de checkoutLists orders with filters by status, reference, dates, and pagination.
const { items, pagination } = await client.listPaymentOrders({
status: 'pending',
page: 1,
limit: 20,
sort: 'created_at_desc',
});Fetch an order by UUID.
const order = await client.getPaymentOrder('uuid-orden');Payment attempts: initiated, processing, succeeded, failed, expired, abandoned.
const attempts = await client.listPaymentOrderAttempts(
'uuid-orden',
{ status: 'succeeded', page: 1, limit: 10 },
);