API reference

Why Use webhooks

When developing integrations with Glider, you may require your applications to receive real-time event notifications from your Glider account to trigger corresponding actions in your back-end systems.

To facilitate this, you must register webhook endpoints. Once registered, Glider will push event data to your application's webhook endpoint in real-time as events occur in your Glider account. These webhook events are transmitted over HTTPS and delivered as a JSON payload containing an Event object.

Webhooks are particularly advantageous for handling asynchronous events such as when a customer's bank confirms a PayTo payment, a customer enrolls in a payment plan, or a customer completes a payment transaction.

Event Overview

Glider generates event data to notify you of activities within your account.

Upon the occurrence of an event, Glider creates a new Event object. A single API request may trigger the creation of multiple events. For example, sending an invoice to a customer could result in events for a new visit, a declined transaction, and a payment received.

By registering webhook endpoints in your Glider account, you enable Glider to automatically send Event objects via POST requests to the specified webhook endpoint hosted by your application. Once your webhook endpoint receives an Event object, your application can execute back-end actions, such as updating your billing system after a payment is made or a payment plan is registered.

Event Object

The Event object sent to your webhook endpoint provides a snapshot of the object that has changed.
A webhook will be triggered on these X events

EventDescription
declineda user attempts to pay an invoice but the transaction fails
paida user successfully pays an invoice
partially_paida user successfully partially pays an invoice
openeda user clicked on the invoice link and visited the payment portal
registereda user successfully registers a new payment plan
saveda user successfully saves a new payment method
under_investigationa user successfully pays an invoice using PayTo method, however the user's bank hold the transaction for further investigation. This will normally be solved automatically into a piad or declined transaction within few hours

Example event Payload

The following example shows an opened event of a paid invoice

{
   "event": "opened",
   "ts": "2020-10-10 03:00:00",
   "invoice_id": 321,
   "status": "paid",
   "account_number": "3243242",
   "amount": 400,
   "contact": "[email protected]",
   "custom1_label": "Creditor",
   "custom1_value": "BankOne",
   "custom2_label": "SKU",
   "custom2_value": "HK0004578",
   "custom3_label": "Due Date",
   "custom3_value": "10/10/2020",
   "created": "2020-10-10 00:00:00",
   "transactions": [
        {
            "created": "2020-10-10 01:00:00"
            "status": "declined",
            "error": "Something went wrong during the payment processing: [152] Account not set up to accept credit card transactions for the supplied credit card type",
            "amount": 200,
            "receipt": "pKRLbdkvZ1"
        },
        {
            "created": "2020-10-10 02:00:00"
            "status": "succeed",
            "error": null,
            "amount": 300,
            "receipt": "3XKDAV0La4"
        },
   ]
}

Webhook Configuration

Glider supports both Basic and Bearer Token authentication methods. By specifying your preference during the signup process, all API calls will include the appropriate authentication header. Additional headers can be added upon request.

The webhook delivery system will attempt to deliver messages multiple times over a 24-hour period, employing an exponential back-off strategy if it fails to receive a 2xx response code. If the webhook exceeds the maximum number of allowed attempts as defined in its configuration, it will enter an errored state and will not automatically retry delivery.

Example of a webhook configuration

{
  "Headers": {
    "Authorization": "Bearer xxx...",
    "Content-Type": "application/json"
  },
  "failureThreshold": 10,
  "batchingIntervalInMinutes": 2
  "callbackUrl": "https://backend.ourpower.com/webhook",
  "events": [
    "opened",
	  "declined",
	  "paid",
	  "partially_paid",
	  "registered",
	  "saved",
	  "under_investigation"
  ]
}