Bento Spaces documentation
Paddle sandbox runbook
Production currently runs with Billing:Provider=none. This is the operator checklist to turn on Paddle in sandbox on api.bentospaces.com. Only ren exists and the apex is still the coming-soon page, so no customer can be charged. When the live account is approved, swap the credentials and ApiBase; no code change is needed.
The API is the only place that holds the key and the webhook secret. The browser receives a hosted checkout URL and a short-lived customer-portal link, never a credential.
What you need
- A Paddle sandbox account (separate from a live account).
- Two annual prices, one per paid plan.
- A sandbox API key with the permissions below.
- A webhook destination with its secret.
1. Create the sandbox account
- Open <https://sandbox-vendors.paddle.com/signup>.
- Enter your personal and business details. Sandbox does not require website approval.
- Verify the email and sign in at <https://sandbox-vendors.paddle.com>.
The sandbox dashboard has a Sandbox marker. Its data, keys and customers are separate from live Paddle.
2. Create the catalog
Use Catalog → Products → New product. Create two products, each with one annual price. The prices are the agreed launch prices in Commercial.
| Plan | Product name | Price | Billing cycle | Tax category |
|---|---|---|---|---|
| Plus | Bento Spaces Plus | 10.00 EUR | Year, every 1 | SaaS |
| Publisher | Bento Spaces Publisher | 50.00 EUR | Year, every 1 | SaaS |
- Set the price tax mode to Inclusive so
€10/€50is the final consumer price, as the - plan table promises. If the dashboard does not show a per-price tax mode, set the account
- default tax mode to inclusive under Settings → Tax.
- If SaaS is not offered, choose Standard (pre-written software); do not leave the category
- unset.
- If Paddle asks for a default payment link, use
https://bentospaces.com/preview. Sandbox does - not approve domains.
- Copy each price ID (
pri_…), not the product ID (pro_…). You will need one ID per paid plan.
3. Create the API key
Go to Developer Tools → Authentication → API keys → New API key.
- Name:
Bento Spaces sandbox. - Permissions, least privilege:
| Permission | Why |
|---|---|
price.read | Verify prices in Manage calls GET /prices/{id} |
transaction.write | Creates the hosted checkout transaction |
customer_portal_session.write | Manage billing portal link |
subscription.read | Portal and subscription context |
- Copy the key once. A sandbox key contains
_sdbx; a live key does not. Using the wrong one - against the other API returns
403.
4. Create the webhook destination
Go to Paddle → Events → Notifications → New destination.
- Notification type: Webhook
- URL:
https://api.bentospaces.com/api/billing/webhook - Description:
Bento Spaces API - API version:
1(latest) - Usage type: real platform events (sandbox)
- Events: select all
subscription.*events. At minimum:subscription.created, subscription.updated,subscription.canceled,subscription.past_due.
The API ignores non-subscription events, so selecting the whole subscription group is safe. Save the destination, then copy its secret key. That is Billing__Paddle__WebhookSecret.
5. Configure the API
Add the Billing block to the server's appsettings.Production.json, next to Bento.Api.dll. Merge it with the existing keys; do not replace Hosts, Auth, Marketplace, Push or Manage.
{
"Billing": {
"Provider": "paddle",
"Paddle": {
"ApiKey": "<sandbox key, contains _sdbx>",
"WebhookSecret": "<destination secret>",
"PriceIdPlus": "pri_...",
"PriceIdPublisher": "pri_...",
"ApiBase": "https://sandbox-api.paddle.com"
}
}
}
Environment-variable equivalent, for an IIS app pool or a service unit:
Billing__Provider=paddle
Billing__Paddle__ApiKey=<sandbox key>
Billing__Paddle__WebhookSecret=<destination secret>
Billing__Paddle__PriceIdPlus=pri_...
Billing__Paddle__PriceIdPublisher=pri_...
Billing__Paddle__ApiBase=https://sandbox-api.paddle.com
Notes:
ApiBasemust be the sandbox API while the key is a sandbox key. The default is live- Paddle, and a sandbox key there returns
403. - Do not set
Billing__Provider=fakeon a real host.fakeis refused outside disposable - storage.
release/api/appsettings.Production.jsonis regenerated byscripts/publish-split.sh. If you- upload a new release, merge the
Billingblock into the new file before uploading, or keep the - configured server copy and upload only the changed DLL. Do not upload a blank release copy over
- the configured one.
- Recycle the API app pool, or restart the service, after the change.
- Keep the key and secret out of the repo,
config.js, screenshots and chat.
6. Verify before checkout
- Sign in at <https://manage.bentospaces.com> as
ren. - Open the Billing tab.
- Expected: provider
paddle, sandbox yes, API key set, webhook secret set, both price IDs - present.
- Click Verify prices. Every check must report
ok: true.
| Result | Cause |
|---|---|
403 forbidden from verify | the key lacks price.read |
price_not_configured | a price ID is missing or empty |
501 billing_not_configured | Billing:Provider is not paddle |
503 paddle_api_key_missing | the key is empty or the app was not recycled |
7. Test a checkout
- Sign in at <https://bentospaces.com/preview> (the apex root is the coming-soon page).
- Open Account → Upgrade to Plus.
- The Paddle sandbox checkout opens. Use a Paddle test card:
| Card | Number |
|---|---|
| Valid, no 3DS | 4242 4242 4242 4242 |
| Valid, 3DS | 4000 0038 0000 0446 |
| Declined | 4000 0000 0000 0002 |
| First success, later decline | 4000 0027 6000 3184 |
Use any cardholder name and a future expiry.
After payment, the webhook should move the account to Plus. Check:
- Account shows Plus.
GET https://api.bentospaces.com/api/mereturns"plan":"plus"and the Plus entitlements.- Manage → Billing shows one subscription and at least one event.
If the plan does not change, open Paddle → Events → Notifications and inspect the delivery log for /api/billing/webhook. A 401 there means the webhook secret is wrong; a 404 means the path is wrong.
8. Renewal, failed payment, cancellation
Annual prices do not renew during a sandbox test. Two ways to exercise the rest:
- Fast renewal: create a temporary sandbox price with a daily billing cycle, point
PriceIdPlusat it, run a checkout, and wait for the next day. Restore the annual price- afterwards. This tests the real Paddle renewal and
subscription.updatedpath. - Webhook-level test: send a signed
subscription.updatedwith a future current_billing_period.ends_atand the samecustom_data.user_id. This tests the API contract- but not Paddle's scheduler.
For past_due, use the 4000 0027 6000 3184 card on the short-cycle price and let Paddle's retries exhaust, or send a signed subscription.past_due event. The plan keeps its data and becomes read-only until a successful payment.
For cancellation, open Manage billing in the account dialog, cancel in the Paddle portal, and confirm the plan stays active until current_billing_period.ends_at. After that date the account falls back to Free and content writes return 403 subscription_read_only.
9. Go live later
- Create the live account at <https://vendors.paddle.com> and complete Paddle's website approval.
- Recreate the two products/prices in live, or use the live catalog IDs.
- Create a live API key with the same permissions and a live webhook destination with the same
- URL and subscription events.
- Replace the key, secret, price IDs and set
Billing__Paddle__ApiBase=https://api.paddle.com.- Recycle the API and repeat Verify prices and one live checkout.
No code or release change is needed for the switch.
What to send
- Price IDs (
pri_…) are not secret. Send them if you want a second pair of eyes. - Do not send the API key or the webhook secret in chat. Set them on the server yourself.
- When Manage shows both prices verified, tell me and we will run the checkout, portal,
- cancellation and past-due checks together.