Using webhooks

Utilize webhooks to be notified when something happens in Billsby

Updated over a week ago

Webhooks can be used to notify your own systems that something has happened in Billsby or for integrating with third party services.

The Webhooks configuration page allows you to specify the endpoint that you would like to receive webhooks to, by adding it in the URL field provided.

You also have the option to include an additional security measure by protecting your webhook URL using basic authentication. To do this, input a secret key in the box provided and this key will be attached to every webhook we send to you. You can then check whether the webhook contains the correct secret key which is passed over in the header, and you'll know it was sent from your Billsby account.

Testing webhooks

In the Billsby control panel you can easily test webhooks, all you need to do is set up your webhook URL and click on the Test button. Then, we will send the webhook to your specified endpoint with the secret key passed over in the header.

Customer created

Triggers every time a new customer is created in your account and provides the following array of customer details.

{ 
"CustomerUniqueId": "5VL9JC0NE0",
"Email": "[email protected]",
"LastName": "lastName",
"FirstName": "firstName",
"SubscriptionIds": [
"6WJYRQ9V3G"
],
"Type": "CustomerCreated",
"Id": "2fe9cc12-3bb1-4e93-ae64-5034ad32cc4f"
}

Customer updated

Triggers every time any of the customers details have changed and provides the following array of customer details.

{ 
"Email": "[email protected]",
"LastName": "lastName",
"FirstName": "firstName",
"SubscriptionIds": [
"6WJYRQ9V3G"
],
"CustomerUniqueId": "5VL9JC0NE0",
"Type": "CustomerUpdated",
"Id": "a6353f59-1b15-423a-9e22-fe39d0def366"
}

Customer deleted

Triggers every time a customer is deleted from your account.

{ 
"CustomerUniqueId": "5VL9JC0NE0",
"Email": "[email protected]",
"LastName": "lastName",
"FirstName": "firstName",
"SubscriptionIds": [
"6WJYRQ9V3G"
],
"Type": "CustomerDeleted",
"Id": "f7586f7c-2b99-41d1-8965-df1b3ec3cc69"
}

Subscription created

Triggers every time a subscription is created and provides the following array of subscription details.

{ 
"SubscriptionUniqueId": "6WJYRQ9V3G",
"CustomerUniqueId": "5VL9JC0NE0",
"SubscriptionStatus": "Active",
"BillsbyProductId": 17,
"BillsbyPlanId": 24,
"BillsbyCycleId": 35,
"Units": 1,
"Type": "SubscriptionCreated",
"Id": "aa4f7167-d4a6-408e-9988-334c43cf8942"
}

Subscription updated

Triggers when a subscription has a plan or cycle change, or the status of a subscription changes, and provides the following array of subscription details.

{ 
"SubscriptionUniqueId": "6WJYRQ9V3G",
"CustomerUniqueId": "5VL9JC0NE0",
"SubscriptionStatus": "Active",
"BillsbyProductId": 50,
"BillsbyPlanId": 155,
"BillsbyCycleId": 217,
"Units": 1,
"NextBillingDate": "2022-04-28T15:43:31.5654354Z",
"Type": "SubscriptionUpdated",
"Id": "9f471af6-a942-4cbf-9628-9e51685b9995"
}

Invoice created

Triggers every time an invoice is created and provides the following array of invoice details and a link to the invoice.

{ 
"InvoiceNumber": "5VL9JC0NE0-3",
"InvoiceAmount": 100,
"CurrencyCode": "USD",
"InvoiceStatus": "Pending",
"Url": "billsby.com/invoice/5VL9JC0NE0-3",
"Type": "InvoiceCreated",
"Id": "94238261-ac12-4a8c-91ce-79eb427d0e39"
}

Invoice updated

Triggers when the payment status of an invoice is updated and provides the following array of invoice details and a link to the invoice .

{ 
"InvoiceNumber": "5VL9JC0NE0-3",
"InvoiceAmount": 100,
"CurrencyCode": "USD",
"InvoiceStatus": "Paid",
"Url": "billsby.com/invoice/5VL9JC0NE0-3",
"Type": "InvoiceUpdated",
"Id": "cc2d3ee5-62a8-4281-a5db-d7d6a2e59869"
}

Credit note created

Triggers every time a credit note is created and provides the following array of credit note details and a link to the credit note.

{ 
"InvoiceNumber": "5VL9JC0NE0-2",
"CustomerId": "5VL9JC0NE0",
"CurrencyCode": "USD",
"Amount": 100,
"Status": "Pending",
"Url": "billsby.com/invoice/5VL9JC0NE0-2",
"CustomerUniqueId": "ZYX",
"Type": "CreditNoteCreated",
"Id": "4870625e-d5c0-429e-ad70-65b38790eb16"
}

Credit note updated

Triggers when the payment status of a credit note is updated and provides the following array of credit note details and a link to the credit note.

{ 
"InvoiceNumber": "5VL9JC0NE0-2",
"CustomerId": "5VL9JC0NE0",
"CurrencyCode": "USD",
"Amount": 100,
"Status": "Paid",
"Url": "billsby.com/invoice/5VL9JC0NE0-2",
"Type": "CreditNoteUpdated",
"Id": "bc3db864-aba7-4485-b63f-77239cf8f00e"
}

If you need a webhook we’ve not built yet, let our service team know so we can consider it for a future release.

Billsby expects a 2XX reply from the configured URL to confirm the notification we sent has been successfully delivered. If a webhook times out or we receive an error, we’ll cancel and retry sending the webhook seven times - first two minutes after the failure, then six minutes after the previous retry, then an hour after the previous retry, then 5 hours after the previous retry, then 1 day after the previous retry and finally 2 days after the previous retry.

Each webhook has a unique ID, so if you receive the same webhook more than once due to retries, you’ll know to ignore it.

Did this answer your question?