new_invoice (v1.0.0)

Event triggered when a new invoice is generated for an order

Overview

The new_invoice event is published by the Mony system when a new invoice is generated for an order. This event is consumed by the ORDR service to update the order’s invoice status and trigger appropriate workflows.

When to Use

This event should be used when:

  • A new invoice is created for an order
  • Invoice generation is completed
  • Invoice files are ready for download
  • Invoice status needs to be updated

Event Structure

The event contains information about:

  • Order ID
  • Invoice number and serial
  • Invoice access key
  • File URLs (PDF and XML)
  • Creation date
  • invoice.received - Published by ORDR after processing this event
  • ordr.processing - May be triggered as a result of invoice creation

Examples

New Invoice Created

{
  "new_invoice": {
    "orderId": "ordr_12345",
    "invoiceNumber": "123456789",
    "invoiceSerial": "001",
    "invoiceAccessKey": "12345678901234567890123456789012345678901234",
    "invoiceFileUrlPdf": "https://invoices.mony.com.br/pdf/123456789.pdf",
    "invoiceFileUrlXml": "https://invoices.mony.com.br/xml/123456789.xml",
    "creationDate": "2024-01-15T10:30:00Z"
  }
}