The Custom Invoicing app pauses invoice processing at key states and waits for your integration to signal completion before the invoice progresses through its lifecycle.
The app provides two optional synchronization hooks:
|
Hook
|
Required
|
Description
|
|
Draft Sync Hook
|
Optional
|
Invoice processing pauses at the draft state. Your integration validates and confirms the draft before it proceeds.
|
|
Issuing Sync Hook
|
Optional
|
Invoice processing pauses before issuance. Your integration performs final validation before the invoice is sent to the customer.
|
Additionally, payment status synchronization is mandatory once an invoice enters the payment processing state, regardless of hook configurations.
For initial implementation and testing, start with both synchronization hooks disabled. Enable them later as your integration matures. See Draft Sync Hook and Issuing Sync Hook for details.
After enabling the app, create a billing profile that references it. Use customer overrides to limit the app’s effect to specific customers rather than making it the default billing profile.
When no sync hooks are enabled, the invoice flow works as follows:
- Metering & Billing creates the invoice according to the invoice lifecycle rules.
- The invoice reaches payment processing state. Your integration must:
- Send the invoice to the customer.
- Initiate and accept payment.
- Call the Custom Invoicing app’s Update Payment Status API to set the payment state once payment is complete.
Your integration is responsible for managing the mapping between Metering & Billing invoice IDs and the corresponding entities in your external provider.
When the Draft Sync Hook is enabled, invoice processing pauses at draft.sync. Your integration must call the Submit Draft Synchronization Results endpoint to validate the draft and allow the invoice to proceed.
During draft synchronization, your integration can:
- Update the invoice number to align with your external system’s numbering scheme
- Synchronize the external system’s invoice identifier back to Metering & Billing
- Associate external IDs with individual line items and discounts
This eliminates manual ID mapping between Metering & Billing and your external system. Your integration can also use this state to perform invoice validation and make adjustments through the Update Invoice endpoint before the invoice advances.
When the Issuing Sync Hook is enabled, invoice processing pauses at issuing.sync. Your integration must call the Submit Issuing Sync Results endpoint to validate the final invoice details before issuance.
During issuing synchronization, your integration can:
- Set the external payment identifier to link the invoice with your payment system
- Perform final validation of the invoice details before sending to the customer
- Ensure all external system requirements are met