Bento Spaces docs

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

1. Create the sandbox account

  1. Open <https://sandbox-vendors.paddle.com/signup>.
  2. Enter your personal and business details. Sandbox does not require website approval.
  3. 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.

PlanProduct namePriceBilling cycleTax category
PlusBento Spaces Plus10.00 EURYear, every 1SaaS
PublisherBento Spaces Publisher50.00 EURYear, every 1SaaS

3. Create the API key

Go to Developer Tools → Authentication → API keys → New API key.

PermissionWhy
price.readVerify prices in Manage calls GET /prices/{id}
transaction.writeCreates the hosted checkout transaction
customer_portal_session.writeManage billing portal link
subscription.readPortal and subscription context

4. Create the webhook destination

Go to Paddle → Events → Notifications → New destination.

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:

6. Verify before checkout

  1. Sign in at <https://manage.bentospaces.com> as ren.
  2. Open the Billing tab.
  3. Expected: provider paddle, sandbox yes, API key set, webhook secret set, both price IDs
  4. present.
  5. Click Verify prices. Every check must report ok: true.
ResultCause
403 forbidden from verifythe key lacks price.read
price_not_configureda price ID is missing or empty
501 billing_not_configuredBilling:Provider is not paddle
503 paddle_api_key_missingthe key is empty or the app was not recycled

7. Test a checkout

  1. Sign in at <https://bentospaces.com/preview> (the apex root is the coming-soon page).
  2. Open Account → Upgrade to Plus.
  3. The Paddle sandbox checkout opens. Use a Paddle test card:
CardNumber
Valid, no 3DS4242 4242 4242 4242
Valid, 3DS4000 0038 0000 0446
Declined4000 0000 0000 0002
First success, later decline4000 0027 6000 3184

Use any cardholder name and a future expiry.

After payment, the webhook should move the account to Plus. Check:

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:

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

  1. Create the live account at <https://vendors.paddle.com> and complete Paddle's website approval.
  2. Recreate the two products/prices in live, or use the live catalog IDs.
  3. Create a live API key with the same permissions and a live webhook destination with the same
  4. URL and subscription events.
  5. Replace the key, secret, price IDs and set
  6. Billing__Paddle__ApiBase=https://api.paddle.com.
  7. Recycle the API and repeat Verify prices and one live checkout.

No code or release change is needed for the switch.

What to send