ArgonarPay ArgonarPay
Dashboard Help

API Reference

Accept payments from any e-wallet or bank that supports QRPh and InstaPay, including GCash and Maya, through a single unified API.

Getting Started

Quick Start

1
Get your API keys
Find your keys in Dashboard → API Keys. Use sk_test_ keys for development.
2
Create an order
POST to /v1/orders with the amount. We return a unique pay_amount for your customer to send.
3
Get notified when paid
Set your webhook URL in Settings. We POST a payment.confirmed event the moment payment is detected.

Authentication

All API requests require an API key sent in the X-API-Key header.

Key TypePrefixUsage
Publishablepk_live_Frontend: read-only (get order, QR)
Secretsk_live_Backend: full access
Test publishablepk_test_Frontend, test mode
Test secretsk_test_Backend, test mode (no real payments)

Keep sk_live_ keys on your server only. Never expose them in client-side code or public repos.

Test Mode

Use sk_test_ and pk_test_ keys to build and test your integration without touching real money. Test orders are completely isolated from live data.

To simulate a payment in test mode, call POST /v1/orders/{id}/simulate-payment with your test secret key. Webhooks fire exactly as in production.

Switch to live keys when you're ready to go live. No other code changes needed.

POST /v1/orders

Create a payment order. Returns a pay_amount — instruct your customer to send this exact amount via GCash or InstaPay.

Request Body

ParameterTypeDescription
order_idstring, requiredYour unique order identifier
amountnumber, requiredAmount in PHP (e.g. 500.00)
descriptionstring, optionalWhat the customer is paying for
metadataobject, optionalCustom key-value data attached to the order

Response

FieldDescription
pay_amountExact amount (with centavo offset) the customer must send
qr_urlURL to the QR image — display this to your customer
statuspending | paid | expired | cancelled
GET /v1/orders/{order_id}

Get the status and details of an order. Use this to poll for payment confirmation, or to verify a webhook notification before fulfilling.

FieldDescription
statuspending | paid | expired | cancelled
pay_amountExact amount the customer was asked to send
feePlatform fee deducted (populated after payment)
netAmount credited to your balance after fee
paid_atISO 8601 timestamp of payment confirmation
GET /v1/orders

List your orders with optional filters and pagination.

Query Parameters

ParameterTypeDescription
statusstring, optionalFilter: pending, paid, expired, cancelled
limitinteger, optional1–100 (default 50)
offsetinteger, optionalPagination offset
POST /v1/orders/{order_id}/cancel

Cancel a pending order. Only works on orders with pending status. Returns the updated order object.

Cancelled orders cannot be un-cancelled. Create a new order if you need to accept payment for the same reference.
POST /v1/checkout/session

Create a hosted checkout page. Redirect your customer to the returned checkout_url. ArgonarPay displays the QR code and polls for payment — your customer sees a clean payment page.

Request Body

ParameterTypeDescription
order_idstring, requiredYour order ID
amountnumber, requiredAmount in PHP
descriptionstring, optionalShown on the checkout page
success_urlstring, requiredRedirect here after payment
cancel_urlstring, requiredRedirect here on cancel or expiry
POST /v1/orders/{order_id}/simulate-payment TEST ONLY

Simulate a payment on a test order. Only works with sk_test_ keys. Triggers your webhook exactly as a real payment would — useful for testing your fulfillment logic end-to-end.

GET /v1/balance

Get your current balance and lifetime earnings summary.

FieldDescription
balanceAvailable balance awaiting settlement
total_earnedLifetime gross earnings
total_feesLifetime platform fees deducted
total_settledLifetime amount paid out to you
fee_percentYour current fee rate (e.g. 1.5)

Settlements

Settlements are payouts of your balance sent to your registered bank account or e-wallet. ArgonarPay sends your earnings automatically within 1 business day — no action needed on your part.

How it works: Once a payment clears, your balance is credited instantly. We send funds to your payout account (GCash, Maya, BDO, BPI, or any InstaPay-connected bank) within 1 business day.
GET /v1/settlements

List your settlement history.

Settlement Statuses

StatusMeaning
pendingBeing processed — will be sent within 1 business day.
completedFunds have been sent to your payout account.
failedCould not be sent. Funds are returned to your balance.
GET /v1/status

Health check endpoint. Returns API version and, if authenticated, your merchant info and order counts. No authentication required — useful for uptime monitoring.

Webhook Events

When a payment is confirmed, ArgonarPay POSTs a payment.confirmed event to your webhook URL. Set your URL in Dashboard → Settings.

Event Payload

FieldDescription
idUnique event ID (evt_...)
typeAlways payment.confirmed
createdUnix timestamp
data.order_idYour original order ID
data.pay_amountExact amount the customer sent
data.sender_namePartial sender name from GCash
data.paid_atISO 8601 payment timestamp (PHT)

Your endpoint must return a 2xx status within 10 seconds. Failed deliveries are retried up to 3 times (5 min then 30 min delay).

Verify Payment

When your webhook endpoint receives a notification, confirm the order is actually paid before fulfilling. Use the order ID from the webhook payload to call the API.

Best practice: Call GET /v1/orders/{order_id} and check that status === "paid" before taking any fulfillment action.

Error Codes

HTTP StatusMeaning
400Bad request — missing or invalid parameters
401Unauthorized — invalid or missing API key
403Forbidden — key doesn't have permission for this endpoint
404Not found — order or resource doesn't exist
409Conflict — order ID already exists
500Internal error — contact support
502Bank API unreachable — temporary, retry after a moment

All error responses include: {"error": "message describing what went wrong"}. Log the full response body for debugging.

PHP SDK

Drop-in PHP class. No Composer, no dependencies — just include the file.

Download: ArgonarPay.php | Place it anywhere in your project and require_once it.
MethodDescription
new ArgonarPay($secretKey)Initialize the client
createOrder($id, $amount, $desc)Create a payment order
getOrder($id)Get order status and details
createCheckout($id, $amount, $desc, $ok, $cancel)Create a hosted checkout session
getBalance()Get merchant balance
listOrders($params)List orders with filters
PHP SDK — full example
require_once 'ArgonarPay.php';
$pay = new ArgonarPay('sk_live_KEY');

// Create order and show pay amount + QR to customer
$order = $pay->createOrder('INV-001', 500.00, 'Premium Plan');
echo "Pay exactly PHP " . $order['pay_amount']; // 500.37
// Show $order['qr_url'] as an <img> to your customer

// Hosted checkout — redirect customer
$session = $pay->createCheckout(
    'INV-001', 500.00, 'Premium Plan',
    'https://mysite.com/success',
    'https://mysite.com/cancel'
);
header('Location: ' . $session['checkout_url']);

// Webhook handler — verify then fulfill
$event = json_decode(file_get_contents('php://input'), true);
$order = $pay->getOrder($event['data']['order_id']);
if ($order['status'] === 'paid') { fulfillOrder($order); }
http_response_code(200);