Webhooks


Attributes

Attribute Type Description
Read-only attribute
id Integer Unique identifier in Fakturoid
webhook_url String URL of webhook endpoint
auth_header String Value send in Authorization header
active Boolean Send webhook?
events Array[String] List of events when webhook is fired
Read-only attribute
url String Webhook API address
Read-only attribute
created_at DateTime Date and time of webhook creation
Read-only attribute
updated_at DateTime Date and time of last webhook update
  • Required attribute
    Required attribute (must always be present).
  • Read-only attribute
    Read-only attribute (cannot be changed).
  • Write-only attribute
    Write-only attribute (will not be returned).
  • Unmarked attributes are optional and can be omitted during request.

Restrictions

  • Webhooks are only available in paid plans.
  • Every account can create webhooks in their account in Fakturoid UI. How to create webhooks in your account see the support page (cz).
  • In addition to the UI, new webhooks can also be created and managed via API using both the authorization code flow and the client credentials flow:
  • Authorization code flow
    • To manage webhooks via API, please contact our support team first. Without prior authorization, a Status 403 response will be returned
  • Client credentials flow
    • Webhook management must be enabled in the UI in your user screen Settings → User account.
  • Both OAuth integrations and client credentails can manage only their own webhooks; access to other webhooks within the account is restricted.
  • When an OAuth integration or client credentials are revoked, all associated webhooks are automatically deleted.

Events

Webhooks are triggered when one of resources listed below is modified. Action may be triggered by user interaction, API call, or automatically (e.g. invoice is marked as overdue). Some events may include additional payload, which contains related resources to the event. For more information about the payload, please refer to the section on Payload Content.

Webhook index

Webhook Detail

Create Webhook

  • After successful template creation, you will receive a 201 Created response from the server, the location header will be set to the address of the newly created template.
  • If non-valid data is sent, you will receive a 422 Unprocessable Content response from the server and a JSON with a list of errors in the sent data.

Update Webhook

  • If webhook is successfuly updated the server will respond with 200 OK and a JSON body with its data.
  • Request with invalid data will result in response 422 Unprocessable Content with a JSON body describing errors found in the request.

Delete Webhook

After deleting the webhook the server will respond with 204 No Content.

Webhook delivery

Webhooks are delivered as HTTP POST requests containing JSON payload to the URL specified in the webhook configuration. Optionally, Authorization header is set to the value specified in the auth_header attribute of the webhook.

Receiver must acknowledge the delivery by responding with a status code 2xx within 30 seconds. Otherwise the webhook delivery will be retried up to 5 times with an exponential backoff.

Payload Content

Attribute Type Description
webhook_id Integer Unique identifier of the webhook
event_name String Name of the event
created_at DateTime Date and time of the event
body Object Event payload

The body contains a resources related to event. For instance, when an invoice is created, the body contains an invoice key with the serialized Invoice object. When additional attributes are listed in the table, they are also included in the body object. More information may be found in the attributes section of API documentation related to the resource.

For example, when an invoice is paid, a payment object is included in the body object. Thus JSON contains an invoice object and a payment object under the body key.

When payload relates to bulk action, additional attributes are included under pluralized resource name. For example, when all inbox files are removed, the payload contains an inbox_files key with number of removed records.

You can use one of the following services to test webhooks: