Receipts And Verification
Generate receipts, deliver receipt links, and embed receipt views with your own branding.
Use receipt documents when you want a clear, shareable statement of verified deltas for a customer record.
Typical flow:
- Record deltas during the billing window.
- Commit a checkpoint for the same window.
- Deliver a receipt link (or embed) to your customer.
- Verify the proof root when needed.
Core Endpoints
| Purpose | Endpoint |
|---|---|
| Scoped receipt generation | GET /api/v1/balance/receipt/:customerId |
| Tenant-authenticated receipt document | GET /api/v1/balance/receipts/:receiptId |
| Public receipt JSON | GET /api/v1/receipt/:receiptId |
| Public receipt PDF | GET /api/v1/receipt/:receiptId.pdf |
| Public proof verification | GET /api/v1/verify/:proofRoot |
For scoped receipt responses, put verifyUrl on invoices and customer emails.
Use verificationApiUrl for machine verification. verificationExplorerUrl remains for compatibility.
SDK Example
const checkpoint = await pac.balance.checkpoint('cust_acme_001', {
period: '2026-04',
});
const receipts = await pac.balance.receipts.list('cust_acme_001', { limit: 1 });
const receipt = await pac.balance.receipts.get(receipts[0].receiptId, {
customerDisplayName: true,
timezone: 'UTC',
});
const invoiceEmailBody = pac.balance.receipts.emailBody(receipt);
Five Embedding Patterns
1) Direct Public Link
Add receipt.links.permalink to emails, invoices, or ticket replies.
2) Invoice Deep Link
Store receiptId with your invoice row and render:
https://your-app.example.com/invoices/:invoiceId/receipt/:receiptId
3) Iframe Embed (Allowlisted Origin)
Allowlist your app origin in tenant embedOrigins, then embed:
<iframe
src="https://app.pacspace.io/receipt/chk_..."
style="width:100%;min-height:720px;border:0"
></iframe>
4) Headless Render In Your UI
Fetch GET /api/v1/receipt/:receiptId and render the statement in your own components and brand system.
5) PDF Attachment Workflow
Generate a public PDF URL (/api/v1/receipt/:receiptId.pdf) and attach it to invoice emails or ticket records.
Custom Link Examples For Invoices
View receipt statement:https://app.pacspace.io/receipt/:receiptIdDownload receipt PDF:https://app.pacspace.io/api/v1/receipt/:receiptId.pdfView in your app:https://app.yourdomain.com/records/:customerId/receipts/:receiptId
Webhook Delivery
Subscribe to receipt.generated so your system can send links or render custom documents when a new receipt is available.
For historical tenants, webhook subscriptions are mirrored to include new Balance events during backfill.