API Access
Beta
API Monetization is in beta and free to try. The APIs are stable but should be evaluated in non-production environments first. To go to production, contact sales@zuplo.com. Production pricing has not yet been announced.
Buckets
Each Zuplo project includes three isolated buckets that mirror your environment structure:
| Bucket | Purpose |
|---|---|
| Working Copy | Your development sandbox for building and testing |
| Preview | Staging environments for validating changes before production |
| Production | Your live environment serving real customers |
Meters, features, plans, and subscriptions are all scoped to a specific bucket. This isolation enables independent development workflows where you can:
- Experiment freely - Test new pricing models or usage tracking in development without affecting production data
- Validate changes - Promote your product catalog configuration through preview environments before going live
- Maintain separation - Keep development test data completely isolated from production customer usage
When you're satisfied with your configuration in one bucket, you can recreate that same configuration in another bucket to promote changes through your deployment pipeline.
Authentication
All Monetization API requests require authentication using a Zuplo API key.
All examples in this documentation assume the following environment variables are set in your terminal:
Code
Include your API key in the Authorization header:
Code
Bucket monetization configuration
Each bucket has an optional MonetizationConfiguration that holds bucket-wide
behavior — multi-subscription support, plan display order, plan-level overrides,
and the default payment grace period.
Read
Code
When no configuration row exists for the bucket, the endpoint returns a default
body with multipleSubscriptionsEnabled: false, an empty planOrder, empty
planSettings, and maxPaymentOverdueDays: 3.
Upsert
Code
| Field | Type | Description |
|---|---|---|
multipleSubscriptionsEnabled | boolean | When true, a customer may hold more than one active subscription at once |
planOrder | string[] | Ordered list of plan keys; controls upgrade/downgrade direction during plan changes |
planSettings | object | Per-plan or bucket-wide settings (free-form JSON) |
maxPaymentOverdueDays | integer | Bucket-default payment grace period. Must be ≥ 0. Defaults to 3 when not set |
The request body must include at least one of these fields. All four fields are optional in the request — the upsert preserves any field you don't send.
planOrder is consumed when a customer changes plans through the Developer
Portal: a target plan whose index is greater than or equal to the current plan's
index is treated as an upgrade (immediate timing); a lower index is treated as a
downgrade (next-billing-cycle timing). Plans not listed in planOrder default
to upgrade timing.
maxPaymentOverdueDays is the lowest-precedence default for the payment grace
period. See
Subscription and payment validation
for the full precedence chain (customer metadata → plan metadata → bucket
configuration → built-in default).
Delete
Code
After deletion, GET returns the default body again.
Stripe setup and billing readiness
Most users connect Stripe through the Zuplo Portal. For automated provisioning — CI scripts, infrastructure-as-code, or self-hosted control planes — the same flow is available via these API endpoints.
Install the Stripe app
Connect a Stripe account to a bucket and create the default billing profile in one call:
Code
The endpoint validates the Stripe key prefix against the bucket's environment:
- Working-copy and preview buckets accept
sk_test_*orrk_test_* - Production buckets accept
sk_live_*orrk_live_*
The response returns the installed appId. The endpoint fails with a
409 Conflict if a Stripe app is already installed for the bucket.
Read the current Stripe setup
Code
Returns the connected Stripe app summary and the billing profiles linked to it.
Create an additional billing profile
To attach more billing profiles to the same Stripe app:
Code
Check billing readiness
A lightweight check for tooling that gates deploys on Stripe being connected:
Code
Response:
Code
Update a connected app
Rotate the Stripe key on an existing app, or update its name and metadata:
Code
The same key-prefix validation applies — a live key is rejected on a non-production bucket and vice versa.
API Reference
For complete API operations, see the API Reference documentation: