Skip to main content
Ad-hoc pricing lets you override a product’s price for one checkout. You keep selling an existing catalog product, but the price for that session is whatever you set on the cart item. Bachs never creates a new product, and your catalog price is untouched. Reach for it when the price is decided at order time rather than in your catalog: a negotiated deal, a customer-specific rate, a computed or usage-derived amount, or a one-off discount. The catalog stays clean; the override lives on the checkout. This lets you price in real time and still keep a clean catalog.

Before you start

Everything below uses the sandbox base URL, so you can run the whole flow without moving real money.

How it works

Add a pricing object to a product_cart item. Bachs charges the override instead of the product’s catalog price for that checkout only.
The override is in the product’s primary currency and applies to that checkout only. From here the flow is the ordinary checkout: redirect the customer to checkout_url and confirm with the collection.succeeded webhook. See Accept a payment with Checkout.

Price types

Ad-hoc pricing supports the same price types as catalog prices, with one exception. A custom override lets the buyer choose the amount on the hosted checkout page, within your bounds:
The response shows the line as price_type: "custom" with the bounds, priced at the preset until the buyer changes it.
On a custom ui_mode checkout (server-to-server, your own UI) there is no hosted page to collect the amount. Send the buyer’s chosen amount as the cart item’s amount when you create the checkout.

One-time vs recurring

The override behaves differently depending on whether the product is one-time or recurring, but in both cases it stays out of your catalog price list.
  • One-time product. The override is snapshotted on the checkout. No price row is created; nothing changes in your catalog.
  • Recurring product. The override becomes the subscription’s price for its whole life. When the subscription activates, Bachs stores the settled amount as an archived, one-off price the subscription ties to.
An ad-hoc price is a one-off. It is never returned by the product price list and cannot be reused across checkouts. To sell at a price repeatedly, add it to the catalog instead.

Testing

Use a sandbox key (sk_sandbox_...) to run the whole flow against test-mode products without moving real funds. See Sandbox.

Next steps