Billing

Verify payment and create subscription

**Customer subscription flow — Step 3.** Call after the user completes payment. Pass **reference** as query (?reference=mudbase_...). On success, a subscription is created. No auth required when using the platform gateway (mudbase_ refs). Org-level gateway verification may require JWT. References starting with pmt_ are rejected (crypto billing is not enabled on this API).

AuthPublic
GroupBilling
Rate limitSee Rate Limits
POST/api/billing/public/projects/{projectId}/verify-payment

SDK setup

Create a client instance. No authentication is required for this endpoint.

import { Configuration, BillingApi } from 'mudbase-sdk';

const configuration = new Configuration({
  basePath: 'https://cloud.mudbase.dev',
});

const billing = new BillingApi(configuration);
import { Configuration, BillingApi } from 'mudbase-sdk';

const configuration = new Configuration({
  basePath: 'https://cloud.mudbase.dev',
});

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.verifyPayment("proj_MmqF1TCwPIuc");
const { data: result } = await billing.verifyPayment("proj_MmqF1TCwPIuc");

Playground

live

Test this endpoint with your own credentials. Your requests will be sent to the live API.

No Request Yet

Send a request to see the full inspector

Authentication

Public — No Auth Required

Path Parameters

NameTypeRequiredDescription
projectIdstringYes

Query Parameters

NameTypeRequiredDescription
referencestringYesPayment transaction reference (mudbase_...)

Responses

200Payment verified and subscription created
json
{
  "success": true,
  "message": "Payment verified and subscription created",
  "data": {
    "subscription": {
      "_id": "65a1b2c3d4e5f6789012345e",
      "status": "active",
      "plan": "65a1b2c3d4e5f6789012345d",
      "currentPeriodEnd": "2026-04-02T00:00:00.000Z"
    }
  }
}
{
  "success": true,
  "message": "Payment verified and subscription created",
  "data": {
    "subscription": {
      "_id": "65a1b2c3d4e5f6789012345e",
      "status": "active",
      "plan": "65a1b2c3d4e5f6789012345d",
      "currentPeriodEnd": "2026-04-02T00:00:00.000Z"
    }
  }
}
400reference is required or organization context missing
json
{
  "error": "reference is required"
}
{
  "error": "reference is required"
}
403Payment does not belong to your organization
json
{
  "error": "Payment does not belong to your organization"
}
{
  "error": "Payment does not belong to your organization"
}
500

Errors

CodeMeaning
400reference is required or organization context missing
403Payment does not belong to your organization
500
Edit this page on GitHub