Vic.ai Webhook Events API
These are the `V1` events you can subscribe to. These will be sent as a `POST` to `https://yourCallbackUrl/events`. * `all` - This is a special form, that specifies that you want all events sent to your webhook. Usage is not recommended in production. * [`invoice_approved`](#invoice-approved) * [`invoice_deleted`](#invoice-deleted) * [`invoice_post`](#invoice-post) * [`invoice_posted`](#invoice-posted) * [`invoice_rejected`](#invoice-rejected) * [`invoice_restored`](#invoice-restored) * [`invoice_submitted`](#invoice-submitted) * [`invoice_transfer`](#invoice-transfer) * [`invoice_updated`](#invoice-updated) * [`payment_batch_processed`](#payment-batch-processed) * [`payment_status_updated`](#payment-status-updated) * [`credit_status_updated`](#credit-status-updated) * [`purchase_order_created`](#purchase-order-created) * [`purchase_order_deleted`](#purchase-order-deleted) * [`purchase_order_updated`](#purchase-order-updated) * [`vendor_created`](#vendor-created) * [`vendor_onboarding_form_completed`](#vendor-onboarding-form-completed) * [`vendor_updated`](#vendor-updated) The following `V0` events may be specified. They will be sent to the original callback paths where the event name was in the path. * `vendorNew` - `POST` `https://yourCallbackUrl/vendorNew` * `invoicePost` - `POST` `https://yourCallbackUrl/invoicePost` * `invoiceTransfer` - `POST` `https://yourCallbackUrl/invoiceTransfer` * `syncRequest` - `POST` `https://yourCallbackUrl/syncRequest` ### Performance Considerations Avoid using `"all"` as your subscription event type in production environment. Instead, create specific subscriptions for individual event types that your system can handle efficiently. ### Event Details The newer webhook endpoints will be sent to `https://yourCallbackUrl/events`. The receiver is expected to handle everything asynchronously via this method. We do not parse the response body and will ignore it. * All `2XX` responses will be treated as successful. * `401`, `403`, `429` responses will be treated as failures and retried with a linear backoff with jitter. Once retries have been exhausted, the event is discarded. * All other `4XX` responses will be treated as successful. If something is to be rejected, you will need to make the appropriate calls to the Vic API to complete the asynchronous handshake. Example: confirming or rejecting an invoice post. * All `5XX` responses will be treated as a failure and retried with a linear backoff with jitter. Once retries have been exhausted, the event is discarded. * Failed events will be attempted up to 5 times (1 initial attempt + up to 4 retries). > **NOTE**: The integrating system has 15 seconds to respond. After the time has > passed it will be considered a failure, and a retry will be sent for events > going to `https://yourCallbackUrl/events`. The general structure of the webhook event will be as follows. ```json { "id": "a7dae8d0-8baa-7a3d-885f-a7fc14835718", "occurred_at": "2025-04-04T14:34:55.123Z", "event": "the_event_name", "data": { "id": "123", "something": "value" } } ``` There will be a top-level field `event` that describes what the type of event is. There will also be a `data` envelope that will contain the data for the event. ### Invoice Approved This event is emitted from the Vic system when an invoice has been approved. The payload for this event matches almost exactly what you will receive in the `getInvoice` operation. ```json { "id": "a7dae8d0-8baa-7a3d-885f-a7fc14835718", "occurred_at": "2025-04-04T14:34:55.123Z", "event": "invoice_approved", "data": { "totalAmount": "3.00", "totalVatAmount": "0.00", "amountWithoutTax": "1.00", "amountTax": "1.00", "amountNet": "1.00", "amountVat": "0.00", "amountSum": "3.00", "amountFreight": "1.00", "transactionType": "INVOICE", "refNumber": "INV-1231123", "poNumber": "PO-1231123", "description": "Invoice for the month of April", "currency": "USD", "fields": [ { "label": "custom:technician", "title": "Technician", "type": "text", "value": "John Doe" } ], "language": "en", "issueDate": "2019-08-24", "glDate": "2019-08-24", "dueDate": "2019-08-24", "paymentInfo": { "bankAccountNum": "1234567890", "bankCode": "1234567890", "paymentTerm": { "count": 30, "unit": "DAYS" }, "defaultMethod": "BANKACCOUNT" }, "internalId": "123", "internalUpdatedAt": "2019-08-24T14:15:22Z", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b", "externalUpdatedAt": "2019-08-24T14:15:22Z", "paymentTerm": { "count": 0, "unit": "DAYS" }, "paymentRef": "string", "vendorInternalId": "47", "vendorExternalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "vendor": { "internalId": "47", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "orgNumber": "string", "countryCode": "US", "name": "string" }, "lineItems": [ { "index": 1, "amountTax": "1.00", "amountNet": "1.00", "amountSum": "1.00", "amountFreight": "1.00", "description": "string", "comment": "string", "billable": true, "invoiceLineItemInfo": { "vatCode": "string", "vatAmount": 0, "vatRate": "1.00" }, "taxCode": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "code": "string", "description": "Tax code description", "rate": "0.25" }, "costAccount": { "internalId": "string", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "number": "string" }, "dimensions": [ { "name": "string", "type": "string", "typeName": "string", "typeExternalId": "string", "shortName": "string", "externalData": {}, "displayName": "string", "internalId": "47", "internalUpdatedAt": "2019-08-24T14:15:22Z", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "externalUpdatedAt": "2021-06-29T17:20:53.154" } ], "quantityInvoiced": "string", "lineItemTotal": "1.00", "lineType": "item", "poLineNumber": 0, "poNumber": "string", "poItemsMatched": [ { "invoiceItemId": "string", "purchaseOrderItemId": "string", "productNumber": "6512-41473", "unitOfMeasure": "kg", "amountMatched": "1.0", "quantityMatched": "1.0" } ], "unitPrice": "1.00", "number": "123456", "lineFields": [ { "label": "custom:serial_number", "title": "Serial Number", "type": "text", "value": "12-34540-1235" } ] } ], "postingError": null, "documentUrl": "http://example.com/invoice.pdf", "status": "NOT_READY", "bolNumbers": [], "selfAssessedUseTaxAmount": null, "selfAssessedUseTaxAccount": null, "markedAs": "PAID", "billStatus": "PAID", "externalPaymentDate": null, "externalPaymentNumber": null, "externalPaymentStatus": null } } ``` ### Invoice Deleted This event is emitted from the Vic system when an invoice has been deleted. The payload for this event is sparse. It only contains the `internalId` and `externalId` of the invoice. ```json { "id": "a7dae8d0-8baa-7a3d-885f-a7fc14835718", "occurred_at": "2025-04-04T14:34:55.123Z", "event": "invoice_deleted", "data": { "internalId": "123", "externalId": "I0001" } } ``` ### Invoice Post This event is emitted from the Vic system when an accountant wants to post an invoice to the ERP. This is a signal that the invoice is ready to be posted. The integrating system is expected to respond and either confirm or reject the post. The payload for this event matches almost exactly what you will receive in the `getInvoice` operation. Unlike the old `/invoicePost` event, this will not be a multipart event. You will be able to fetch the invoice pdf from the provided `documentUrl` in the payload. ```json { "id": "a7dae8d0-8baa-7a3d-885f-a7fc04835310", "occurred_at": "2025-04-04T14:34:55.123Z", "event": "invoice_post", "data": { "totalAmount": "3.00", "totalVatAmount": "0.00", "amountWithoutTax": "1.00", "amountTax": "1.00", "amountNet": "1.00", "amountVat": "0.00", "amountSum": "3.00", "amountFreight": "1.00", "transactionType": "INVOICE", "refNumber": "INV-1231123", "poNumber": "PO-1231123", "description": "Invoice for the month of April", "currency": "USD", "fields": [ { "label": "custom:technician", "title": "Technician", "type": "text", "value": "John Doe" } ], "language": "en", "issueDate": "2019-08-24", "glDate": "2019-08-24", "dueDate": "2019-08-24", "paymentInfo": { "bankAccountNum": "1234567890", "bankCode": "1234567890", "paymentTerm": { "count": 30, "unit": "DAYS" }, "defaultMethod": "BANKACCOUNT" }, "internalId": "123", "internalUpdatedAt": "2019-08-24T14:15:22Z", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b", "externalUpdatedAt": "2019-08-24T14:15:22Z", "paymentTerm": { "count": 0, "unit": "DAYS" }, "paymentRef": "string", "vendorInternalId": "47", "vendorExternalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "vendor": { "internalId": "47", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "orgNumber": "string", "countryCode": "US", "name": "string" }, "lineItems": [ { "index": 1, "amountTax": "1.00", "amountNet": "1.00", "amountSum": "1.00", "amountFreight": "1.00", "description": "string", "comment": "string", "billable": true, "invoiceLineItemInfo": { "vatCode": "string", "vatAmount": 0, "vatRate": "1.00" }, "taxCode": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "code": "string", "description": "Tax code description", "rate": "0.25" }, "costAccount": { "internalId": "string", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "number": "string" }, "dimensions": [ { "name": "string", "type": "string", "typeName": "string", "typeExternalId": "string", "shortName": "string", "externalData": {}, "displayName": "string", "internalId": "47", "internalUpdatedAt": "2019-08-24T14:15:22Z", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "externalUpdatedAt": "2021-06-29T17:20:53.154" } ], "quantityInvoiced": "string", "lineItemTotal": "1.00", "lineType": "item", "poLineNumber": 0, "poNumber": "string", "poItemsMatched": [ { "invoiceItemId": "string", "purchaseOrderItemId": "string", "productNumber": "6512-41473", "unitOfMeasure": "kg", "amountMatched": "1.0", "quantityMatched": "1.0" } ], "unitPrice": "1.00", "number": "123456", "lineFields": [ { "label": "custom:serial_number", "title": "Serial Number", "type": "text", "value": "12-34540-1235" } ] } ], "postingError": null, "documentUrl": "http://example.com/invoice.pdf", "status": "NOT_READY", "bolNumbers": [], "selfAssessedUseTaxAmount": null, "selfAssessedUseTaxAccount": null, "markedAs": "PAID", "billStatus": "PAID", "externalPaymentDate": null, "externalPaymentNumber": null, "externalPaymentStatus": null } } ``` ### Invoice Posted This event is emitted from the Vic system when an invoice has been posted to the ERP successfully. The payload for this event matches almost exactly what you will receive in the `getInvoice` operation. ```json { "id": "a7dae8d0-8baa-7a3d-885f-a7fc14835718", "occurred_at": "2025-04-04T14:34:55.123Z", "event": "invoice_posted", "data": { "totalAmount": "3.00", "totalVatAmount": "0.00", "amountWithoutTax": "1.00", "amountTax": "1.00", "amountNet": "1.00", "amountVat": "0.00", "amountSum": "3.00", "amountFreight": "1.00", "transactionType": "INVOICE", "refNumber": "INV-1231123", "poNumber": "PO-1231123", "description": "Invoice for the month of April", "currency": "USD", "fields": [ { "label": "custom:technician", "title": "Technician", "type": "text", "value": "John Doe" } ], "language": "en", "issueDate": "2019-08-24", "glDate": "2019-08-24", "dueDate": "2019-08-24", "paymentInfo": { "bankAccountNum": "1234567890", "bankCode": "1234567890", "paymentTerm": { "count": 30, "unit": "DAYS" }, "defaultMethod": "BANKACCOUNT" }, "internalId": "123", "internalUpdatedAt": "2019-08-24T14:15:22Z", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b", "externalUpdatedAt": "2019-08-24T14:15:22Z", "paymentTerm": { "count": 0, "unit": "DAYS" }, "paymentRef": "string", "vendorInternalId": "47", "vendorExternalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "vendor": { "internalId": "47", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "orgNumber": "string", "countryCode": "US", "name": "string" }, "lineItems": [ { "index": 1, "amountTax": "1.00", "amountNet": "1.00", "amountSum": "1.00", "amountFreight": "1.00", "description": "string", "comment": "string", "billable": true, "invoiceLineItemInfo": { "vatCode": "string", "vatAmount": 0, "vatRate": "1.00" }, "taxCode": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "code": "string", "description": "Tax code description", "rate": "0.25" }, "costAccount": { "internalId": "string", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "number": "string" }, "dimensions": [ { "name": "string", "type": "string", "typeName": "string", "typeExternalId": "string", "shortName": "string", "externalData": {}, "displayName": "string", "internalId": "47", "internalUpdatedAt": "2019-08-24T14:15:22Z", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "externalUpdatedAt": "2021-06-29T17:20:53.154" } ], "quantityInvoiced": "string", "lineItemTotal": "1.00", "lineType": "item", "poLineNumber": 0, "poNumber": "string", "poItemsMatched": [ { "invoiceItemId": "string", "purchaseOrderItemId": "string", "productNumber": "6512-41473", "unitOfMeasure": "kg", "amountMatched": "1.0", "quantityMatched": "1.0" } ], "unitPrice": "1.00", "number": "123456", "lineFields": [ { "label": "custom:serial_number", "title": "Serial Number", "type": "text", "value": "12-34540-1235" } ] } ], "postingError": null, "documentUrl": "http://example.com/invoice.pdf", "status": "NOT_READY", "bolNumbers": [], "selfAssessedUseTaxAmount": null, "selfAssessedUseTaxAccount": null, "markedAs": "PAID", "billStatus": "PAID", "externalPaymentDate": null, "externalPaymentNumber": null, "externalPaymentStatus": null } } ``` ### Invoice Rejected This event is emitted from the Vic system when an invoice has been rejected during the approval process. The payload for this event matches almost exactly what you will receive in the `getInvoice` operation. The structure is identical to `invoice_approved` — refer to that event for the full payload example. ### Invoice Restored This event is emitted from the Vic system when a previously deleted invoice has been restored. It is the counterpart to `invoice_deleted`: subscribing to both lets you distinguish an invoice that was deleted, restored, and deleted again from a genuinely duplicated delete. The payload for this event is sparse — it contains only the `internalId` and `externalId` of the invoice. ```json { "id": "b8ebf9e1-9cbb-8b4e-996f-b8fd25946829", "occurred_at": "2025-04-04T14:34:55.123Z", "event": "invoice_restored", "data": { "internalId": "123", "externalId": "I0001" } } ``` ### Invoice Submitted This event is emitted from the Vic system when an invoice has been submitted for processing. The payload for this event matches almost exactly what you will receive in the `getInvoice` operation. The structure is identical to `invoice_approved` — refer to that event for the full payload example. ### Invoice Transfer This event is emitted from the Vic system when an accountant wants to transfer an invoice to the ERP. This is a signal that the invoice is ready to be transferred. The integrating system is expected to respond and either confirm or reject the transfer. The payload for this event matches almost exactly what you will receive in the `getInvoice` operation. ```json { "id": "a7dae8d0-8baa-7a3d-885f-a7fc14835718", "occurred_at": "2025-04-04T14:34:55.123Z", "event": "invoice_transfer", "data": { "totalAmount": "3.00", "totalVatAmount": "0.00", "amountWithoutTax": "1.00", "amountTax": "1.00", "amountNet": "1.00", "amountVat": "0.00", "amountSum": "3.00", "amountFreight": "1.00", "transactionType": "INVOICE", "refNumber": "INV-1231123", "poNumber": "PO-1231123", "description": "Invoice for the month of April", "currency": "USD", "fields": [ { "label": "custom:technician", "title": "Technician", "type": "text", "value": "John Doe" } ], "language": "en", "issueDate": "2019-08-24", "glDate": "2019-08-24", "dueDate": "2019-08-24", "paymentInfo": { "bankAccountNum": "1234567890", "bankCode": "1234567890", "paymentTerm": { "count": 30, "unit": "DAYS" }, "defaultMethod": "BANKACCOUNT" }, "internalId": "123", "internalUpdatedAt": "2019-08-24T14:15:22Z", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b", "externalUpdatedAt": "2019-08-24T14:15:22Z", "paymentTerm": { "count": 0, "unit": "DAYS" }, "paymentRef": "string", "vendorInternalId": "47", "vendorExternalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "vendor": { "internalId": "47", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "orgNumber": "string", "countryCode": "US", "name": "string" }, "lineItems": [ { "index": 1, "amountTax": "1.00", "amountNet": "1.00", "amountSum": "1.00", "amountFreight": "1.00", "description": "string", "comment": "string", "billable": true, "invoiceLineItemInfo": { "vatCode": "string", "vatAmount": 0, "vatRate": "1.00" }, "taxCode": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "code": "string", "description": "Tax code description", "rate": "0.25" }, "costAccount": { "internalId": "string", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "number": "string" }, "dimensions": [ { "name": "string", "type": "string", "typeName": "string", "typeExternalId": "string", "shortName": "string", "externalData": {}, "displayName": "string", "internalId": "47", "internalUpdatedAt": "2019-08-24T14:15:22Z", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "externalUpdatedAt": "2021-06-29T17:20:53.154" } ], "quantityInvoiced": "string", "lineItemTotal": "1.00", "lineType": "item", "poLineNumber": 0, "poNumber": "string", "poItemsMatched": [ { "invoiceItemId": "string", "purchaseOrderItemId": "string", "productNumber": "6512-41473", "unitOfMeasure": "kg", "amountMatched": "1.0", "quantityMatched": "1.0" } ], "unitPrice": "1.00", "number": "123456", "lineFields": [ { "label": "custom:serial_number", "title": "Serial Number", "type": "text", "value": "12-34540-1235" } ] } ], "postingError": null, "documentUrl": "http://example.com/invoice.pdf", "status": "NOT_READY", "bolNumbers": [], "selfAssessedUseTaxAmount": null, "selfAssessedUseTaxAccount": null, "markedAs": "PAID", "billStatus": "PAID", "externalPaymentDate": null, "externalPaymentNumber": null, "externalPaymentStatus": null } } ``` ### Invoice Updated This event is emitted from the Vic system when an invoice has been updated. The payload for this event matches almost exactly what you will receive in the `getInvoice` operation. The structure is identical to `invoice_approved` — refer to that event for the full payload example. ### Purchase Order Created This event is emitted from the Vic system when a purchase order has been created. The payload for this event matches almost exactly what you will receive in the `getPurchaseOrder` operation. ```json { "id": "a7dae8d0-8baa-7a3d-885f-a7fc14835718", "occurred_at": "2025-04-04T14:34:55.123Z", "event": "purchase_order_created", "data": { "internalId": "string", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "vendor": { "internalId": "47", "internalUpdatedAt": "2019-08-24T14:15:22Z", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "externalUpdatedAt": "2021-06-29T17:20:53.154", "name": "Acme Corporation", "email": "vendor@acme.com", "description": "They sell anvils", "phone": "555-555-5555", "addressStreet": "123 Main Street\nSuite 100", "addressCity": "Springfield", "addressState": "IL", "addressPostalCode": "62701", "countryCode": "US", "currency": "USD", "confirmedAt": "2019-08-24T14:15:22Z", "state": "CONFIRMED", "taxInfo": { "taxId": "11-1234567", "is1099vendor": false, "orgNumber": null }, "defaultPaymentInfo": null, "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b", "poMatchingDocumentLevel": false, "vendorGroupId": "c4299feb-c5fa-4e0b-a7a6-51fbfbe0854d", "tags": [], "externalData": {}, "errors": [] }, "internalUpdatedAt": "2019-08-24T14:15:22Z", "issuedOn": "2019-08-24", "createdOn": "2019-08-24", "poNumber": "string", "deliverOn": "2019-08-24", "amount": "1.00", "currencyId": "USD", "status": "open", "matchingType": "document", "type": "blanket", "description": "string", "lineItems": [ { "internalId": "string", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "productNumber": "string", "productDescription": "string", "unitOfMeasure": "kg", "quantityAccepted": "1.0", "quantityRequested": "1.0", "quantityReceived": "1.0", "matchingType": "two_way", "unitAmount": "1.00", "lineItemTotal": "1.00", "lineNumber": 1, "dimensions": [ { "internalId": "1234", "externalId": "D0123148", "name": "project - the big one", "typeExternalId": "project" } ], "invoiceItemsMatched": [ { "invoiceItemId": "123", "purchaseOrderItemId": "6bde599d-3b7e-497c-ab91-1594a2efcdab", "unitOfMeasure": "kg", "amountMatched": "123.34", "quantityMatched": "1.0" } ], "memo": "string", "status": "open" } ], "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b" } } ``` ### Purchase Order Updated This event is emitted from the Vic system when a purchase order has been updated. The payload for this event matches almost exactly what you will receive in the `getPurchaseOrder` operation. This event is a snapshot of the purchase order at the time of the event. ```json { "id": "a7dae8d0-8baa-7a3d-885f-a7fc14835718", "occurred_at": "2025-04-04T14:34:55.123Z", "event": "purchase_order_updated", "data": { "internalId": "string", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "vendor": { "internalId": "47", "internalUpdatedAt": "2019-08-24T14:15:22Z", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "externalUpdatedAt": "2021-06-29T17:20:53.154", "name": "Acme Corporation", "email": "vendor@acme.com", "description": "They sell anvils", "phone": "555-555-5555", "addressStreet": "123 Main Street\nSuite 100", "addressCity": "Springfield", "addressState": "IL", "addressPostalCode": "62701", "countryCode": "US", "currency": "USD", "confirmedAt": "2019-08-24T14:15:22Z", "state": "CONFIRMED", "taxInfo": { "taxId": "11-1234567", "is1099vendor": false, "orgNumber": null }, "defaultPaymentInfo": null, "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b", "poMatchingDocumentLevel": false, "vendorGroupId": "c4299feb-c5fa-4e0b-a7a6-51fbfbe0854d", "tags": [], "externalData": {}, "errors": [] }, "internalUpdatedAt": "2019-08-24T14:15:22Z", "issuedOn": "2019-08-24", "createdOn": "2019-08-24", "poNumber": "string", "deliverOn": "2019-08-24", "amount": "1.00", "currencyId": "USD", "status": "open", "matchingType": "document", "type": "blanket", "description": "string", "lineItems": [ { "internalId": "string", "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238", "productNumber": "string", "productDescription": "string", "unitOfMeasure": "kg", "quantityAccepted": "1.0", "quantityRequested": "1.0", "quantityReceived": "1.0", "matchingType": "two_way", "unitAmount": "1.00", "lineItemTotal": "1.00", "lineNumber": 1, "dimensions": [ { "internalId": "1234", "externalId": "D0123148", "name": "project - the big one", "typeExternalId": "project" } ], "invoiceItemsMatched": [ { "invoiceItemId": "123", "purchaseOrderItemId": "6bde599d-3b7e-497c-ab91-1594a2efcdab", "unitOfMeasure": "kg", "amountMatched": "123.34", "quantityMatched": "1.0" } ], "memo": "string", "status": "open" } ], "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b" } } ``` ### Purchase Order Deleted This event is emitted from the Vic system when a purchase order has been deleted. The payload for this event is sparse. It only contains the `internalId` and `externalId` of the purchase order. ```json { "id": "a7dae8d0-8baa-7a3d-885f-a7fc14835718", "occurred_at": "2025-04-04T14:34:55.123Z", "event": "purchase_order_deleted", "data": { "internalId": "4c029f1b-f87f-4a05-a511-8cda223dad2a", "externalId": "12345" } } ``` ### Payment Batch Processed This event is emitted from the Vic system when a batch of payments has been sent to the payment processor and a successful response has been obtained. The payload for this event matches almost exactly what you will receive in the `getPaymentBatch` operation. Only approved credits and payments will be emitted with the event. Voided and rejected payments will not be sent. If you need these values, you should call `getPaymentBatch` in order to fetch them. Here is an example of an $200 invoice being paid in full with a $20 credit note being applied. This will bring the total batch payment to $180. The credit note applied is not subtracted from the payment in this breakdown because ERPs typically need entries of the payment being applied and the credit note being used in conjunction with that credit note. ```json { "id": "a7dae8d0-8bsa-7a3d-882f-a7fc14835719", "event": "payment_batch_processed", "occurred_at": "2025-04-04T14:34:55.123Z", "data": { "id": "f1c2384f-57d8-41fe-afa6-17caf62b2a3f", "name": "Batch 2023-10-01 001", "processedAt": "2023-10-01T19:12:00Z", "approvedAt": "2023-10-01T19:12:00Z", "rejectedAt": null, "voidedAt": null, "status": "approved", "companyId": "123", "payments": [ { "id": "edb3a624-9f12-4cd8-adb8-4d9a5ec0b48b", "amount": "200.00", "settlementAmount": "200.00", "settlementCurrencyId": "USD", "exchangeRate": "1.0", "discountAmount": "0.00", "currencyId": "USD", "status": "approved", "voidedAt": null, "rejectedAt": null, "approvedAt": "2023-10-01T19:12:00Z", "fundedAt": null, "costAccount": { "internalId": "1", "externalId": "cost-account-id-in-erp" }, "invoice": { "internalId": "876", "externalId": "invoice-id-in-erp", "refNumber": "INV-123456" }, "vendor": { "internalId": "409", "externalId": "vendor-id-in-erp" }, } ], "credits": [ { "id": "091f257a-9b6e-4797-bcb6-ccd36dda260f", "amount": "20.00", "settlementAmount": "20.00", "settlementCurrencyId": "USD", "exchangeRate": "1.0", "discountAmount": "0.00", "currencyId": "USD", "status": "approved", "voidedAt": null, "rejectedAt": null, "approvedAt": "2023-10-01T19:12:00Z", "fundedAt": null, "costAccount": { "internalId": "1", "externalId": "cost-account-id-in-erp" }, "invoice": { "internalId": "900", "externalId": "credit-note-id-in-erp", "refNumber": "CRN-123456" }, "vendor": { "internalId": "409", "externalId": "vendor-id-in-erp" }, } ] } } ``` ### Payment Status Updated This event is emitted when a payment you were previously notified about reaches a terminal outcome. For now it is sent only for negative outcomes (`failed`, `returned` and `voided`) and may be extended to other statuses later, so read `data.status` rather than assuming the outcome. Use it to keep your own system in sync without polling. Credits have their own [`credit_status_updated`](#credit-status-updated) event. * `data` is the payment itself, in the same shape the `getPaymentBatch` operation returns, flattened directly onto `data` (plus `batchId`). * `data.status` is the outcome that fired (`failed`, `returned` or `voided`). It overrides the payment's own status, so a returned payment reads `returned` here even though its underlying status may be `funded`. ```json { "id": "a7dae8d0-8baa-7a3d-885f-a7fc14835718", "occurred_at": "2025-04-04T14:34:55.123Z", "event": "payment_status_updated", "data": { "status": "failed", "batchId": "f1c2384f-57d8-41fe-afa6-17caf62b2a3f", "id": "edb3a624-9f12-4cd8-adb8-4d9a5ec0b48b", "amount": "200.00", "currencyId": "USD", "failedAt": "2023-10-02T08:00:00Z", "failedReason": "insufficient_funds", "invoice": { "internalId": "876", "externalId": "invoice-id-in-erp", "refNumber": "INV-123456" }, "vendor": { "internalId": "409", "externalId": "vendor-id-in-erp" } } } ``` ### Credit Status Updated This event mirrors [`payment_status_updated`](#payment-status-updated) for credits. It is emitted when a credit you were previously notified about reaches a terminal outcome (currently `failed`, `returned` or `voided`). * `data` is the credit itself, in the same shape the `getPaymentBatch` operation returns, flattened directly onto `data` (plus `batchId`). * `data.status` is the outcome that fired (`failed`, `returned` or `voided`), overriding the credit's own status. ```json { "id": "b1e9c7d2-4a3f-7b1e-995a-c2fd25946832", "occurred_at": "2025-04-04T14:34:55.123Z", "event": "credit_status_updated", "data": { "status": "voided", "batchId": "f1c2384f-57d8-41fe-afa6-17caf62b2a3f", "id": "091f257a-9b6e-4797-bcb6-ccd36dda260f", "amount": "20.00", "currencyId": "USD", "voidedAt": "2023-10-02T08:00:00Z", "invoice": { "internalId": "900", "externalId": "credit-note-id-in-erp", "refNumber": "CRN-123456" }, "vendor": { "internalId": "409", "externalId": "vendor-id-in-erp" } } } ``` ### Vendor Onboarding Form Completed This event is emitted from the Vic system when a vendor completes their onboarding form submission. The payload includes the full vendor details along with the specific completed onboarding form, its items, and all responses. This event is useful for integrations that need to capture vendor onboarding information, validate submitted data, or trigger follow-up processes in external systems when vendors complete their onboarding. ```json { "id": "a7dae8d0-8baa-7a3d-885f-a7fc14835718", "occurred_at": "2025-04-04T14:34:55.123Z", "event": "vendor_onboarding_form_completed", "data": { "vendor": { "id": "550e8400-e29b-41d4-a716-446655440000", "legacy_id": "12345", "name": "Acme Corporation", "legal_name": "Acme Corporation Inc.", "doing_business_as": "Acme Supply Co", "email": "vendor@acme.com", "description": "Office supplies vendor", "phone": "+1-555-123-4567", "address_street_1": "123 Main Street", "address_street_2": "Suite 100", "address_city": "Springfield", "address_state": "IL", "address_postal_code": "62701", "country_code": "US", "currency": "USD", "org_number": "123456789", "tax_id": "12-3456789", "tax_id_type": "ein", "track_1099": false, "confirmed_at": "2025-04-04T14:30:00Z", "state": "pending", "remote_id": "vendor-ext-123", "remote_updated_at": "2025-04-04T14:30:00Z", "remote_data": null, "remote_errors": null, "payment_term_id": "80b25998-53d5-4563-abd4-ea6566e3cf2b", "po_matching_document_level": false, "vendor_group_id": null, "updated_at": "2025-04-04T14:30:00Z", "ofac_status": "cleared", "ofac_report": { "id": "ad158953-172d-44dd-aaf0-a61882c792d0", "high_risk_hits": 0, "medium_risk_hits": 0, "low_risk_hits": 0, "total_hits": 0, "risk_level": "low", "matches": [], "created_at": "2025-04-04T14:25:00Z" }, "banking_info": [ { "id": "7c5e8400-e29b-41d4-a716-446655440001", "kind": "ach", "account_number": "123456789", "is_primary": true } ], "tags": [ { "id": "9f3a8400-e29b-41d4-a716-446655440002", "value": "preferred-vendor" } ] }, "form": { "id": "b2c4e8d0-8baa-7a3d-885f-a7fc14835720", "status": "submitted", "template_version_id": "d5f7a2b1-9cde-4f6g-7h8i-9j0k1l2m3n4o", "inserted_at": "2025-04-01T10:00:00Z", "updated_at": "2025-04-04T14:30:00Z", "items": [ { "id": "c3d5f9e1-9cba-8b4e-996g-b8gd25946831", "type": "text", "required": true, "order": 1, "value": "Acme Corporation", "date_value": null, "question": { "id": "e6g8h0f2-0deb-9c5f-007h-c9he36057942", "label": "What is your business name?", "type": "text", "required": true, "placeholder": "Enter your business name", "max_length": 255, "validation": null, "min_selection": null, "max_selection": null, "rows": null, "available_options": [] }, "options": [] }, { "id": "d4e6g0f2-0dcb-9c5f-007h-c9he36057943", "type": "email", "required": true, "order": 2, "value": "contact@acme.com", "date_value": null, "question": { "id": "f7h9i1g3-1edc-0d6g-118i-d0if47168053", "label": "Primary contact email", "type": "email", "required": true, "placeholder": "email@example.com", "max_length": null, "validation": null, "min_selection": null, "max_selection": null, "rows": null, "available_options": [] }, "options": [] }, { "id": "e5f7h1g3-1edc-0d6g-118i-d0if47168054", "type": "date", "required": false, "order": 3, "value": null, "date_value": "2025-01-15", "question": { "id": "g8i0j2h4-2fed-1e7h-229j-e1jg58279164", "label": "When did you incorporate?", "type": "date", "required": false, "placeholder": null, "max_length": null, "validation": null, "min_selection": null, "max_selection": null, "rows": null, "available_options": [] }, "options": [] }, { "id": "f6g8i2h4-2fed-1e7h-229j-e1jg58279165", "type": "radio", "required": true, "order": 4, "value": null, "date_value": null, "question": { "id": "h9j1k3i5-3gfe-2f8i-330k-f2kh69380275", "label": "Are you a registered business?", "type": "radio", "required": true, "placeholder": null, "max_length": null, "validation": null, "min_selection": null, "max_selection": null, "rows": null, "available_options": [ { "id": "i0k2l4j6-4hgf-3g9j-441l-g3li70491386", "value": "Yes", "order": 1, "allow_custom": false }, { "id": "j1l3m5k7-5ihg-4h0k-552m-h4mj81502497", "value": "No", "order": 2, "allow_custom": false } ] }, "options": [ { "id": "g7h9j3i5-3gfe-2f8i-330k-f2kh69380276", "value": "Yes", "custom": null, "order": 1, "selected_option": { "id": "i0k2l4j6-4hgf-3g9j-441l-g3li70491386", "value": "Yes", "allow_custom": false } } ] }, { "id": "h8i0k4j6-4hgf-3g9j-441l-g3li70491387", "type": "checkbox", "required": false, "order": 5, "value": null, "date_value": null, "question": { "id": "j1l3m5k7-5ihg-4h0k-552m-h4mj81502497", "label": "Which certifications do you have?", "type": "checkbox", "required": false, "placeholder": null, "max_length": null, "validation": null, "min_selection": 1, "max_selection": null, "rows": null, "available_options": [ { "id": "k2m4n6l8-6jih-5i1l-663n-i5nk92613508", "value": "ISO 9001", "order": 1, "allow_custom": false }, { "id": "l3n5o7m9-7kji-6j2m-774o-j6ol03724619", "value": "ISO 14001", "order": 2, "allow_custom": false }, { "id": "m4o6p8n0-8lkj-7k3n-885p-k7pm14835730", "value": "ISO 27001", "order": 3, "allow_custom": false } ] }, "options": [ { "id": "i9j1l5k7-5ihg-4h0k-552m-h4mj81502498", "value": "ISO 9001", "custom": null, "order": 1, "selected_option": { "id": "k2m4n6l8-6jih-5i1l-663n-i5nk92613508", "value": "ISO 9001", "allow_custom": false } }, { "id": "j0k2m6l8-6jih-5i1l-663n-i5nk92613509", "value": "ISO 14001", "custom": null, "order": 2, "selected_option": { "id": "l3n5o7m9-7kji-6j2m-774o-j6ol03724619", "value": "ISO 14001", "allow_custom": false } } ] }, { "id": "k1l3n7m9-7kji-6j2m-774o-j6ol03724620", "type": "dropdown", "required": true, "order": 6, "value": null, "date_value": null, "question": { "id": "m4o6p8n0-8lkj-7k3n-885p-k7pm14835730", "label": "What industry are you in?", "type": "dropdown", "required": true, "placeholder": "Select an industry", "max_length": null, "validation": null, "min_selection": null, "max_selection": null, "rows": null, "available_options": [ { "id": "o6q8r0p2-0nmk-9m5p-007r-m9ro36158052", "value": "Technology", "order": 1, "allow_custom": false }, { "id": "p7r9s1q3-1onl-0n6q-118s-n0sp47269163", "value": "Manufacturing", "order": 2, "allow_custom": false }, { "id": "n5p7q9o1-9mlk-8l4o-996q-l8qn25946841", "value": "Other", "order": 3, "allow_custom": true } ] }, "options": [ { "id": "l2m4o8n0-8lkj-7k3n-885p-k7pm14835731", "value": "Other", "custom": "Custom industry type", "order": 1, "selected_option": { "id": "n5p7q9o1-9mlk-8l4o-996q-l8qn25946841", "value": "Other", "allow_custom": true } } ] } ] } } } ``` ### Vendor Created This event is emitted when a vendor is created in Vic — for example, after a user fills in the add-vendor form in the Vic UI. The payload contains the full vendor record so that an external ERP can create a matching vendor. Both the predefined ("common") fields and any per-company custom fields the company has configured for vendors flow through to this payload via the vendor's standard attributes. Values that the company has not provided are sent as `null`. ```json { "id": "a7dae8d0-8baa-7a3d-885f-a7fc14835720", "occurred_at": "2025-04-04T14:34:55.123Z", "event": "vendor_created", "data": { "id": "550e8400-e29b-41d4-a716-446655440000", "legacy_id": "12345", "name": "Acme Corporation", "legal_name": "Acme Corporation Inc.", "remote_id": null, "state": "pending" } } ``` ### Vendor Updated This event is emitted when an existing vendor is updated in Vic. The payload mirrors `vendor_created`. Rapid successive edits to the same vendor are debounced — only the most recent state is delivered after a short window. An update that doesn't change any vendor data — for example, re-sending identical data — does not emit this event. ```json { "id": "a7dae8d0-8baa-7a3d-885f-a7fc14835721", "occurred_at": "2025-04-04T14:34:55.123Z", "event": "vendor_updated", "data": { "id": "550e8400-e29b-41d4-a716-446655440000", "legacy_id": "12345", "name": "Acme Corporation", "remote_id": "vendor-ext-123", "state": "active" } } ```