Invoice providers
Invoice provider webhooks are emitted by the Invoices API when invoice providers are created, updated, or deleted (POST /providers, PUT /providers/:providerId, DELETE /providers/:providerId).
Events
| Action |
Event name |
| create an invoice provider (POST /providers) |
invoice_providers.created |
| update an invoice provider (PUT /providers/:providerId) |
invoice_providers.updated |
| delete an invoice provider (DELETE /providers/:providerId) |
invoice_providers.deleted |
Payload example (invoice_providers.created)
{
"attemptId": "0ab70210-547a-4a7a-8e1b-e402a8663308",
"created": 1623794899,
"data": {
"invoiceProviderId": "infile",
"enabled": true,
"params": {
"signerKey": "616d7b0bc0dc743272f3dc16",
"alias": "ALIAS",
"key": "VTLLSS98E43B213H",
"country": "AD",
"commercialName": "Henry Schein Inc.",
"name": "Raymond Bell",
"tin": "186637664",
"IVAAffiliation": "GEN",
"institutionCode": "1",
"address": "1638 Retij Road",
"zip": "93472",
"province": "SK",
"city": "Egpuezu",
"email": "nif@nojuh.es"
},
"accountId": "563c1457c4f260b0b7765569",
"createdBy": "4e9774b45f014e0100000003",
"updatedBy": "4e9774b45f014e0100000003",
"createdAt": {
"value": "2021-10-18T13:47:55.691Z",
"offset": 0
},
"updatedAt": {
"value": "2021-10-18T13:47:55.692Z",
"offset": 0
},
"_id": "616d7b0bc0dc743272f3dc17"
},
"event": "invoice_providers.created",
"id": "efec49e0-80a0-4734-bf02-2581cddd13af",
"livemode": true
}
Payload fields (invoice_providers.created)
| Field |
Type |
Description |
| providerId |
string |
Account ID of the provider (24-character hex ObjectId). Sent by the API. |
| apiKey |
string |
API key used for the request (X-API-KEY header). |
| data |
object |
The full provider document. Same shape as GET /providers/:providerId response; includes _id, invoiceProviderType, enabled, params, accountId, currencies, operatingCompanies, createdBy, updatedBy, createdAt, updatedAt, etc. |
Payload example (invoice_providers.updated)
{
"attemptId": "f6489e7c-ae53-4d9f-a61d-cd6e12ae640b",
"created": 1623794899,
"data": {
"invoiceProviderId": "infile",
"enabled": false,
"params": {
"signerKey": "616d7b0bc0dc743272f3dc16",
"alias": "ALIAS",
"key": "VTLLSS98E43B213H",
"country": "AD",
"commercialName": "Henry Schein Inc.",
"name": "Raymond Bell",
"tin": "186637664",
"IVAAffiliation": "GEN",
"institutionCode": "1",
"address": "1638 Retij Road",
"zip": "93472",
"province": "SK",
"city": "Egpuezu",
"email": "nif@nojuh.es"
},
"accountId": "563c1457c4f260b0b7765569",
"createdBy": "4e9774b45f014e0100000003",
"updatedBy": "4e9774b45f014e0100000003",
"createdAt": {
"value": "2021-10-18T13:47:55.691Z",
"offset": 0
},
"updatedAt": {
"value": "2021-10-18T13:47:55.692Z",
"offset": 0
},
"_id": "616d7b0bc0dc743272f3dc17"
},
"event": "invoice_providers.updated",
"id": "75372595-b02e-4462-96ef-7425d9a68694",
"livemode": true
}
Payload fields (invoice_providers.updated)
| Field |
Type |
Description |
| providerId |
string |
Account ID of the provider (24-character hex ObjectId). |
| apiKey |
string |
API key used for the request (X-API-KEY header). |
| data |
object |
The full updated provider document. Same shape as GET /providers/:providerId response. |
Payload example (invoice_providers.deleted)
{
"attemptId": "d58defed-a305-43f5-8ce8-0db76fae8f2b",
"created": 1623954546,
"data": {
"providerId": "60cb946a59d5f340cdf7641a"
},
"event": "invoice_providers.deleted",
"id": "2848c400-2795-4ebf-a6f8-f935a97701f0",
"livemode": true
}
Payload fields (invoice_providers.deleted)
| Field |
Type |
Description |
| providerId |
string |
Account ID of the account that owned the provider (24-character hex ObjectId). Sent at top level by the API. |
| apiKey |
string |
API key used for the request (X-API-KEY header). |
| data |
object |
Object with single field providerId (string): the ID of the deleted invoice provider (24-character hex ObjectId). |