Settings

Connect payments before you sell.

AdsRoster creates Bachs hosted checkouts for each booking. Without keys in the matching environment, reserve and custom checkout both fail.

Sandbox vs live

The workspace environment switch picks which inventory and payment credentials you use. Sandbox keys only work with sandbox spots and public keys (aidx_test_…). Live keys only work with live (aidx_live_…).

Connect and verify sandbox first. Switch to live only after a paid sandbox booking settles correctly.

1. Create a Bachs API key

In the Bachs dashboard, create a secret key for the environment you are connecting. Grant:

  • Payments: Write
  • Products: Read
  • Refunds: Write
  • Customers: Write (preferred, optional)

There is no separate Checkout permission. Checkout sessions use Payments Write.

2. Register the webhook

In Bachs, add a webhook endpoint that points at your AdsRoster origin:

Webhook URL
https://YOUR_ADSROSTER_HOST/api/webhooks/bachs?environment=sandbox
# Live:
https://YOUR_ADSROSTER_HOST/api/webhooks/bachs?environment=live

Subscribe to:

  • collection.succeeded
  • refund.paid
  • refund.failed

Copy the endpoint signing secret. Local development cannot receive Bachs callbacks on localhost. Run pnpm tunnel and keep APP_URL on localhost. Webhooks and checkout returns use the OutRay origin automatically.

3. Save credentials in AdsRoster

Open Settings → Payouts in the workspace, paste the API key and webhook signing secret, and save. Both are encrypted at rest. Then run a booking in that environment and confirm payment settles (redirect alone is not proof; the webhook is).

Go-live checklist

  1. Sandbox Bachs connected and webhook verified.
  2. One paid sandbox booking end-to-end.
  3. Live Bachs keys and live webhook registered.
  4. Production embed uses your live public key via env (NEXT_PUBLIC_ADSROSTER_PUBLIC_KEY). Omit baseUrl — the SDK defaults to production.
NextCustom checkoutCollect ad details on your site, then redirect to Bachs payment.