HPP Examples
This page contains ready-to-use examples for common HPP integration scenarios.
Basic Card Payment
The simplest HPP integration: create a Payment Request with hostedPaymentPage and redirect the customer.
Create the Payment Request (server-side):
POST /paymentrequestsContent-Type: application/jsonX-Api-Key: {your-api-key}
{ "reference": "INV-2026-001", "payment": { "amount": 5000, "currencyCode": "AUD", "description": "Order #12345" }, "paymentMethods": [ "card" ], "transactionRequest": { "category": { "frequency": "single", "captureType": "auto" } }, "hostedPaymentPage": { "merchantName": "Acme Store", "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==" }}Response:
{ "id": "zWIEEs6BBU2A3GUQ8gD3Ag", "reference": "INV-2026-001", "createdDateTime": "2026-01-27T10:15:00Z", "paymentRequestStatus": "created", "hostedPaymentPage": { "url": "https://sandbox.hosted.gpaunz.com/hpp/zWIEEs6BBU2A3GUQ8gD3Ag" }}Redirect the customer to the returned URL:
https://sandbox.hosted.gpaunz.com/hpp/zWIEEs6BBU2A3GUQ8gD3AgWith Redirect on Approval
Redirect the customer back to your site after a successful payment. On approved transactions, HPP automatically redirects to the redirectUrl. On decline or failure, the hosted result page is displayed.
{ "reference": "INV-2026-002", "payment": { "amount": 9900, "currencyCode": "AUD", "description": "Annual subscription" }, "paymentMethods": [ "card" ], "transactionRequest": { "category": { "frequency": "single", "captureType": "auto" } }, "hostedPaymentPage": { "merchantName": "SaaS Co", "logo": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciLz4=", "resultPage": "redirect", "redirectUrl": "https://example.com/payment/complete?ref=INV-2026-002" }}Note: The redirect only occurs on approved outcomes. Declined or failed payments display the hosted result page.
Without Explicit Merchant Name
When merchantName is omitted, the platform uses the merchant name from your account configuration.
{ "reference": "INV-2026-004", "payment": { "amount": 2500, "currencyCode": "AUD", "description": "Membership renewal" }, "paymentMethods": [ "card" ], "transactionRequest": { "category": { "frequency": "single", "captureType": "auto" } }, "hostedPaymentPage": { "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==" }}With Line Items and Adjustments
Display a detailed order breakdown on the payment page.
{ "reference": "INV-2026-003", "payment": { "amount": 4350, "currencyCode": "AUD", "description": "Online order" }, "paymentMethods": [ "card" ], "transactionRequest": { "category": { "frequency": "single", "captureType": "auto" } }, "hostedPaymentPage": { "merchantName": "Coffee Roasters", "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==", "lineItems": [ { "title": "House Blend 250g", "amount": 1500, "quantity": 2 }, { "title": "Ceramic Mug", "amount": 850, "quantity": 1 } ], "adjustments": [ { "title": "Shipping", "amount": 500, "adjustmentType": "Shipping" } ] }}Amount validation:
- Line items: (1500 × 2) + (850 × 1) = 3850
- Adjustments: 500
- Total: 3850 + 500 = 4350 ✓ (matches
payment.amount)
With Line Item Modifiers
Use the modifier field to display unit labels.
"lineItems": [ { "title": "Espresso Beans", "amount": 2400, "quantity": 1.5, "modifier": "kg" }, { "title": "Paper Filters", "amount": 600, "quantity": 1, "modifier": "each" }]With a Discount Adjustment
"adjustments": [ { "title": "10% off promo", "amount": -500, "adjustmentType": "Discount" }, { "title": "GST", "amount": 300, "adjustmentType": "Tax" }]Negative amounts represent discounts; positive amounts represent fees.
Server-Side Verification Example
After the customer completes payment, verify the outcome server-side:
GET /paymentrequests/zWIEEs6BBU2A3GUQ8gD3AgResponse when approved:
{ "id": "zWIEEs6BBU2A3GUQ8gD3Ag", "reference": "INV-2026-001", "paymentRequestStatus": "completed", "transactionResult": { "id": "txn_abc123", "location": "/transactions/txn_abc123" }}Then fetch the transaction for full details:
GET /transactions/txn_abc123