Billing
Initialize org-level BaaS plan payment (Starter, Growth, Scale)
**Org plan payment flow — Step 2.** Creates a payment link for the authenticated org to subscribe to a BaaS plan (starter, growth, scale). Enterprise has no price; use contact-sales flow. Redirect the user to the returned link; after payment, call POST /api/billing/org/verify-payment with the tx_ref from the redirect. Requires org-level JWT.
POST
/api/billing/org/checkoutSDK setup
Create a client and set credentials (JWT and/or API key) before calling the API. Match the authentication type shown above.
import { Configuration, BillingApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfbW9yZ2FuX2RlIiwiZW1haWwiOiJtb3JnYW4uY2hlbkBub3J0aHdpbmQuZGV2IiwiZXhwIjoxODI1MTI5NjAwfQ.doc_preview_sig',
});
const billing = new BillingApi(configuration);import { Configuration, BillingApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfbW9yZ2FuX2RlIiwiZW1haWwiOiJtb3JnYW4uY2hlbkBub3J0aHdpbmQuZGV2IiwiZXhwIjoxODI1MTI5NjAwfQ.doc_preview_sig',
});
const billing = new BillingApi(configuration);Example request
Call this endpoint using the client from SDK setup. Use View HTTP for a raw cURL example.
const { data: result } = await billing.initializeOrgPlanCheckout(
{
planName: "Arthur Barrows",
billingCycle: "bus input",
redirectUrl: "https://subdued-jury.org"
}
);const { data: result } = await billing.initializeOrgPlanCheckout(
{
planName: "Arthur Barrows",
billingCycle: "bus input",
redirectUrl: "https://subdued-jury.org"
}
);Playground
liveTest this endpoint with your own credentials. Your requests will be sent to the live API.
Use the auth endpoints to obtain a JWT.
No Request Yet
Send a request to see the full inspector
Authentication
Requires JWT
Note
Include your JWT in the
Authorization: Bearer YOUR_TOKEN header (user-facing apps, RBAC). View authentication guide →Request Body
json
{
"planName": "starter",
"billingCycle": "monthly",
"redirectUrl": "https://youthful-conservative.net/"
}{
"planName": "starter",
"billingCycle": "monthly",
"redirectUrl": "https://youthful-conservative.net/"
}Responses
200Payment link created
json
{
"success": true,
"data": {
"link": "https://lucky-cake.com/",
"txRef": "circuit input",
"providerRef": "program transmit",
"billingCycle": "alarm parse",
"amount": 637.81,
"amountCents": 10.69
}
}{
"success": true,
"data": {
"link": "https://lucky-cake.com/",
"txRef": "circuit input",
"providerRef": "program transmit",
"billingCycle": "alarm parse",
"amount": 637.81,
"amountCents": 10.69
}
}400Invalid planName or payment gateway not configured
401Organization context required
Errors
| Code | Meaning |
|---|---|
400 | Invalid planName or payment gateway not configured |
401 | Organization context required |