TallyMarks
  • Overview
  • Getting Started
    • Points Economy
    • Creating Your First Rule
      • Assessment Criteria
      • Fulfilment Actions
      • Rule Status
    • Testing Rules
    • Sending Events
  • Key Concepts
    • Customer Profile
    • Events
      • Action
      • Anniversary
      • Basket
      • Errors
      • Orders
      • Points
      • Redemptions
      • Transactions
    • Segments
    • Points Expiry
    • Triggers
    • Web Hooks
  • API Documentation
    • Authentication
    • Error Handling
    • End Point Urls
    • Event API
    • Customer API
    • Admin API
  • Example Rules Sets
    • Bonus Points Earning for Specific Orders
Powered by GitBook
On this page
  • What is a webhook?
  • Protecting webhooks
  • Web Hook Body
  • Testing your webhook

Was this helpful?

  1. Key Concepts

Web Hooks

PreviousTriggersNextAuthentication

Last updated 4 years ago

Was this helpful?

What is a webhook?

A webhook is the TallyMarks platform making an HTTP/S request to your application’s API when an event occurs. This way TallyMarks is able to notify you when an event occurs and your application doesn’t have to poll the TallyMarks API to determine that something has taken place.

Protecting webhooks

For TallyMarks to access your application, you will need a publicly accessible URL. You will want to protect this URL so that malicious actors cannot manipulate your data.

Basic HTTP authentication

Another easy way to protect your API is through basic HTTP authentication. Almost all web servers can be configured to require a user name and password for access to a URL. You can configure your webhook URL with basic HTTP authentication by adding the user name and password to the URL https://yourapi.com/ webhook and setting the result as the webhook URL

Http Headers

The TallyMark's console supports the addition of Http Headers to its Web Hook calls, you may with to configure API keys or similar header elements to secure you API.

Web Hook Body

The web hook body can be populate with elements from the customer and event using handle bars syntax () of the event and associated customer and customer points balance triggering the web hook to be executed, for example:

{ 
 "firstName": {{customer.firstName}}
 "reference": {{event.reference}}
 "pointsBalance: {{customerPointsBalance.amount}}
}

Testing your webhook

Testing webhooks can be a difficult process.

The TallyMark's console includes the ability to execute a test web hook call against your web hooks with a sample payload.

https://handlebarsjs.com/guide/