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:
{ "id":"2GZqVkJkBp", "email":"abs@payhip.com", "currency":"USD", "price":923, "vat_applied":true, "vat_amount":173, "vat_country":"Ireland", "ip_address":"62.40.63.255", "items":[ { "product_id":"29129", "product_name":"Book Title", "product_key":"k9Ew", "product_permalink":"https:\/\/payhip.com\/b\/k9Ew", "license_key":"WTKP4-66NL5-HMKQW-GFSCZ" } ], "coupons":[ { "code":"26FDEC7CDV", "percentage":25, "amount":250 } ] }
Key note
Please note, all prices are in cents or pennies. For example, 10 dollars or euros will be represented as 1000.