Invoices

Invoices

Invoice webhooks are emitted by the Invoices API when an invoice is created or updated. Events are emitted from create/update flows (e.g. POST infile, POST infile-json, POST gti, POST dlink, POST/PUT retry).

Events

Action Event name
create an invoice (POST infile, infile-json, gti, dlink; POST /retry) invoices.created
update an invoice (e.g. GTI/DLink update flow; PUT /retry with existing document) invoices.updated

Payload example (invoices.created / invoices.updated)

The API emits { providerId, apiKey, data } where data is the invoice document. The delivery envelope may include additional fields (e.g. attemptId, created, event, id, livemode).

{
  "attemptId": "0ab70210-547a-4a7a-8e1b-e402a8663308",
  "created": 1623794899,
  "data": {
    "invoiceProviderId": "5f243d100617680712e78dd7",
    "authNumber": "BD2ECBAC-4B37-4760-8DD9-9D50C3C9B194",
    "serie": "456889",
    "number": "1261913952",
    "type": "certification",
    "data": "YTdjYjkyZWQ4N2M0MGNhY2EyMTYyMjc1OWJjNDJlMTFjZGY5ZDQ2MTg1ZjMxOTViZGNkMzQ2MjJiZjZiZTc0ZmJsYWJsYWJsYXRlc3Rlc3Rlc3Q=",
    "transactionId": "616d7cf38fedff37e449215c",
    "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": "616d7cf38fedff37e4492161"
  },
  "event": "invoices.created",
  "id": "efec49e0-80a0-4734-bf02-2581cddd13af",
  "livemode": true
}

Payload fields (invoices.created / invoices.updated)

Field Type Description
providerId string Account ID of the provider that owns the invoice (24-character hex ObjectId). Sent by the API as part of the emitted payload.
apiKey string API key used for the request (X-API-KEY header). Sent by the API as part of the emitted payload.
data object The invoice document. Same shape as GET /invoices/:invoiceId response (invoice): _id, authNumber, serie, number, type, data (base64), accountId, invoiceProviderType, invoiceProviderId, transactionId, createdBy, updatedBy, createdAt, updatedAt; may include additional provider-specific fields (e.g. buyer, items, totals, certified, currency).