less than a minute read • Updated 9 minutes ago
What is the pre-payment webhook?
How the pre-payment webhook lets you validate transactions before payment — for inventory checks, custom rules, and fraud prevention — approving or rejecting at checkout.
The pre-payment hook functionality sends a request to an endpoint of your choosing right before Foxy would otherwise submit the payment to the payment gateway, and allows for stores to apply custom validations for transactions prior to the request being set to the chosen payment method.
A payload containing information about the current transaction is sent to the endpoint configured for this functionality, allowing the endpoint to respond to either approve or reject the transaction. If approved, the transaction will be sent on to the gateway to process, or if rejected the customer will be sent back to the checkout with a custom error message.
Common use cases for the pre-payment hook include:
Final inventory checks for low-stock or one-of-a-kind products.
Custom validations to ensure that certain product configurations are present.
Integrations with custom validation or fraud-check services (such as FraudLabsPro).
Notes
Currently, the pre-payment webhook is not triggered for subscription renewals. If you have a use case where this is needed, please contact us.