Billing
Hosted Billing Page
Give your customers a branded, read-only portal to view their invoices, payment history, and subscriptions — no login required.
5 min read
Overview
The Hosted Billing Page lets merchants generate a secure, tokenized URL for any customer. When a customer visits the link, they see a merchant-branded page with four tabs: Overview, Invoices, Payments, and Subscriptions. No account or login is needed.
Token-based access
256-bit entropy tokens (hbp_ prefix)
Merchant branding
Logo, brand color, business name
Read-only portal
Invoices, payments, subscriptions
Generate a token
Create a billing page token
curl -X POST https://paymenthooks.com/api/v1/billing-page/tokens \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{"customerId": "cus_abc123"}'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| customerId | string | Yes | The customer to generate a billing page for |
| expiresAt | string | No | ISO 8601 expiration date (null = never expires) |
Endpoints & Responses
Complete payload and response for every billing page endpoint. Click copy on any block.
POST
/v1/billing-page/tokensCreate a billing page tokenRequest Payload
{
"customerId": "cus_abc123",
"expiresAt": "2026-06-16T00:00:00.000Z"
}Response
{
"data": {
"id": "bpt_1a2b3c4d5e",
"customerId": "cus_abc123",
"token": "hbp_k8m2n4p6r0t1v3x5z7a9c1e3g5",
"billingPageUrl": "https://paymenthooks.com/billing/hbp_k8m2n4p6r0t1v3x5z7a9c1e3g5",
"status": "active",
"expiresAt": "2026-06-16T00:00:00.000Z",
"accessCount": 0,
"lastAccessedAt": null,
"merchantId": "mer_abc123",
"createdAt": "2026-05-16T10:30:00.000Z"
},
"error": null
}GET
/v1/billing-page/tokens?customerId=cus_abc123List tokens (filter by customerId)Response
{
"data": [
{
"id": "bpt_1a2b3c4d5e",
"customerId": "cus_abc123",
"token": "hbp_k8m2n4p6r0t1v3x5z7a9c1e3g5",
"billingPageUrl": "https://paymenthooks.com/billing/hbp_k8m2...",
"status": "active",
"expiresAt": "2026-06-16T00:00:00.000Z",
"accessCount": 5,
"lastAccessedAt": "2026-05-15T14:22:00.000Z",
"createdAt": "2026-05-16T10:30:00.000Z"
}
],
"meta": { "total": 1, "page": 1, "pageSize": 10 },
"error": null
}DELETE
/v1/billing-page/tokens/:idRevoke a tokenResponse
{
"data": {
"id": "bpt_1a2b3c4d5e",
"revoked": true,
"revokedAt": "2026-05-16T12:00:00.000Z"
},
"error": null
}GET
/v1/billing-page/resolve?token=hbp_k8m2n4p6r0t1v3x5z7a9c1e3g5Resolve token (public, no auth)Response
{
"data": {
"merchant": {
"businessName": "Acme Corp",
"logoUrl": "https://paymenthooks.com/logos/acme.svg",
"brandColor": "#6366f1"
},
"customer": {
"id": "cus_abc123",
"name": "Jane Doe",
"email": "[email protected]"
},
"invoices": [
{
"id": "ph_inv_001",
"amount": 2990,
"currency": "USD",
"status": "paid",
"dueDate": "2026-05-01T00:00:00.000Z",
"paidAt": "2026-04-28T10:00:00.000Z"
}
],
"payments": [
{
"id": "ph_pay_001",
"amount": 2990,
"currency": "USD",
"status": "succeeded",
"gateway": "Stripe",
"createdAt": "2026-04-28T10:00:00.000Z"
}
],
"subscriptions": [
{
"id": "ph_sub_001",
"status": "active",
"interval": "monthly",
"amount": 2990,
"currency": "USD",
"nextBillingDate": "2026-06-01T00:00:00.000Z"
}
],
"summary": {
"totalSpent": 14950,
"openInvoices": 0,
"activeSubscriptions": 1
}
},
"error": null
}Customer view
The billing page renders your merchant branding and four tabs:
OverviewSummary metrics (total spent, open invoices, active subscriptions) plus recent activityInvoicesFull invoice list with status badges, amounts, due dates, and payment datesPaymentsPayment transaction history with gateway, amount, and statusSubscriptionsActive and past subscriptions with billing interval and next billing dateSecurity
256-bit token entropyTokens use cryptographically secure random bytes
Read-only accessNo mutations or payments can be triggered
Data scopingEach token is bound to a specific merchant + customer pair
Instant revocationMerchants can revoke tokens immediately
Optional expirationSet an expiresAt date to auto-expire tokens
Access trackingEach token tracks accessCount and lastAccessedAt