Send an Invoice via Secure Delivery
Render an invoice from the Receivables REFRACT Pack and deliver it to a customer through a time-limited secure portal link using REFRACT Delivery.
This tutorial walks through the most common accounts receivable scenario: generate a professional invoice PDF and deliver it to a customer through a secure, audited portal link, without attaching the PDF directly to an email.
Products used: REFRACT Packs (Receivables), REFRACT Delivery
What You'll Need
- A REFRACT PDF licence with the
vaultDeliveryfeature gate enabled - The
invoice-standardtemplate ID from the Receivables REFRACT Pack (or your own invoice template) - A customer email address
- The
Lifecycle.Readerrole on your account if you call as a signed-in user, or theRender.Accessapplication permission on your app if you call with client credentials. Listing delivery sessions needsLifecycle.Readereither way.
Step 1: Render the Invoice
POST to /api/render with your invoice data. Use a stable, business-meaningful correlationId such as the invoice number - it links the rendered PDF to all downstream events, delivery sessions, and the REFRACT Lifecycle audit trail.
POST /api/render
Authorization: Bearer <Entra ID JWT>
Content-Type: application/json{
"templateId": "invoice-standard",
"correlationId": "inv-2026-001",
"documentId": "INV-2026-001",
"customer": {
"name": "Contoso Ltd",
"address": "123 Main Street, London, EC1A 1BB"
},
"invoiceDate": "2026-05-30",
"dueDate": "2026-06-13",
"lineItems": [
{ "description": "Professional Services", "qty": 10, "unitPrice": 150.00 }
]
}The response includes the pdfBlobPath you will need in the next step:
{
"correlationId": "inv-2026-001",
"pdfBlobPath": "generated-documents/invoice/2026/05/inv-2026-001.pdf",
"status": "success"
}Step 2: Create a Delivery Session
POST to /api/delivery with the correlationId and pdfBlobPath from the render response. The Dispatcher issues a time-limited access token, stores the session, and sends a notification email to the recipient.
POST /api/delivery
Authorization: Bearer <Entra ID JWT>
Content-Type: application/json{
"correlationId": "inv-2026-001",
"documentId": "INV-2026-001",
"documentName": "Invoice INV-2026-001.pdf",
"pdfBlobPath": "generated-documents/invoice/2026/05/inv-2026-001.pdf",
"mode": "secure-email",
"recipients": [
{
"email": "accounts@contoso.com",
"name": "Accounts Payable",
"role": "recipient"
}
],
"requesterOrg": "Your Company Name",
"message": "Please find your invoice attached. This link expires in 7 days.",
"expiresInHours": 168
}The response returns a deliveryId and portal URL per recipient:
{
"sessions": [
{
"deliveryId": "dlv-xxxx...",
"recipient": "accounts@contoso.com",
"portalUrl": "https://portal.refractplatform.com/d/<linkReference>"
}
],
"expiresAt": "2026-06-06T12:00:00.000Z",
"emailsSent": 1
}mode is secure-email only
secure-email is the only working delivery mode. A sharePointTarget field is accepted on the request and stored, but nothing reads it back to write the document into SharePoint - don't build a SharePoint write-back flow on it.
Step 3: Track Delivery
Query session state at any time using the correlationId:
GET /api/delivery-sessions?correlationId=inv-2026-001
Authorization: Bearer <Entra ID JWT>The session state progresses from pending through sent to opened once the recipient accesses the document - there is no separate downloaded state. Session creation and each access are recorded in the audit trail for the document and are visible in the REFRACT Lifecycle workspace.
REFRACT Delivery Reference
Full API reference for delivery modes, session states, SharePoint write-back, and batch dispatch.
Testing with Postman
Call the Dispatcher API from Postman with a testing app registration, either as an app (client credentials) or as a signed-in person (Authorization Code with PKCE).
Send a Document for Electronic Signing
Render a signing document and create a REFRACT eSign session to collect electronic signatures from one or more signers via the centrally hosted signing portal.