Webhooks

The Smart Receipts API provides a number of events that you can subscribe to. These events are triggered by various actions that occur within the Smart Receipts system. When an event is triggered, Smart Receipts will send a POST request to the webhook URL that you have configured.

Configuration and security

You can setup a webhook by using API endpoint POST /webhooks.

You can verify the webhook signature by following the instructions here.

Event Types

The following events are available:

receipt

This event is triggered when a new receipt is submitted and ready to download. The event payload is as follows:

Copy
Copied
{
  "return_receipts": [],
  "voiding_receipt": {},
  "returned_receipt": {},
  "voided_receipt": {},
  "uuid": "string",
  "type": "sale",
  "status": "ready",
  "fiscal_id": "string",
  "created_at": "string",
  "gross_amount": 0,
  "transaction_id": "string",
  "document_number": "string",
  "document_date": "string"
}

receipt-error

This event is triggered when the Tax Authority portal reports an error.

The event payload is as follows:

Copy
Copied
{
  "uuid": "string",
  "event": "failed",
  "message": "string",
  "code": "string",
  "sent_at": "datetime"
}

Error codes you can receive are:

Code Message Notes
422 INVALID_CREDENTIALS Credentials of the BusinessRegistryConfiguration are not valid
400 BAD_REQUEST Provided data is not valid or a generic error happened
403 CANNOT_SEND_DATA_FOR_THIS_LEGAL_ENTITY The BusinessRegistryConfiguration VAT number is not valid

receipt-retry

This event is triggered when the communication with the Tax Authority portal failed, and we will retry to send the receipt again.

The event payload is as follows:

Copy
Copied
{
  "uuid": "string",
  "event": "retry",
  "message": "string",
  "code": "string",
  "sent_at": "datetime"
}

appointee

This event is triggered when the process of giving an appointing for smart receipts succeeded.

The event payload is as follows:

Copy
Copied
{
  "appointing_operation": "receipt",
  "appointee": "string",
  "appointing_person": "string",
  "business_registry": "string",
  "status": "completed"
}