Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

Use eGovPay

eGovPay creates hosted payment transactions, returns transaction details, and voids eligible payments through a merchant integration.
Payment operations can cause external financial side effects. Do not retry create or void calls without an application-level idempotency decision.

Sign requests

Payment creation requires a lowercase HMAC-SHA256 digest of amount|txnid. Remove a leading test_ prefix from the merchant token only when computing the digest.

Initialize the client

Create a dedicated client with the eGovPay merchant token issued to your integration:
import { createClient } from "egov.js"; const client = createClient({ baseUrl: "https://egovpay-pgi-ws-dev.oueg.info", headers: { "X-eGovPay-Token": process.env.EGOVPAY_TOKEN!, }, });

Methods

The examples below use this authenticated eGovPay client. See the quickstart for the general client pattern.
The API Reference tab remains the source of truth for complete payment parameters, schemas, responses, and cURL examples.

egovPay.generatePayment

POST /api/v1/transaction creates a payment transaction and returns its reference, UUID, channel, and hosted payment URL.
import { egovPay } from "egov.js"; const payment = await egovPay.generatePayment({ client, body: { amount: 1_000, callback_url: "https://example.gov.ph/payments/callback", digest, items: [{ amount: 1_000, name: "Permit fee" }], redirect_url: "https://example.gov.ph/payments/complete", settlement_template_uuid: process.env.EGOVPAY_SETTLEMENT_TEMPLATE_UUID!, txnid: "PERMIT-2026-0001", }, throwOnError: true, });

egovPay.getTransaction

GET /api/v1/transaction/{uuid} retrieves transaction details for the supplied payment UUID.
import { egovPay } from "egov.js"; const transaction = await egovPay.getTransaction({ client, path: { uuid: payment.data.uuid }, throwOnError: true, });

egovPay.voidTransaction

PUT /api/v1/transaction/{uuid}/void voids an eligible transaction and returns the updated payment state.
import { egovPay } from "egov.js"; const voided = await egovPay.voidTransaction({ client, path: { uuid: payment.data.uuid }, throwOnError: true, });