less than a minute read • Updated an hour ago
What is the pre-payment webhook?
How the pre-cart webhook lets you intercept, modify, or replace add-to-cart requests before items are added.
This is advanced functionality currently available only on the Advanced and Enterprise plans. Contact us for details.
The pre-cart webhook is an advanced feature that lets you intercept “add to cart” requests to /cart. You can completely intercept, modify, ignore, or pass through the request back to your store.
Examples and use cases
Custom discounting or promotions, with complex logic that coupons or gift cards can’t support.
Using an external system to control the cart itself, and/or check licensing or availability before allowing a customer to add a product to the cart.
Using an external system to create cart details on cart-add. Instead of defining the product normally in the GET or POST data, you’d pass something like
/cart?isbn=9780809590469, and the response from this webhook would define the product as desired.
Known limitations
Externally-controlled coupons: there’s currently a limit of one externally-controlled coupon per store (not usually an issue), and one externally-controlled code per transaction (which may be an issue).
Common errors
Errors about “cart id is 0”: if you PATCH to a cart ID of 0, you’ll get this error.