Skip to main content
The Node.js SDK supports one Advanced Service: the Universal Payment Gateway (UPG). Its typed, async payment() accessor is for trusted backend payment work. The canonical UPG documentation defines the full integration, gateway capabilities, checkout presentation, and authoritative completion rules.
Payment actions are backend-only. Never send a Project Client Secret, completionContext, callback artifact, gateway credential, or an unverified provider return payload to a browser.

Quick Setup

Connect a payment flow with the smallest complete backend integration.

Advanced Setup

Control initiation, returns, webhooks, and authoritative completion.

Payment Elements

Add AvraAPI’s optional checkout UI while retaining backend authority.

Gateway capabilities

Find verified gateway-specific functions, payment choices, and limits.

Access the Node.js payment service

Access the Advanced Service
The accessor returns a typed PaymentService. Lifecycle methods resolve to dedicated payment value objects rather than generic provider responses. The service also exposes typed gateway facilities through payHere()/payhere(), marxPay()/marxpay(), onePay()/onepay(), koko(), payPlus()/payplus(), and webXPay()/webxpay(). Use the gateway-wise guides for verified provider-specific contracts rather than treating every gateway alike.

Keep authority in your backend

1

Create a pending order

Store your order, amount, currency, customer data, and fulfilment intent in your application before creating a payment session.
2

Prepare the session through payment()

Use createOrder() with a typed CreateOrderOptions object. Keep the returned completionContext with your pending order; it is never browser data.
3

Present the checkout

Follow the selected gateway’s redirect, overlay, or embedded presentation guide. A browser event or return page is not authoritative payment proof.
4

Complete and fulfil

Send the callback or return payload to your backend and use completePayment(). Fulfil only after the completion result is verified and its payment status meets your application policy.
PaymentSession.completionContext is deliberately server-only. PaymentCompletionResult is normalised by AvraAPI, but your application is still responsible for idempotency, order state, and the final fulfilment decision.

Choose the right UPG guide

UPG Overview

Learn the lifecycle, project requirements, and supported integration paths.

Webhooks & completion

Implement authoritative callback verification and reconciliation.

Gateway-wise functions

Use provider-specific capabilities only where they are verified and released.

SDK availability

UPG is available through the PHP, Laravel, and Node.js SDKs. Node.js uses the released client.payment() typed, async server-only lifecycle. Use canonical UPG guides instead of recreating payment operations through a raw HTTP call.

Next steps

Start Quick Setup

Build the smallest complete payment flow first.

Review UPG errors

Understand safe handling for unavailable methods, callbacks, and completion outcomes.
Last modified on October 1, 2026