Webhook Notifications for Invoicing {#invoicing-webhooks-intro}
===============================================================

Webhooks are automated notifications generated by system events that occur in your organization. You can create a webhook subscription for invoicing events to receive a notification when an invoice is:

* Cancelled
* Five-day early reminder
* Fully paid
* Overdue reminder
* Partially paid
* Sent

You must have a URL for the webhook notifications to be sent to.  
Notifications that contain sensitive, personally identifiable information (PII), such as account numbers, are sent using message-level encryption. Transport Layer Security is required in order to ensure data integrity.  
There are additional requirements for implementing webhooks that are not discussed in this guide. To create to webhook subscription to receive invoicing related notifications, see the [*Webhooks Implementation Guide*](https://developer.visaacceptance.com/docs/vas/en-us/webhooks/implementation/all/rest/webhooks/wh-fg-intro.md "").

Invoicing Product ID and Event Types
------------------------------------

When you send a *create a webhook subscription* request, set the products.productId field to `customerInvoicing` and set the products.eventTypes field to one or more of the values listed in the Event Type Field Value column in the table below. If you include multiple event types in your request, separate each event type field value with the comma character (`,`).

|     Product ID      |             Event Type Field Value             |                                                                  Description                                                                   |
|---------------------|------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|
| `customerInvoicing` | `invoicing.customer.invoice.cancel`            | Merchants can subscribe to this event type to automate how their system is informed when an invoice is cancelled.                              |
| `customerInvoicing` | `invoicing.customer.invoice.overdue-reminder ` | Notifies you 1 day after the invoice payment is due. This event is triggered if you have invoice reminders enabled in your invoice settings.   |
| `customerInvoicing` | `invoicing.customer.invoice.paid`              | Merchants can subscribe to this event type to automate how their system is informed when an invoice is fully paid.                             |
| `customerInvoicing` | `invoicing.customer.invoice.partial-payment`   | Merchants can subscribe to this event type to automate how their system is informed when an invoice is partially paid.                         |
| `customerInvoicing` | `invoicing.customer.invoice.reminder`          | Notifies you 5 days before the invoice payment is due. This event is triggered if you have invoice reminders enabled in your invoice settings. |
| `customerInvoicing` | `invoicing.customer.invoice.send`              | Merchants can subscribe to this event type to automate how their system is informed when an invoice is sent to the customer.                   |
[Invoicing Webhook Product ID and Event Types]

Example: Creating an Invoice Webhook Subscription {#x-ex-rest}
==============================================================

> IMPORTANT  
> There are additional requirements for implementing webhooks that are not discussed in this guide. To create to webhook subscription to receive invoicing related notifications, see the [*Webhooks Implementation Guide*](https://developer.visaacceptance.com/docs/vas/en-us/webhooks/implementation/all/rest/webhooks/wh-fg-intro.md "").  
> Only use this example to reference how to format the eventTypes request field and its values.
> Request

```
{
  "name": "Invoicing Webhooks",
  "description": "Webhooks for Invoicing Events",
  "organizationId": "organizationId",
  "productId": "customerInvoicing",
  "eventTypes": [
    "invoicing.customer.invoice.cancel",
    "invoicing.customer.invoice.paid",
    "invoicing.customer.invoice.partial-payment",
    "invoicing.customer.invoice.send"
  ],
  "webhookUrl": "https://test.com:443/test",
  "healthCheckUrl": "https://test.com:443/test",
  "notificationScope": "SELF",
  "retryPolicy": {
    "algorithm": "ARITHMETIC",
    "firstRetry": 1,
    "interval": 1,
    "numberOfRetries": 3,
    "deactivateFlag": "false",
    "repeatSequenceCount": 0,
    "repeatSequenceWaitTime": 0
  },
  "securityPolicy": {
    "securityType": "KEY",
    "proxyType": "external"
  }
}
```

Response to a Successful Request

```
{
  "organizationId": "invoicetest",
  "productId": "customerInvoicing",
  "eventTypes": [
    "invoicing.customer.invoice.cancel",
    "invoicing.customer.invoice.paid",
    "invoicing.customer.invoice.partial-payment",
    "invoicing.customer.invoice.send"
  ],
  "webhookId": "fc880f5a-2145-44db-e053-9e588e0a6a26",
  "name": "Invoicing Webhooks",
  "webhookUrl": "https://test.com:443/test",
  "healthCheckUrl": "https://test.com:443/test",
  "createdOn": "2023-05-25T16:24:51.886Z",
  "status": "INACTIVE",
  "description": "Webhooks for Invoicing Events",
  "retryPolicy": {
    "algorithm": "ARITHMETIC",
    "firstRetry": 1,
    "interval": 1,
    "numberOfRetries": 3,
    "deactivateFlag": false,
    "repeatSequenceCount": 0,
    "repeatSequenceWaitTime": 0
  },
  "securityPolicy": {
    "securityType": "KEY",
    "proxyType": "external",
    "digitalSignatureEnabled": "yes"
  },
  "version": "3",
  "deliveryType": "nrtdCentral",
  "notificationScope": "SELF"
}
```

