Webhooks allow you to set up integrations which subscribe to certain events from your Payhip store.

Currently, the only event available is the successful transaction event. Whenever a successful transaction occurs we send you a HTTP POST payload to the webhook’s configured URL. Webhooks can be used to tweet a new sale, add a line to a Google spreadsheet or add a buyer to an email subscriber list.

Please make sure the webhook’s configured URL returns a 200 HTTP status code. If your endpoint does not return a 200 HTTP status code, the POST is retried once an hour for up to 3 hours.

This is an example of the JSON response you will find in the body of the HTTP POST payload:

         "product_name":"Book Title",

Key notes

1) Please note, all prices are in cents or pennies. For example, 10 dollars or euros will be represented as 1000.

2) The "date" property is a timestamp at which the transaction was completed. Measured in seconds since the Unix epoch.

3) To ensure that the webhook comes from us for security reasons you can use the "signature" property. The signature can be matched by comparing with

hash('sha256', $apiKey)

The above is a PHP snippet, you can sha256 hashing in any language. Your API key can be found from your Settings > Developer page.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.