Documentation Index
Fetch the complete documentation index at: https://docs.metrifox.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Theinvoice.created webhook is triggered when a new invoice is created in your Metrifox account. Invoices are generated for subscriptions, orders, and other billable events.
When It’s Triggered
This event is sent immediately after an invoice is successfully created, which can happen when:- A subscription billing cycle starts (recurring invoice)
- An order is completed and invoiced
- An invoice is created manually
- An invoice is generated through the API
Payload Structure
Data Fields
The payload includes invoice details and a summary:data.invoice
id: Internal invoice IDtitle: Invoice title or labeldue_at: Timestamp when the invoice is duestatus: Invoice status (e.g., “open”, “paid”, “void”, “draft”)comment: Optional invoice comment or notesent_at: Timestamp when the invoice was sentmetadata: Custom metadata objectis_manual: Whether the invoice was created manuallyissued_at: Timestamp when the invoice was issuedsource_id: Source record ID (e.g., order ID)tenant_id: The tenant ID this invoice belongs tocreated_at: Timestamp when the invoice was createddeleted_at: Deletion timestamp (if deleted)updated_at: Timestamp when the invoice was last updatedcustomer_id: ID of the customer this invoice is forcustomer_key: Your external customer identifiersource_type: Source record typecompleted_at: Completion timestamp (if completed)currency_code: Currency code (e.g., “USD”, “NGN”)overdue_until: Timestamp until which the invoice is overdue (if applicable)invoice_number: Human-readable invoice numberpayment_term_val: Payment term valuepayment_term_type: Payment term type (e.g., “on_receipt”)payment_link_status: Payment link statusfailed_payment_count: Number of failed payment attemptspayment_intent_result: Payment intent result (if any)stripe_payment_link_id: Stripe payment link ID (if any)last_payment_failure_at: Timestamp of the last payment failure (if any)payment_link_created_at: Timestamp when payment link was created (if any)stripe_payment_link_url: Stripe payment link URL (if any)last_payment_failure_reason: Reason for last payment failure (if any)
data.summary
id: Summary IDcreated_at: Timestamp when the summary was createdinvoice_id: Invoice ID the summary belongs toupdated_at: Timestamp when the summary was last updatedtotal_amount: Total invoice amountitems_subtotal: Subtotal of line itemstotal_after_tax: Total after taxtotal_discounts: Total discountstotal_before_tax: Total before taxtotal_extra_fees: Total extra feestotal_tax_amount: Total tax amounttotal_amount_paid: Total amount paidtotal_adjustment_amount: Total adjustmentstotal_outstanding_amount: Total outstanding amount
Example Use Cases
- Send invoice emails to customers
- Sync invoices to your accounting system
- Update financial records
- Trigger payment processing workflows
- Track revenue and billing analytics
- Generate invoice PDFs

