What Is a Webhook?
A webhook is an automatic message sent from our system to another application whenever something important happens, like when an invoice is created or reverted. You receive these notifications instantly, allowing you to react in real time.
This allows you to:
Synchronise invoices with accounting tools
Trigger automations
Keep external systems updated in real time
Note: Webhooks require technical setup and are not plug-and-play features. Please make sure you have Software development knowledge before running through the end of this guide.
Before You Start
To use invoice webhooks, you must have a secure HTTPS endpoint (URL) capable of receiving POST requests with JSON data.
Step-by-Step Guide
Once you have your endpoint ready, visit https://backoffice.bsport.io/settings/webhook.
Click on the "Add a webhook" button
Select the event you would like to subscribe (types of event listed here).
Enter the URL you would like the webhook to send the message to.
Click on confirm.
You can now see your new webhook being created 🎉.
(Optional) By clicking on the "Test" button, you can simulate an event to ensure your webhook is working.
Types of events
You can subscribe to different events related to the lifecycle of an invoice:
invoice-finalize– Triggered when an invoice is created and opened (finalized).invoice-revert– Triggered when an invoice is reverted (cancelled or refunded)invoice-pay– Triggered when an invoice is fully paid.invoice-dispute– Triggered when an invoice is disputed.
The following invoice events are deprecated and should therefore not being used.
invoice-createinvoice-update
Event payload
Each of theses events send the same shape of payload defined as follow.
You can also find here the JSON Schema description of the payload.
Fields description
Field | Type | Description | Example |
| string |
| |
| number (timestamp) | Timestamp of when the event was triggered |
|
| Object | Details about the event and invoice (see below). | - |
|
|
| "2025-11-04T09:03:11.653072Z" |
| string (uuid) | Unique identifier of the invoice | "923e2c97-8228-4d42-8a44-1783c70c50a1" |
| string | Object type (always |
|
| string | Invoice status ( |
|
| string (date-time) | When the invoice was created (UTC). |
|
| string (date-time) | When the invoice was created (UTC). |
|
| string (date-time) | When the invoice was issued (UTC). |
|
| string (date-time) | Payment due date (UTC). |
|
| string (date-time) | null | When the invoice was cancelled (if applicable). |
|
| string | Invoice currency (ISO 4217 code). |
|
| number (cents) | Total invoice amount in smallest unit (e.g., cents). |
|
| number (cents) | Amount due in smallest unit (e.g., cents). |
|
| number (cents) | Amount already paid in smallest unit (e.g., cents). |
|
| object | Company issuing the invoice. |
|
| number | Unique company ID. To know your company ID, please go this backoffice page. |
|
| string | Company name. |
|
| string | Country code. |
|
| string | City. |
|
| string | Address. |
|
| string | Postal/ZIP code. |
|
| object | null | Customer being invoiced (can be |
|
| number | Unique customer/member ID. |
|
| string | Customer type (always |
|
| string | Full name. |
|
| string | First name. |
|
| string | Last name. |
|
| string | Contact email. |
|
| string | Phone number. |
|
| string | Official/National ID (can be tax ID/NIF). |
|
| object | Customer address. |
|
| string | Street address. |
|
| string (optional) | Additional address info. |
|
| string | City. |
|
| string | Postal code. |
|
| string | State/region. |
|
| string | Country code. |
|
| object | Line items container. |
|
| number | Number of line items. |
|
| array<object> | Array of invoice line items. |
|
| number | Unique identifier for the line item. |
|
| string | Name/label of the product or service. |
|
| number | Number of units purchased. |
|
| number (cents) | Unit price incl. tax, in cents. |
|
| number (cents) | Total price incl. tax before discount ( |
|
| number (cents) | Discount/voucher applied to this line, in cents. |
|
| number (cents) | Final line amount after discount, in cents. |
|
| object | Tax calculation details. |
|
| number (%) | Tax rate percentage (e.g., 20 = 20%). |
|
| number (cents) | Total tax included in this line, in cents. |
|
| number (cents) | Tax included per unit, in cents. |
|
| string | Type of bsport item ( |
|
| string (url) | Link to the invoice PDF. |
|
| string (url) | null | Link to the payment receipt PDF (if applicable). |
|
| number | Invoice type: 0=normal, 1=reverse, 2=credit note, 3=migration. |
|
| string (uuid) | null | UUID of original invoice cancelled through this one (if applicable). |
|
Example
{
"event_type": "invoice-finalize",
"date": 1762246989,
"data": {
"date": "2025-11-04T09:03:11.653072Z",
"object": {
"id": "923e2c97-8228-4d42-8a44-1783c70c50a1",
"object": "invoice",
"status": "open",
"date_created": "2025-11-04T09:03:06.515219Z",
"date_issued": "2025-11-04T09:03:08.225042Z",
"date_due": "2025-11-04T09:03:07.292000Z",
"date_cancelled": null,
"currency": "eur",
"total": 36665,
"amount_due": 36665,
"amount_paid": 0,
"company": {
"id": 85329,
"name": "SaudeViva Portugal",
"country": "PT",
"city": "Lisbon",
"address": "Rua do Ouro 115",
"postal_code": "1100-062"
},
"customer": {
"id": 7644312,
"type": "individual",
"name": "Maria Oliveira",
"first_name": "Maria",
"last_name": "Oliveira",
"email": "maria.oliveira77@example.com",
"phone": "+351 912 345 678",
"official_document_id": "PT-19847765",
"address": {
"line1": "Avenida da Liberdade 202",
"line2": "4º Esq.",
"city": "Lisbon",
"postal_code": "1250-147",
"state": "Lisboa",
"country": "PT"
}
},
"line_items": {
"line_count": 6,
"data": [
{
"id": 2153,
"description": "£100 General Gift Voucher",
"quantity": 1,
"tax_included_unit_amount": 10000,
"tax_included_amount": 10000,
"voucher_applied": 0,
"line_total": 10000,
"tax_breakdown": {
"rate": 0,
"total_tax": 0,
"unit_tax": 0
},
"item_type": "consumer_giftcard"
},
{
"id": 249955,
"description": "Classic Jumper - Peacoat Navy",
"quantity": 2,
"tax_included_unit_amount": 4500,
"tax_included_amount": 9000,
"voucher_applied": 964,
"line_total": 8036,
"tax_breakdown": {
"rate": 20,
"total_tax": 1339,
"unit_tax": 670
},
"item_type": "shop-product"
},
{
"id": 15305,
"description": "Single 60 Minute Reiki Treatment",
"quantity": 1,
"tax_included_unit_amount": 7500,
"tax_included_amount": 7500,
"voucher_applied": 1384,
"line_total": 6116,
"tax_breakdown": {
"rate": 20,
"total_tax": 1019,
"unit_tax": 1019
},
"item_type": "private_pass"
},
{
"id": 15301,
"description": "Single 60 Minute Session",
"quantity": 1,
"tax_included_unit_amount": 7500,
"tax_included_amount": 7500,
"voucher_applied": 1383,
"line_total": 6117,
"tax_breakdown": {
"rate": 20,
"total_tax": 1019,
"unit_tax": 1019
},
"item_type": "private_pass"
},
{
"id": 427448,
"description": "Newbies",
"quantity": 1,
"tax_included_unit_amount": 4900,
"tax_included_amount": 4900,
"voucher_applied": 904,
"line_total": 3996,
"tax_breakdown": {
"rate": 20,
"total_tax": 666,
"unit_tax": 666
},
"item_type": "pass"
},
{
"id": 427451,
"description": "1 Session",
"quantity": 1,
"tax_included_unit_amount": 2500,
"tax_included_amount": 2500,
"voucher_applied": 100,
"line_total": 2400,
"tax_breakdown": {
"rate": 20,
"total_tax": 400,
"unit_tax": 400
},
"item_type": "pass"
}
]
},
"invoice_pdf": "https://assets.staging.bsport.io/invoices/2025-11-04/5cab7c93-cd01-4d15-9362-46b0a89919b5/invoice-24092226.pdf",
"receipt_pdf": null,
"invoice_type": 0,
"source_invoice_id": null
}
}
}





