billing
Verify payment and create subscription
Verifies payment by reference (Flutterwave mudbase_xxx or crypto pmt_xxx) and creates or updates the subscription. Call after redirect from payment provider; pass reference as query (e.g. ?reference=mudbase_abc123). Idempotent for same reference.
POST
/api/billing/public/projects/{projectId}/verify-paymentAuthentication
Public — No Auth Required
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | Project ID (MongoDB ObjectId) for the billing project. |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
reference | string | Yes | Payment reference (e.g. mudbase_abc123 or pmt_abc123) |
SDK setup
Create a client instance. No authentication is required for this endpoint.
import { MudbaseClient } from "mudbase";
const client = new MudbaseClient();import { MudbaseClient } from "mudbase";
const client = new MudbaseClient();Example request
Call this endpoint using the client from SDK setup. Use View HTTP for a raw cURL example.
const result = await client.billing.verifyPayment({
projectId: "proj_jersV4KEoTVa"
});const result = await client.billing.verifyPayment({
projectId: "proj_jersV4KEoTVa"
});Try It 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
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"
}500Internal server error.
Errors
| Code | Meaning |
|---|---|
400 | reference is required or organization context missing |
403 | Payment does not belong to your organization |
500 | Internal server error. |