AsyncAPI specification for invoicing domain events published by the ERP integration layer. JSON Schema files under schemas/ are the authoritative contract. Every message uses the common integration envelope (schemas/common/integration_envelope.v1.schema.json); event-specific business data is embedded in the envelope payload field.
Channel carrying all invoicing domain events from ERP.
ERP publishes InvoiceWasCreated when a new invoice is created.
Accepts the following message:
Full invoice snapshot (header + line items) emitted after creation.
Envelope carrying a newly created two-line invoice
{
"specVersion": "1",
"messageId": "3f6a1d2e-8b4c-4e5f-9a7b-1c2d3e4f5a6b",
"eventType": "InvoiceWasCreated",
"eventVersion": 1,
"producer": "erp",
"occurredAt": "2026-09-30T15:40:42Z",
"aggregateType": "Invoice",
"aggregateId": "01a0f2e4-17e5-7192-beb1-88096f9fbefd",
"payload": {
"invoice": {
"id": "01a0f2e4-17e5-7192-beb1-88096f9fbefd",
"type": "INVOICE",
"status": "POSTED",
"dueDate": null,
"vendorId": "1253",
"amountNet": 513882,
"amountTax": 92498,
"createdAt": "2026-09-30T15:17:09+00:00",
"updatedAt": "2026-09-30T15:40:42+00:00",
"amountGross": 606380,
"blockReason": null,
"companyCode": "MTC",
"postingDate": "2026-09-30",
"documentDate": "2026-09-30",
"paymentBlock": false,
"lineItemCount": 2,
"quantityTotal": 2,
"documentNumber": "inv/test/123",
"businessPlaceCode": "P_DL01",
"sourceOfSupply": "01a0f2e4-17e5-7192-beb1-88096f9fbefd",
"conditions": [
{
"kind": "AMOUNT",
"rate": null,
"type": "REBATE",
"basis": "NET",
"amount": {
"cents": 56988,
"currency": "INR"
},
"position": 2
}
],
"attachments": [
{
"name": "1252_Invoice_With_Buyer_altkatest261002-7-wrongqty.pdf",
"path": "supplier-invoices/1252_01a0fbcb-ef81-7079-b827-af158719b3f2.pdf",
"type": "ORIGINAL",
"timestamp": null
}
]
},
"items": [
{
"id": "01a0f2e4-1939-70c5-ab9a-fc08ee015b98",
"mrp": 669500,
"uom": "pcs",
"lineNo": 10,
"hsnCode": "87080808",
"netPrice": 510636,
"quantity": 1,
"createdAt": "2026-09-30T15:17:10+00:00",
"updatedAt": "2026-09-30T15:40:42+00:00",
"amountBase": 510636,
"gstPercent": 18,
"materialId": 58334236,
"description": "68001M55R02",
"materialCode": "68001M55R02",
"manufacturerId": 2456,
"manufacturerCode": "MARUTI SUZUKI",
"priceUnitQty": 1,
"lineDiscountValue": 0,
"lineSurchargeValue": 0,
"taxes": [
{
"rate": 0.09,
"amount": {
"cents": 45957,
"currency": "INR"
},
"taxCode": "CGST"
},
{
"rate": 0.09,
"amount": {
"cents": 45957,
"currency": "INR"
},
"taxCode": "SGST"
}
],
"conditionNetPart": 0,
"conditionGrossPart": 0,
"lineDiscountType": "percent",
"lineSurchargeType": "percent"
},
{
"id": "01a0f2ed-ac06-73d4-9c86-47a5ab86f8b0",
"mrp": null,
"uom": "pcs",
"lineNo": 20,
"hsnCode": "11111111",
"netPrice": 3246,
"quantity": 1,
"createdAt": "2026-09-30T15:27:37+00:00",
"updatedAt": "2026-09-30T15:40:42+00:00",
"amountBase": 3246,
"gstPercent": 18,
"materialId": null,
"description": "Platform Charges",
"materialCode": null,
"manufacturerId": null,
"manufacturerCode": null,
"priceUnitQty": 1,
"lineDiscountValue": 0,
"lineSurchargeValue": 0,
"taxes": [
{
"rate": 0.09,
"amount": {
"cents": 292,
"currency": "INR"
},
"taxCode": "CGST"
},
{
"rate": 0.09,
"amount": {
"cents": 292,
"currency": "INR"
},
"taxCode": "SGST"
}
],
"conditionNetPart": 0,
"conditionGrossPart": 0,
"lineDiscountType": "percent",
"lineSurchargeType": "percent"
}
]
}
}
Channel carrying all invoicing domain events from ERP.
ERP publishes InvoiceWasUpdated when an existing invoice is updated.
Accepts the following message:
Full invoice snapshot (header + line items) emitted after an update.
Envelope carrying an updated two-line invoice
{
"specVersion": "1",
"messageId": "9c8b7a6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"eventType": "InvoiceWasUpdated",
"eventVersion": 1,
"producer": "erp",
"occurredAt": "2026-09-30T15:40:42Z",
"aggregateType": "Invoice",
"aggregateId": "01a0f2e4-17e5-7192-beb1-88096f9fbefd",
"payload": {
"invoice": {
"id": "01a0f2e4-17e5-7192-beb1-88096f9fbefd",
"type": "INVOICE",
"status": "POSTED",
"dueDate": null,
"vendorId": "1253",
"amountNet": 513882,
"amountTax": 92498,
"createdAt": "2026-09-30T15:17:09+00:00",
"updatedAt": "2026-09-30T15:40:42+00:00",
"amountGross": 606380,
"blockReason": null,
"companyCode": "MTC",
"postingDate": "2026-09-30",
"documentDate": "2026-09-30",
"paymentBlock": false,
"lineItemCount": 2,
"quantityTotal": 2,
"documentNumber": "inv/test/123",
"businessPlaceCode": "P_DL01",
"sourceOfSupply": "01a0f2e4-17e5-7192-beb1-88096f9fbefd",
"conditions": [
{
"kind": "AMOUNT",
"rate": null,
"type": "REBATE",
"basis": "NET",
"amount": {
"cents": 56988,
"currency": "INR"
},
"position": 2
}
],
"attachments": [
{
"name": "1252_Invoice_With_Buyer_altkatest261002-7-wrongqty.pdf",
"path": "supplier-invoices/1252_01a0fbcb-ef81-7079-b827-af158719b3f2.pdf",
"type": "ORIGINAL",
"timestamp": null
}
]
},
"items": [
{
"id": "01a0f2e4-1939-70c5-ab9a-fc08ee015b98",
"mrp": 669500,
"uom": "pcs",
"lineNo": 10,
"hsnCode": "87080808",
"netPrice": 510636,
"quantity": 1,
"createdAt": "2026-09-30T15:17:10+00:00",
"updatedAt": "2026-09-30T15:40:42+00:00",
"amountBase": 510636,
"gstPercent": 18,
"materialId": 58334236,
"description": "68001M55R02",
"materialCode": "68001M55R02",
"manufacturerId": 2456,
"manufacturerCode": "MARUTI SUZUKI",
"priceUnitQty": 1,
"lineDiscountValue": 0,
"lineSurchargeValue": 0,
"taxes": [
{
"rate": 0.09,
"amount": {
"cents": 45957,
"currency": "INR"
},
"taxCode": "CGST"
},
{
"rate": 0.09,
"amount": {
"cents": 45957,
"currency": "INR"
},
"taxCode": "SGST"
}
],
"conditionNetPart": 0,
"conditionGrossPart": 0,
"lineDiscountType": "percent",
"lineSurchargeType": "percent"
},
{
"id": "01a0f2ed-ac06-73d4-9c86-47a5ab86f8b0",
"mrp": null,
"uom": "pcs",
"lineNo": 20,
"hsnCode": "11111111",
"netPrice": 3246,
"quantity": 1,
"createdAt": "2026-09-30T15:27:37+00:00",
"updatedAt": "2026-09-30T15:40:42+00:00",
"amountBase": 3246,
"gstPercent": 18,
"materialId": null,
"description": "Platform Charges",
"materialCode": null,
"manufacturerId": null,
"manufacturerCode": null,
"priceUnitQty": 1,
"lineDiscountValue": 0,
"lineSurchargeValue": 0,
"taxes": [
{
"rate": 0.09,
"amount": {
"cents": 292,
"currency": "INR"
},
"taxCode": "CGST"
},
{
"rate": 0.09,
"amount": {
"cents": 292,
"currency": "INR"
},
"taxCode": "SGST"
}
],
"conditionNetPart": 0,
"conditionGrossPart": 0,
"lineDiscountType": "percent",
"lineSurchargeType": "percent"
}
]
}
}
Channel carrying all invoicing domain events from ERP.
ERP publishes InvoiceItemAllocationsChanged when an invoice item's allocations to purchase order items change.
Accepts the following message:
Current set of allocations of an invoice item to purchase order items.
Envelope carrying an invoice item allocated across two purchase order items
{
"specVersion": "1",
"messageId": "2b1c4d6e-7f8a-4b9c-8d0e-1f2a3b4c5d6e",
"eventType": "InvoiceItemAllocationsChanged",
"eventVersion": 1,
"producer": "erp",
"occurredAt": "2026-09-30T15:40:42Z",
"aggregateType": "InvoiceItem",
"aggregateId": "01a0f2e4-1939-70c5-ab9a-fc08ee015b98",
"payload": {
"invoiceItemId": "01a0f2e4-1939-70c5-ab9a-fc08ee015b98",
"allocations": [
{
"purchaseItemId": "01a0f2e4-2a71-7b3c-8d9e-10f2a3b4c5d6",
"qty": 3
},
{
"purchaseItemId": "01a0f2e4-3b82-7c4d-9e0f-21a3b4c5d6e7",
"qty": 5
}
]
}
}
Full invoice snapshot (header + line items) emitted after creation.
Full invoice snapshot (header + line items) emitted after an update.
Current set of allocations of an invoice item to purchase order items.