Docs

invoice.updated

Preview· P9

An invoice changed. An issued invoice changes only by a credit or debit note, never in place.

Agoo sends this as a signed POST to every enabled endpoint subscribed to invoice.updated (or *). Verify the signature, return any 2xx within 15 seconds, and de-duplicate on webhook-id.

Header Parameters

webhook-id*string

The event's ID. It is the same on every attempt and redelivery, so use it to de-duplicate.

Match^evt_[0-7][0-9a-hjkmnp-tv-z]{25}$
Example"evt_01m4ww0ezgf2bryg9gxb2gbewx"
webhook-timestamp*string

When this attempt was signed, in Unix seconds. Reject the request if it is more than 5 minutes from your clock.

Match^[0-9]+$
webhook-signature*string

One or more space-separated signatures, each v1,<base64>: the base64 HMAC-SHA256 of {webhook-id}.{webhook-timestamp}.{raw body}, keyed with the base64-decoded part of your whsec_ secret. During a secret rotation there are two. Accept the request if any one matches.

Request Body

application/json
  1. body

An event about a sales invoice. The object is brief: read the invoice with finance:read for its lines.

id*EventId

The event's ID. Webhook deliveries send it as webhook-id.

Match^evt_[0-7][0-9a-hjkmnp-tv-z]{25}$
Example"evt_01m4ww0ezgf2bryg9gxb2gbewx"
created_at*string

When the event happened.

Formatdate-time
organisation_id*OrganisationId

An organisation ID (TypeID with the org prefix).

Match^org_[0-7][0-9a-hjkmnp-tv-z]{25}$
Example"org_01kjpsrza0etzb0a4vf72x8ang"
livemode*boolean

false for events in test mode.

schema_version?integer

The layout of data.object for this type. It changes only with a new major version; new fields can arrive at any time.

Range1 <= value
occurred_at?string

When it happened. Usually the same as created_at; earlier for something recorded after the fact.

Formatdate-time
recorded_at?string

When Agoo recorded it.

Formatdate-time
resource_version?integer

The object's version after this event. When events arrive out of order, keep the higher one.

Formatint64
legal_entity_id?string

The legal entity the object belongs to, for the books.

correlation_id?string

The request that caused it, to match your logs with Agoo support.

type*string
Value in"invoice.created""invoice.issued""invoice.updated""invoice.cancelled""invoice.payment_allocated"
data*

Response Body

Any 2xx acknowledges it.

Example Requests

POST/invoice.updated