Skip to main content

PrimeForge Billing API (1.0)

Download OpenAPI specification:Download

Enterprise billing and subscription management system

System

Get service information

Responses

Health check endpoint

Responses

Payment Gateway

Create a payment intent

Create a new payment intent for processing payments

Authorizations:
bearer
query Parameters
provider
string
Enum: "stripe" "paypal"

Payment provider to use (defaults to Stripe)

Request Body schema: application/json
required
amount
required
number >= 1

Payment amount in smallest currency unit (e.g., cents for USD)

currency
required
string
Enum: "usd" "eur" "gbp" "cad" "aud"

Three-letter ISO currency code

customerId
string

ID of existing customer

description
string

Description of the payment

automaticPaymentMethods
boolean
Default: true

Enable automatic payment methods

metadata
object

Metadata as key-value pairs

Responses

Request samples

Content type
application/json
{
  • "amount": 2000,
  • "currency": "usd",
  • "customerId": "cus_1234567890",
  • "description": "Monthly subscription payment for Pro plan",
  • "automaticPaymentMethods": true,
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "paymentIntent": {
    },
  • "customer": {
    },
  • "error": {
    },
  • "provider": "stripe",
  • "timestamp": "2025-07-30T12:00:00Z"
}

Get payment intent

Retrieve a payment intent by its ID

Authorizations:
bearer
path Parameters
intentId
required
string
Example: pi_1234567890

Payment intent ID

query Parameters
provider
string
Enum: "stripe" "paypal"

Payment provider (defaults to Stripe)

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "paymentIntent": {
    },
  • "customer": {
    },
  • "error": {
    },
  • "provider": "stripe",
  • "timestamp": "2025-07-30T12:00:00Z"
}

Update payment intent

Update an existing payment intent

Authorizations:
bearer
path Parameters
intentId
required
string
Example: pi_1234567890

Payment intent ID

query Parameters
provider
string
Enum: "stripe" "paypal"

Payment provider (defaults to Stripe)

Request Body schema: application/json
required
amount
number >= 1

Updated payment amount

currency
string

Updated currency code

description
string

Updated description

metadata
object

Updated metadata

Responses

Request samples

Content type
application/json
{
  • "amount": 2500,
  • "currency": "usd",
  • "description": "Updated payment description",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "paymentIntent": {
    },
  • "customer": {
    },
  • "error": {
    },
  • "provider": "stripe",
  • "timestamp": "2025-07-30T12:00:00Z"
}

Cancel payment intent

Cancel an existing payment intent

Authorizations:
bearer
path Parameters
intentId
required
string
Example: pi_1234567890

Payment intent ID

query Parameters
provider
string
Enum: "stripe" "paypal"

Payment provider (defaults to Stripe)

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "paymentIntent": {
    },
  • "customer": {
    },
  • "error": {
    },
  • "provider": "stripe",
  • "timestamp": "2025-07-30T12:00:00Z"
}

Confirm payment intent

Confirm a payment intent for processing

Authorizations:
bearer
path Parameters
intentId
required
string
Example: pi_1234567890

Payment intent ID

query Parameters
provider
string
Enum: "stripe" "paypal"

Payment provider (defaults to Stripe)

Request Body schema: application/json
required
paymentMethodId
string

Payment method ID to confirm with

returnUrl
string

Return URL for redirect-based payment methods

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "success": true,
  • "paymentIntent": {
    },
  • "customer": {
    },
  • "error": {
    },
  • "provider": "stripe",
  • "timestamp": "2025-07-30T12:00:00Z"
}

Create customer

Create a new customer in the payment gateway

Authorizations:
bearer
query Parameters
provider
string
Enum: "stripe" "paypal"

Payment provider (defaults to Stripe)

Request Body schema: application/json
required
email
string

Customer email address

name
string

Customer full name

phone
string

Customer phone number

metadata
object

Customer metadata

Responses

Request samples

Content type
application/json
{
  • "email": "customer@example.com",
  • "name": "John Doe",
  • "phone": "+1234567890",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "paymentIntent": {
    },
  • "customer": {
    },
  • "error": {
    },
  • "provider": "stripe",
  • "timestamp": "2025-07-30T12:00:00Z"
}

Get customer

Retrieve a customer by their ID

Authorizations:
bearer
path Parameters
customerId
required
string
Example: cus_1234567890

Customer ID

query Parameters
provider
string
Enum: "stripe" "paypal"

Payment provider (defaults to Stripe)

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "paymentIntent": {
    },
  • "customer": {
    },
  • "error": {
    },
  • "provider": "stripe",
  • "timestamp": "2025-07-30T12:00:00Z"
}

Test payment gateway connections

Test connectivity to all configured payment providers

Authorizations:
bearer

Responses

Response samples

Content type
application/json
{
  • "stripe": true,
  • "paypal": false
}

Get available payment providers

List all available payment providers

Authorizations:
bearer

Responses

Response samples

Content type
application/json
[
  • "stripe"
]

Webhooks

Handle Stripe webhook

Process incoming Stripe webhook events

header Parameters
stripe-signature
required
string

Stripe webhook signature for verification

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "eventId": "evt_1234567890",
  • "eventType": "payment_intent.succeeded",
  • "processed": true,
  • "timestamp": "2025-07-30T12:00:00Z",
  • "error": "Invalid event signature",
  • "shouldRetry": false
}

Handle PayPal webhook

Process incoming PayPal webhook events (Not yet implemented)

Responses

Webhook health check

Test endpoint for webhook connectivity

Responses

Orders

Create a new order

Create a new order with payment intent for processing payments

Authorizations:
bearer
Request Body schema: application/json
required
amount
required
number >= 1

Order amount in smallest currency unit (e.g., cents for USD)

currency
required
string
Enum: "usd" "eur" "gbp" "cad" "aud"

Three-letter ISO currency code

provider
required
string
Enum: "STRIPE" "PAYPAL" "FUSIONPAY"

Payment provider to use

payerUserId
string

User ID of the person making the payment

description
string

Order description

metadata
object

Order metadata as key-value pairs

customerId
string

Existing customer ID from payment provider

automaticPaymentMethods
boolean
Default: true

Enable automatic payment methods

Responses

Request samples

Content type
application/json
{
  • "amount": 2000,
  • "currency": "usd",
  • "provider": "STRIPE",
  • "payerUserId": "123e4567-e89b-12d3-a456-426614174000",
  • "description": "Monthly subscription payment for Pro plan",
  • "metadata": {
    },
  • "customerId": "cus_1234567890",
  • "automaticPaymentMethods": true
}

Response samples

Content type
application/json
{
  • "success": true,
  • "order": {
    },
  • "error": "Order not found",
  • "timestamp": "2025-07-30T12:00:00Z"
}

Get orders

Retrieve orders with filtering, sorting, and pagination

Authorizations:
bearer
query Parameters
status
string
Enum: "PENDING" "REQUIRES_ACTION" "SUCCEEDED" "CANCELED" "REFUNDED"
Example: status=SUCCEEDED

Filter by order status

provider
string
Enum: "STRIPE" "PAYPAL" "FUSIONPAY"
Example: provider=STRIPE

Filter by payment provider

payerUserId
string
Example: payerUserId=123e4567-e89b-12d3-a456-426614174000

Filter by payer user ID

currency
string
Example: currency=usd

Filter by currency

minAmount
number >= 1
Example: minAmount=1000

Filter by minimum amount

maxAmount
number >= 1
Example: maxAmount=5000

Filter by maximum amount

createdFrom
string
Example: createdFrom=2025-01-01T00:00:00Z

Filter by created date (from)

createdTo
string
Example: createdTo=2025-12-31T23:59:59Z

Filter by created date (to)

page
number >= 1
Default: 1
Example: page=1

Page number for pagination

limit
number [ 1 .. 100 ]
Default: 20
Example: limit=20

Number of items per page

sortBy
string
Default: "created_at"
Enum: "created_at" "updated_at" "amount"
Example: sortBy=created_at

Sort field

sortOrder
string
Default: "desc"
Enum: "asc" "desc"
Example: sortOrder=desc

Sort direction

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Get order by ID

Retrieve a specific order by its ID

Authorizations:
bearer
path Parameters
orderId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Order ID

Responses

Response samples

Content type
application/json
{
  • "id": "123e4567-e89b-12d3-a456-426614174000",
  • "tenant_id": "123e4567-e89b-12d3-a456-426614174001",
  • "payer_user_id": "123e4567-e89b-12d3-a456-426614174002",
  • "provider": "STRIPE",
  • "provider_intent_id": "pi_1234567890abcdef",
  • "status": "SUCCEEDED",
  • "amount": 2999,
  • "currency": "usd",
  • "description": "Pro plan subscription",
  • "metadata": {
    },
  • "created_at": "2024-01-01T00:00:00.000Z",
  • "updated_at": "2024-01-01T00:00:00.000Z"
}

Update order

Update an existing order (only for PENDING and REQUIRES_ACTION orders)

Authorizations:
bearer
path Parameters
orderId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Order ID

Request Body schema: application/json
required
amount
number >= 1

Updated order amount

description
string

Updated order description

metadata
object

Updated order metadata

Responses

Request samples

Content type
application/json
{
  • "amount": 2500,
  • "description": "Updated subscription payment for Pro plan",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "order": {
    },
  • "error": "Order not found",
  • "timestamp": "2025-07-30T12:00:00Z"
}

Cancel order

Cancel an existing order (only for PENDING and REQUIRES_ACTION orders)

Authorizations:
bearer
path Parameters
orderId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Order ID

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "order": {
    },
  • "error": "Order not found",
  • "timestamp": "2025-07-30T12:00:00Z"
}

Process order payment

Confirm and process payment for an existing order

Authorizations:
bearer
path Parameters
orderId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Order ID

Request Body schema: application/json
required
paymentMethodId
string

Payment method ID for payment confirmation

returnUrl
string

Return URL for redirect-based payment methods

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "success": true,
  • "order": {
    },
  • "error": "Order not found",
  • "timestamp": "2025-07-30T12:00:00Z"
}

Refund order

Process refund for a completed order (only for SUCCEEDED orders)

Authorizations:
bearer
path Parameters
orderId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Order ID

Request Body schema: application/json
required
amount
number >= 1

Refund amount (if partial refund). If not provided, full refund will be processed

reason
string

Reason for the refund

metadata
object

Refund metadata

Responses

Request samples

Content type
application/json
{
  • "amount": 1000,
  • "reason": "Customer requested cancellation",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "order": {
    },
  • "error": "Order not found",
  • "timestamp": "2025-07-30T12:00:00Z"
}

Get order status information

Get detailed status information and possible actions for an order

Authorizations:
bearer
path Parameters
orderId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Order ID

Responses

Response samples

Content type
application/json
{
  • "orderId": "string",
  • "status": "string",
  • "description": "string",
  • "canBeCanceled": true,
  • "canBeRefunded": true,
  • "requiresAction": true,
  • "possibleNextStatuses": [
    ],
  • "recommendedActions": [
    ]
}

Plans

Get available plans

Retrieves available billing plans for subscription selection

Authorizations:
bearer
query Parameters
tier
string
Enum: "FREE" "STARTER" "PRO" "ENTERPRISE"
Example: tier=PRO

Filter by plan tier

search
string
Example: search=professional

Search in plan name or description

active
boolean
Example: active=true

Filter by active status

includePrices
boolean
Default: false
Example: includePrices=true

Include prices in response

page
number >= 1
Default: 1
Example: page=1

Page number for pagination

limit
number [ 1 .. 100 ]
Default: 20
Example: limit=20

Number of items per page

sortBy
string
Default: "created_at"
Enum: "created_at" "updated_at" "display_name" "tier"
Example: sortBy=created_at

Sort field

sortOrder
string
Default: "desc"
Enum: "asc" "desc"
Example: sortOrder=desc

Sort direction

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Get plan details

Retrieves detailed information about a specific plan

Authorizations:
bearer
path Parameters
planId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Plan UUID

query Parameters
includePrices
required
boolean

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "display_name": "string",
  • "description": "string",
  • "tier": "string",
  • "features": { },
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "prices": [
    ],
  • "_count": { }
}

Get available prices for plan

Retrieves available pricing options for the specified plan

Authorizations:
bearer
path Parameters
planId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Plan UUID

query Parameters
activeOnly
required
boolean

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get price details

Retrieves detailed information about a specific price

Authorizations:
bearer
path Parameters
priceId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Price UUID

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "plan_id": "string",
  • "currency": "string",
  • "unit_amount": 0,
  • "interval": "ONE_TIME",
  • "seat_included": 0,
  • "external_id": "string",
  • "active": true,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "plan": { }
}

Get plans by tier

Retrieves available plans for a specific pricing tier

Authorizations:
bearer
path Parameters
tier
required
string
Example: PRO

Plan tier (FREE, STARTER, PRO, ENTERPRISE)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Subscriptions

Create a new subscription

Creates a new subscription for the specified plan

Authorizations:
bearer
Request Body schema: application/json
required
payerUserId
required
string

User ID of the person creating the subscription

planId
required
string

Plan ID to subscribe to

provider
required
string
Enum: "STRIPE" "PAYPAL" "FUSIONPAY"

Payment provider to use

seatCount
required
number >= 1
Default: 1

Number of seats/users for this subscription

providerSubId
string

External payment provider subscription ID (if already created)

trialEnd
string

Trial period end date (ISO string)

Responses

Request samples

Content type
application/json
{
  • "payerUserId": "123e4567-e89b-12d3-a456-426614174000",
  • "planId": "123e4567-e89b-12d3-a456-426614174000",
  • "provider": "STRIPE",
  • "seatCount": 5,
  • "providerSubId": "sub_1234567890",
  • "trialEnd": "2025-02-28T23:59:59Z"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "subscription": {
    },
  • "error": "Subscription not found",
  • "timestamp": "2025-01-30T23:48:56.000Z"
}

Get all subscriptions

Retrieves a paginated list of subscriptions with optional filtering

Authorizations:
bearer
query Parameters
status
string
Enum: "PENDING" "ACTIVE" "PAST_DUE" "CANCELED"
Example: status=ACTIVE

Filter by subscription status

provider
string
Enum: "STRIPE" "PAYPAL" "FUSIONPAY"
Example: provider=STRIPE

Filter by payment provider

payerUserId
string
Example: payerUserId=123e4567-e89b-12d3-a456-426614174000

Filter by payer user ID

planId
string
Example: planId=123e4567-e89b-12d3-a456-426614174000

Filter by plan ID

minSeats
number >= 1
Example: minSeats=1

Filter by minimum seat count

maxSeats
number >= 1
Example: maxSeats=100

Filter by maximum seat count

periodStartFrom
string
Example: periodStartFrom=2025-01-01T00:00:00Z

Filter by period start date (from)

periodStartTo
string
Example: periodStartTo=2025-12-31T23:59:59Z

Filter by period start date (to)

periodEndFrom
string
Example: periodEndFrom=2025-01-01T00:00:00Z

Filter by period end date (from)

periodEndTo
string
Example: periodEndTo=2025-12-31T23:59:59Z

Filter by period end date (to)

createdFrom
string
Example: createdFrom=2025-01-01T00:00:00Z

Filter by created date (from)

createdTo
string
Example: createdTo=2025-12-31T23:59:59Z

Filter by created date (to)

includePlan
boolean
Default: false
Example: includePlan=true

Include plan details in response

page
number >= 1
Default: 1
Example: page=1

Page number for pagination

limit
number [ 1 .. 100 ]
Default: 20
Example: limit=20

Number of items per page

sortBy
string
Default: "created_at"
Enum: "created_at" "updated_at" "current_period_start" "current_period_end"
Example: sortBy=created_at

Sort field

sortOrder
string
Default: "desc"
Enum: "asc" "desc"
Example: sortOrder=desc

Sort direction

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Get active subscriptions

Retrieves all active subscriptions for the current tenant

Authorizations:
bearer

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get subscription by ID

Retrieves a specific subscription by its ID

Authorizations:
bearer
path Parameters
subscriptionId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Subscription UUID

query Parameters
includePlan
required
boolean

Responses

Response samples

Content type
application/json
{
  • "id": "123e4567-e89b-12d3-a456-426614174000",
  • "tenant_id": "123e4567-e89b-12d3-a456-426614174001",
  • "payer_user_id": "123e4567-e89b-12d3-a456-426614174002",
  • "plan_id": "123e4567-e89b-12d3-a456-426614174003",
  • "plan": {
    },
  • "provider": "STRIPE",
  • "provider_sub_id": "sub_1234567890abcdef",
  • "status": "ACTIVE",
  • "seatCount": 5,
  • "current_period_start": "2024-01-01T00:00:00.000Z",
  • "current_period_end": "2024-02-01T00:00:00.000Z",
  • "cancel_at_period_end": false,
  • "created_at": "2024-01-01T00:00:00.000Z",
  • "updated_at": "2024-01-01T00:00:00.000Z"
}

Update subscription

Updates an existing subscription with new details

Authorizations:
bearer
path Parameters
subscriptionId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Subscription UUID

Request Body schema: application/json
required
planId
string

New plan ID to upgrade/downgrade to

seatCount
number >= 1

New number of seats/users for this subscription

cancelAtPeriodEnd
boolean

Whether to cancel the subscription at the end of the current period

Responses

Request samples

Content type
application/json
{
  • "planId": "123e4567-e89b-12d3-a456-426614174000",
  • "seatCount": 10,
  • "cancelAtPeriodEnd": false
}

Response samples

Content type
application/json
{
  • "success": true,
  • "subscription": {
    },
  • "error": "Subscription not found",
  • "timestamp": "2025-01-30T23:48:56.000Z"
}

Cancel subscription

Cancels a subscription either immediately or at the end of the billing period

Authorizations:
bearer
path Parameters
subscriptionId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Subscription UUID

Request Body schema: application/json
required
immediately
boolean
Default: false

Whether to cancel immediately or at period end

reason
string

Reason for cancellation

Responses

Request samples

Content type
application/json
{
  • "immediately": false,
  • "reason": "User requested cancellation"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "subscription": {
    },
  • "error": "Subscription not found",
  • "timestamp": "2025-01-30T23:48:56.000Z"
}

Reactivate subscription

Reactivates a canceled subscription

Authorizations:
bearer
path Parameters
subscriptionId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Subscription UUID

Request Body schema: application/json
required
planId
string

New plan to reactivate with (if different from original)

seatCount
number >= 1

Number of seats for reactivated subscription

Responses

Request samples

Content type
application/json
{
  • "planId": "123e4567-e89b-12d3-a456-426614174000",
  • "seatCount": 5
}

Response samples

Content type
application/json
{
  • "success": true,
  • "subscription": {
    },
  • "error": "Subscription not found",
  • "timestamp": "2025-01-30T23:48:56.000Z"
}

Upgrade subscription

Upgrades a subscription to a higher tier plan

Authorizations:
bearer
path Parameters
subscriptionId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Subscription UUID

Responses

Downgrade subscription

Downgrades a subscription to a lower tier plan

Authorizations:
bearer
path Parameters
subscriptionId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Subscription UUID

Responses

Change subscription seat count

Changes the number of seats for a subscription

Authorizations:
bearer
path Parameters
subscriptionId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Subscription UUID

Responses

Get upgrade options

Gets available upgrade options for a subscription

Authorizations:
bearer
path Parameters
subscriptionId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Subscription UUID

Responses

Get downgrade options

Gets available downgrade options for a subscription

Authorizations:
bearer
path Parameters
subscriptionId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Subscription UUID

Responses

Get billing summary

Gets billing summary for a subscription

Authorizations:
bearer
path Parameters
subscriptionId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Subscription UUID

Responses

Process billing

Manually processes billing for a subscription

Authorizations:
bearer
path Parameters
subscriptionId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Subscription UUID

Responses

Get subscription status information

Gets detailed status information and possible actions for a subscription

Authorizations:
bearer
path Parameters
subscriptionId
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Subscription UUID

Responses

Invoices

Create a new invoice

Authorizations:
bearer
Request Body schema: application/json
required
subscriptionId
required
string

Subscription ID

provider
required
string
Enum: "STRIPE" "PAYPAL" "FUSIONPAY"

Payment provider

providerInvoiceId
required
string

Provider invoice ID

total
required
number >= 0

Invoice total amount in smallest currency unit

status
required
string
Enum: "DRAFT" "OPEN" "PAID" "VOID"

Invoice status

dueDate
required
string

Invoice due date

tenantId
string

Tenant ID (will be set from context if not provided)

Responses

Request samples

Content type
application/json
{
  • "subscriptionId": "123e4567-e89b-12d3-a456-426614174000",
  • "provider": "STRIPE",
  • "providerInvoiceId": "in_1234567890",
  • "total": 2000,
  • "status": "OPEN",
  • "dueDate": "2025-08-30T00:00:00Z",
  • "tenantId": "123e4567-e89b-12d3-a456-426614174000"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "invoice": {
    },
  • "error": "Invoice not found",
  • "timestamp": "2025-07-30T12:00:00Z"
}

Get all invoices with filtering and pagination

Authorizations:
bearer
query Parameters
status
string
Enum: "DRAFT" "OPEN" "PAID" "VOID"
Example: status=PAID

Filter by invoice status

provider
string
Enum: "STRIPE" "PAYPAL" "FUSIONPAY"
Example: provider=STRIPE

Filter by payment provider

subscriptionId
string
Example: subscriptionId=123e4567-e89b-12d3-a456-426614174000

Filter by subscription ID

providerInvoiceId
string
Example: providerInvoiceId=in_1234567890

Filter by provider invoice ID

createdAfter
string
Example: createdAfter=2025-01-01T00:00:00Z

Filter invoices created after this date

createdBefore
string
Example: createdBefore=2025-12-31T23:59:59Z

Filter invoices created before this date

dueAfter
string
Example: dueAfter=2025-01-01T00:00:00Z

Filter invoices due after this date

dueBefore
string
Example: dueBefore=2025-12-31T23:59:59Z

Filter invoices due before this date

page
number >= 1
Example: page=1

Page number (1-based)

limit
number [ 1 .. 100 ]
Example: limit=20

Number of items per page

sortBy
string
Enum: "createdAt" "updatedAt" "dueDate" "total"
Example: sortBy=createdAt

Sort by field

sortOrder
string
Enum: "asc" "desc"
Example: sortOrder=desc

Sort order

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Get all invoices (admin only, no tenant filtering)

Authorizations:
bearer
query Parameters
status
string
Enum: "DRAFT" "OPEN" "PAID" "VOID"
Example: status=PAID

Filter by invoice status

provider
string
Enum: "STRIPE" "PAYPAL" "FUSIONPAY"
Example: provider=STRIPE

Filter by payment provider

subscriptionId
string
Example: subscriptionId=123e4567-e89b-12d3-a456-426614174000

Filter by subscription ID

providerInvoiceId
string
Example: providerInvoiceId=in_1234567890

Filter by provider invoice ID

createdAfter
string
Example: createdAfter=2025-01-01T00:00:00Z

Filter invoices created after this date

createdBefore
string
Example: createdBefore=2025-12-31T23:59:59Z

Filter invoices created before this date

dueAfter
string
Example: dueAfter=2025-01-01T00:00:00Z

Filter invoices due after this date

dueBefore
string
Example: dueBefore=2025-12-31T23:59:59Z

Filter invoices due before this date

page
number >= 1
Example: page=1

Page number (1-based)

limit
number [ 1 .. 100 ]
Example: limit=20

Number of items per page

sortBy
string
Enum: "createdAt" "updatedAt" "dueDate" "total"
Example: sortBy=createdAt

Sort by field

sortOrder
string
Enum: "asc" "desc"
Example: sortOrder=desc

Sort order

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Get invoice by provider invoice ID

Authorizations:
bearer
path Parameters
providerInvoiceId
required
string
Example: in_1234567890

Provider invoice ID (e.g., Stripe invoice ID)

Responses

Response samples

Content type
application/json
{
  • "id": "123e4567-e89b-12d3-a456-426614174000",
  • "tenant_id": "123e4567-e89b-12d3-a456-426614174001",
  • "subscription_id": "123e4567-e89b-12d3-a456-426614174002",
  • "subscription": {
    },
  • "provider": "STRIPE",
  • "provider_invoice_id": "in_1234567890abcdef",
  • "total": 2999,
  • "status": "PAID",
  • "due_date": "2024-01-31T23:59:59.000Z",
  • "created_at": "2024-01-01T00:00:00.000Z",
  • "updated_at": "2024-01-01T00:00:00.000Z"
}

Get invoice by ID

Authorizations:
bearer
path Parameters
id
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Invoice ID

Responses

Response samples

Content type
application/json
{
  • "id": "123e4567-e89b-12d3-a456-426614174000",
  • "tenant_id": "123e4567-e89b-12d3-a456-426614174001",
  • "subscription_id": "123e4567-e89b-12d3-a456-426614174002",
  • "subscription": {
    },
  • "provider": "STRIPE",
  • "provider_invoice_id": "in_1234567890abcdef",
  • "total": 2999,
  • "status": "PAID",
  • "due_date": "2024-01-31T23:59:59.000Z",
  • "created_at": "2024-01-01T00:00:00.000Z",
  • "updated_at": "2024-01-01T00:00:00.000Z"
}

Delete invoice

Authorizations:
bearer
path Parameters
id
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Invoice ID

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "invoice": {
    },
  • "error": "Invoice not found",
  • "timestamp": "2025-07-30T12:00:00Z"
}

Update invoice status

Authorizations:
bearer
path Parameters
id
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Invoice ID

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "invoice": {
    },
  • "error": "Invoice not found",
  • "timestamp": "2025-07-30T12:00:00Z"
}

Generate upcoming invoices for renewals

Authorizations:
bearer
query Parameters
daysAhead
number
Example: daysAhead=3

Number of days ahead to look for renewals

Responses

Process invoice reminders

Authorizations:
bearer

Responses

Process all invoice automation tasks (renewals, overdue, reminders)

Authorizations:
bearer

Responses

Entitlements

Create a new entitlement

Authorizations:
bearer
Request Body schema: application/json
required
featureKey
required
string

Feature key/identifier

validFrom
required
string

Entitlement valid from date

validTo
required
string

Entitlement valid to date

seatLimit
required
number >= 1

Seat limit for this entitlement

usageCount
number >= 0

Initial usage count

tenantId
string

Tenant ID (will be set from context if not provided)

Responses

Request samples

Content type
application/json
{
  • "featureKey": "hr_management",
  • "validFrom": "2025-01-01T00:00:00Z",
  • "validTo": "2025-12-31T23:59:59Z",
  • "seatLimit": 10,
  • "usageCount": 0,
  • "tenantId": "123e4567-e89b-12d3-a456-426614174000"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "entitlement": {
    },
  • "error": "Entitlement not found",
  • "timestamp": "2025-07-30T12:00:00Z"
}

Get all entitlements with filtering and pagination

Authorizations:
bearer
query Parameters
featureKey
string
Example: featureKey=hr_management

Filter by feature key

tenantId
string
Example: tenantId=123e4567-e89b-12d3-a456-426614174000

Filter by tenant ID (admin only)

validFromAfter
string
Example: validFromAfter=2025-01-01T00:00:00Z

Filter entitlements valid from after this date

validFromBefore
string
Example: validFromBefore=2025-12-31T23:59:59Z

Filter entitlements valid from before this date

validToAfter
string
Example: validToAfter=2025-01-01T00:00:00Z

Filter entitlements valid to after this date

validToBefore
string
Example: validToBefore=2025-12-31T23:59:59Z

Filter entitlements valid to before this date

active
boolean
Example: active=true

Filter by active status (based on current date)

expired
boolean
Example: expired=false

Filter by expired status (based on current date)

minSeatLimit
number >= 1
Example: minSeatLimit=5

Filter by minimum seat limit

maxSeatLimit
number >= 1
Example: maxSeatLimit=100

Filter by maximum seat limit

usageThreshold
number [ 0 .. 100 ]
Example: usageThreshold=80

Filter by usage threshold (percentage of seat limit used)

page
number >= 1
Example: page=1

Page number (1-based)

limit
number [ 1 .. 100 ]
Example: limit=20

Number of items per page

sortBy
string
Enum: "createdAt" "validFrom" "validTo" "featureKey" "seatLimit" "usageCount"
Example: sortBy=validTo

Sort by field

sortOrder
string
Enum: "asc" "desc"
Example: sortOrder=asc

Sort order

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Get all entitlements (admin only, no tenant filtering)

Authorizations:
bearer
query Parameters
featureKey
string
Example: featureKey=hr_management

Filter by feature key

tenantId
string
Example: tenantId=123e4567-e89b-12d3-a456-426614174000

Filter by tenant ID (admin only)

validFromAfter
string
Example: validFromAfter=2025-01-01T00:00:00Z

Filter entitlements valid from after this date

validFromBefore
string
Example: validFromBefore=2025-12-31T23:59:59Z

Filter entitlements valid from before this date

validToAfter
string
Example: validToAfter=2025-01-01T00:00:00Z

Filter entitlements valid to after this date

validToBefore
string
Example: validToBefore=2025-12-31T23:59:59Z

Filter entitlements valid to before this date

active
boolean
Example: active=true

Filter by active status (based on current date)

expired
boolean
Example: expired=false

Filter by expired status (based on current date)

minSeatLimit
number >= 1
Example: minSeatLimit=5

Filter by minimum seat limit

maxSeatLimit
number >= 1
Example: maxSeatLimit=100

Filter by maximum seat limit

usageThreshold
number [ 0 .. 100 ]
Example: usageThreshold=80

Filter by usage threshold (percentage of seat limit used)

page
number >= 1
Example: page=1

Page number (1-based)

limit
number [ 1 .. 100 ]
Example: limit=20

Number of items per page

sortBy
string
Enum: "createdAt" "validFrom" "validTo" "featureKey" "seatLimit" "usageCount"
Example: sortBy=validTo

Sort by field

sortOrder
string
Enum: "asc" "desc"
Example: sortOrder=asc

Sort order

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Get active entitlements for current tenant

Authorizations:
bearer

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get entitlements by feature key

Authorizations:
bearer
path Parameters
featureKey
required
string
Example: hr_management

Feature key/identifier

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get feature entitlement summary for current tenant

Authorizations:
bearer

Responses

Get entitlement by ID

Authorizations:
bearer
path Parameters
id
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Entitlement ID

Responses

Response samples

Content type
application/json
{
  • "id": "123e4567-e89b-12d3-a456-426614174000",
  • "tenant_id": "123e4567-e89b-12d3-a456-426614174001",
  • "feature_key": "analytics",
  • "valid_from": "2024-01-01T00:00:00.000Z",
  • "valid_to": "2024-12-31T23:59:59.000Z",
  • "seat_limit": 10,
  • "usage_count": 5
}

Delete entitlement

Authorizations:
bearer
path Parameters
id
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Entitlement ID

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "entitlement": {
    },
  • "error": "Entitlement not found",
  • "timestamp": "2025-07-30T12:00:00Z"
}

Update entitlement usage

Authorizations:
bearer
path Parameters
id
required
string
Example: 123e4567-e89b-12d3-a456-426614174000

Entitlement ID

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "previousUsage": 5,
  • "newUsage": 6,
  • "remainingSeats": 4,
  • "warning": "Usage is at 80% of limit",
  • "error": "Usage would exceed seat limit",
  • "timestamp": "2025-07-30T12:00:00Z"
}

Validate feature access for current tenant

Authorizations:
bearer

Responses

Validate access to multiple features

Authorizations:
bearer

Responses

Validate and consume seats for a feature

Authorizations:
bearer

Responses

Track usage event (consume or release seats)

Authorizations:
bearer

Responses

Get usage statistics for current tenant

Authorizations:
bearer
query Parameters
featureKey
string

Filter by specific feature

Responses

Check entitlements approaching usage limits

Authorizations:
bearer
query Parameters
threshold
string

Usage percentage threshold (default: 80)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Check entitlements expiring soon

Authorizations:
bearer
query Parameters
days
string

Number of days ahead to check (default: 30)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Monitor usage thresholds across all tenants (admin only)

Authorizations:
bearer
query Parameters
threshold
string

Usage percentage threshold (default: 80)

Responses

Process usage cleanup (admin only)

Authorizations:
bearer

Responses

Events

Process a specific event

Process a specific event by ID, with optional force reprocessing

Authorizations:
bearer
Request Body schema: application/json
required
eventId
required
string

Event ID to process

forceReprocess
boolean
Default: false

Force reprocessing even if already processed

Responses

Request samples

Content type
application/json
{
  • "eventId": "evt_1234567890",
  • "forceReprocess": false
}

Response samples

Content type
application/json
{
  • "success": true,
  • "eventId": "evt_1234567890",
  • "eventType": "payment_intent.succeeded",
  • "processed": true,
  • "timestamp": "2025-07-30T10:00:00Z",
  • "error": "Invalid event payload format",
  • "shouldRetry": true,
  • "retryCount": 1,
  • "actions": [
    ]
}

Process all unprocessed events

Process all unprocessed events in the queue

Authorizations:
bearer
query Parameters
limit
number
Example: limit=100

Maximum number of events to process

Responses

Response samples

Content type
application/json
{
  • "totalProcessed": 50,
  • "successCount": 45,
  • "failureCount": 5,
  • "results": [
    ]
}

Retry a specific event

Retry processing of a specific event with exponential backoff

Authorizations:
bearer
Request Body schema: application/json
required
eventId
required
string

Event ID to retry

maxRetries
number [ 1 .. 10 ]
Default: 3

Maximum number of retry attempts

Responses

Request samples

Content type
application/json
{
  • "eventId": "evt_1234567890",
  • "maxRetries": 3
}

Response samples

Content type
application/json
{
  • "success": true,
  • "eventId": "evt_1234567890",
  • "eventType": "payment_intent.succeeded",
  • "processed": true,
  • "timestamp": "2025-07-30T10:00:00Z",
  • "error": "Invalid event payload format",
  • "shouldRetry": true,
  • "retryCount": 1,
  • "actions": [
    ]
}

Retry all failed events

Retry all events that have failed but not exceeded max retry limit

Authorizations:
bearer
query Parameters
maxRetries
number
Example: maxRetries=5

Maximum retry attempts per event

limit
number
Example: limit=50

Maximum number of events to retry

Responses

Response samples

Content type
application/json
{
  • "totalRetried": 25,
  • "successCount": 20,
  • "failureCount": 3,
  • "permanentlyFailedCount": 2
}

Get event processing statistics

Get comprehensive statistics about event processing

Authorizations:
bearer

Responses

Response samples

Content type
application/json
{
  • "totalProcessed": 1250,
  • "totalFailed": 25,
  • "totalPending": 5,
  • "last24Hours": 150,
  • "averageProcessingTime": 245,
  • "commonEventTypes": [
    ]
}

Get event history

Get paginated event history with optional filtering

Authorizations:
bearer
query Parameters
page
number
Example: page=1

Page number

limit
number
Example: limit=20

Items per page

eventType
string
Enum: "payment_intent.created" "payment_intent.succeeded" "payment_intent.payment_failed" "payment_intent.canceled" "payment_intent.requires_action" "invoice.created" "invoice.finalized" "invoice.payment_succeeded" "invoice.payment_failed" "invoice.voided" "customer.subscription.created" "customer.subscription.updated" "customer.subscription.deleted" "customer.subscription.trial_will_end" "customer.created" "customer.updated" "customer.deleted" "charge.succeeded" "charge.failed" "charge.refunded" "charge.dispute.created" "setup_intent.succeeded" "setup_intent.setup_failed"

Filter by event type

processed
boolean

Filter by processing status

startDate
string

Filter events from this date (ISO string)

endDate
string

Filter events to this date (ISO string)

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Get event by ID

Get detailed information about a specific event

Authorizations:
bearer
path Parameters
eventId
required
string
Example: evt_1234567890

Event ID

Responses

Response samples

Content type
application/json
{
  • "id": "evt_1234567890",
  • "tenantId": "123e4567-e89b-12d3-a456-426614174000",
  • "type": "payment_intent.succeeded",
  • "apiVersion": "2023-10-16",
  • "payload": {
    },
  • "context": "Authentication context or related object details",
  • "processed": true,
  • "retries": 0,
  • "created": 1677721200,
  • "processedAt": "2025-07-30T10:00:00Z",
  • "receivedAt": "2025-07-30T10:00:00Z"
}

Get supported event types

Get list of all supported Stripe event types

Authorizations:
bearer

Responses

Response samples

Content type
application/json
{
  • "supportedTypes": [
    ]
}

Get performance metrics

Get detailed performance metrics for event processing

Authorizations:
bearer
query Parameters
hours
number
Example: hours=24

Number of hours to look back

Responses

Response samples

Content type
application/json
{
  • "eventsPerHour": [
    ],
  • "retryDistribution": [
    ],
  • "errorPatterns": [
    ],
  • "slowEvents": [
    ]
}

Detect processing anomalies

Detect unusual patterns in event processing

Authorizations:
bearer
query Parameters
hours
number
Example: hours=24

Number of hours to analyze

Responses

Response samples

Content type
application/json
{
  • "suspiciousEvents": [
    ],
  • "highFailureRates": [
    ],
  • "retrySpikes": [
    ]
}

Notifications

Send email notification

Send a single email notification using a template

Authorizations:
bearer
Request Body schema: application/json
required
tenantId
required
string

Tenant ID

templateType
required
string
Enum: "invoice_paid" "invoice_payment_failed" "invoice_finalized" "subscription_created" "subscription_updated" "subscription_canceled" "subscription_reactivated" "trial_will_end" "payment_succeeded" "payment_failed" "payment_action_required" "customer_created"

Email template type

required
Array of objects (EmailRecipientDto)

Email recipients

templateVariables
required
object

Template variables for personalization

priority
string
Default: "normal"
Enum: "low" "normal" "high" "urgent"

Email priority

Array of objects (EmailAttachmentDto)

Email attachments

customSubject
string

Custom email subject (overrides template default)

sendImmediate
boolean
Default: false

Send immediately (bypass queue)

scheduledAt
string

Schedule sending for later (ISO date string)

metadata
object

Additional metadata

Responses

Request samples

Content type
application/json
{
  • "tenantId": "123e4567-e89b-12d3-a456-426614174000",
  • "templateType": "invoice_paid",
  • "recipients": [
    ],
  • "templateVariables": {
    },
  • "priority": "normal",
  • "attachments": [
    ],
  • "customSubject": "Your invoice has been paid successfully",
  • "sendImmediate": false,
  • "scheduledAt": "2025-08-01T10:00:00Z",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "operation": "email_sent",
  • "count": 1,
  • "notificationIds": [
    ],
  • "error": "SMTP server unavailable",
  • "timestamp": "2025-07-30T10:00:00Z",
  • "details": {
    }
}

Send bulk email notifications

Send multiple email notifications in batch

Authorizations:
bearer
Request Body schema: application/json
required
tenantId
required
string

Tenant ID

templateType
required
string
Enum: "invoice_paid" "invoice_payment_failed" "invoice_finalized" "subscription_created" "subscription_updated" "subscription_canceled" "subscription_reactivated" "trial_will_end" "payment_succeeded" "payment_failed" "payment_action_required" "customer_created"

Email template type

required
Array of objects

List of recipients with personalized data

priority
string
Default: "normal"
Enum: "low" "normal" "high" "urgent"

Email priority

batchSize
number [ 1 .. 1000 ]
Default: 100

Batch size for processing

Responses

Request samples

Content type
application/json
{
  • "tenantId": "123e4567-e89b-12d3-a456-426614174000",
  • "templateType": "trial_will_end",
  • "recipientData": [
    ],
  • "priority": "normal",
  • "batchSize": 100
}

Response samples

Content type
application/json
{
  • "success": true,
  • "operation": "email_sent",
  • "count": 1,
  • "notificationIds": [
    ],
  • "error": "SMTP server unavailable",
  • "timestamp": "2025-07-30T10:00:00Z",
  • "details": {
    }
}

Send webhook notification

Send a single webhook notification

Authorizations:
bearer
Request Body schema: application/json
required
tenantId
required
string

Tenant ID

url
required
string

Webhook endpoint URL

eventType
required
string
Enum: "payment.succeeded" "payment.failed" "invoice.paid" "invoice.payment_failed" "subscription.created" "subscription.updated" "subscription.canceled" "customer.created" "customer.updated" "entitlement.granted" "entitlement.revoked" "order.completed" "order.refunded"

Webhook event type

payload
required
object

Webhook payload data

httpMethod
string
Default: "POST"
Enum: "POST" "PUT" "PATCH"

HTTP method to use

Array of objects (WebhookHeaderDto)

Additional HTTP headers

secret
string

Webhook signature secret for HMAC validation

timeout
number [ 1000 .. 120000 ]
Default: 30000

Request timeout in milliseconds

maxRetries
number [ 0 .. 10 ]
Default: 3

Maximum number of retry attempts

sendImmediate
boolean
Default: false

Send immediately (bypass queue)

metadata
object

Additional metadata

Responses

Request samples

Content type
application/json
{
  • "tenantId": "123e4567-e89b-12d3-a456-426614174000",
  • "eventType": "payment.succeeded",
  • "payload": {
    },
  • "httpMethod": "POST",
  • "headers": [
    ],
  • "secret": "whsec_1234567890abcdef",
  • "timeout": 30000,
  • "maxRetries": 3,
  • "sendImmediate": false,
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "operation": "email_sent",
  • "count": 1,
  • "notificationIds": [
    ],
  • "error": "SMTP server unavailable",
  • "timestamp": "2025-07-30T10:00:00Z",
  • "details": {
    }
}

Send bulk webhook notifications

Send multiple webhook notifications in batch

Authorizations:
bearer
Request Body schema: application/json
required
tenantId
required
string

Tenant ID

eventType
required
string
Enum: "payment.succeeded" "payment.failed" "invoice.paid" "invoice.payment_failed" "subscription.created" "subscription.updated" "subscription.canceled" "customer.created" "customer.updated" "entitlement.granted" "entitlement.revoked" "order.completed" "order.refunded"

Webhook event type

required
Array of objects

List of webhook deliveries

batchSize
number [ 1 .. 100 ]
Default: 50

Batch size for processing

Responses

Request samples

Content type
application/json
{
  • "tenantId": "123e4567-e89b-12d3-a456-426614174000",
  • "eventType": "subscription.updated",
  • "deliveries": [],
  • "batchSize": 50
}

Response samples

Content type
application/json
{
  • "success": true,
  • "operation": "email_sent",
  • "count": 1,
  • "notificationIds": [
    ],
  • "error": "SMTP server unavailable",
  • "timestamp": "2025-07-30T10:00:00Z",
  • "details": {
    }
}

Get email notification by ID

Get detailed information about a specific email notification

Authorizations:
bearer
path Parameters
notificationId
required
string

Email notification ID

Responses

Response samples

Content type
application/json
{
  • "id": "123e4567-e89b-12d3-a456-426614174000",
  • "tenantId": "123e4567-e89b-12d3-a456-426614174000",
  • "templateType": "invoice_paid",
  • "recipientEmail": "user@example.com",
  • "recipientName": "John Doe",
  • "subject": "Your invoice has been paid successfully",
  • "status": "sent",
  • "priority": "normal",
  • "errorMessage": "SMTP connection timeout",
  • "retryCount": 1,
  • "createdAt": "2025-07-30T10:00:00Z",
  • "sentAt": "2025-07-30T10:05:00Z",
  • "deliveredAt": "2025-07-30T10:06:00Z",
  • "openedAt": "2025-07-30T11:00:00Z",
  • "clickedAt": "2025-07-30T11:30:00Z",
  • "metadata": {
    }
}

Get webhook notification by ID

Get detailed information about a specific webhook notification

Authorizations:
bearer
path Parameters
notificationId
required
string

Webhook notification ID

Responses

Response samples

Content type
application/json
{
  • "id": "123e4567-e89b-12d3-a456-426614174000",
  • "tenantId": "123e4567-e89b-12d3-a456-426614174000",
  • "eventType": "payment.succeeded",
  • "status": "sent",
  • "responseStatus": 200,
  • "responseBody": "{\"status\": \"received\"}",
  • "errorMessage": "Connection timeout after 30 seconds",
  • "retryCount": 0,
  • "duration": 1250,
  • "createdAt": "2025-07-30T10:00:00Z",
  • "sentAt": "2025-07-30T10:00:05Z",
  • "nextRetryAt": "2025-07-30T10:01:00Z",
  • "metadata": {
    }
}

Retry webhook notification

Retry a failed webhook notification

Authorizations:
bearer
path Parameters
notificationId
required
string

Webhook notification ID

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "operation": "email_sent",
  • "count": 1,
  • "notificationIds": [
    ],
  • "error": "SMTP server unavailable",
  • "timestamp": "2025-07-30T10:00:00Z",
  • "details": {
    }
}

Get notification statistics

Get comprehensive notification statistics for the tenant

Authorizations:
bearer

Responses

Response samples

Content type
application/json
{
  • "totalSent": 1500,
  • "totalFailed": 25,
  • "totalPending": 10,
  • "emailStats": {
    },
  • "webhookStats": {
    },
  • "byTemplateType": [
    ],
  • "last24Hours": {
    }
}

Get available email templates

Get list of all available email templates

Authorizations:
bearer

Responses

Response samples

Content type
application/json
{
  • "templates": [
    ]
}

Preview email template

Preview an email template with sample or custom data

Authorizations:
bearer
path Parameters
templateType
required
string
Enum: "invoice_paid" "invoice_payment_failed" "invoice_finalized" "subscription_created" "subscription_updated" "subscription_canceled" "subscription_reactivated" "trial_will_end" "payment_succeeded" "payment_failed" "payment_action_required" "customer_created"

Email template type

Responses

Response samples

Content type
application/json
{
  • "subject": "string",
  • "html": "string",
  • "text": "string"
}

Process queued notifications

Process pending email and webhook notifications

Authorizations:
bearer
query Parameters
type
string
Enum: "email" "webhook" "all"

Notification type to process

limit
number

Maximum number of notifications to process

Responses

Response samples

Content type
application/json
{
  • "email": {
    },
  • "webhook": {
    }
}

Admin

(Admin) Get all payment provider configurations

Authorizations:
None

Responses

Response samples

Content type
application/json
[
  • {
    }
]

(Admin) Create payment provider configuration

Authorizations:
None
Request Body schema: application/json
required
provider
required
string
Enum: "STRIPE" "PAYPAL" "FUSIONPAY"

Payment provider type

mode
required
string
Enum: "SANDBOX" "LIVE"

Environment mode

public_key
object

Public key for the provider

secret_key
object

Secret key for the provider

webhook_secret
object

Webhook secret for the provider

extra
object

Additional configuration data

active
boolean
Default: true

Whether the configuration is active

Responses

Request samples

Content type
application/json
{
  • "provider": "STRIPE",
  • "mode": "SANDBOX",
  • "public_key": "pk_test_...",
  • "secret_key": "sk_test_...",
  • "webhook_secret": "whsec_...",
  • "extra": {},
  • "active": true
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "provider": "STRIPE",
  • "mode": "SANDBOX",
  • "public_key": "string",
  • "secret_key": "string",
  • "webhook_secret": "string",
  • "extra": { },
  • "active": true,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

(Admin) Get payment provider configuration by ID

Authorizations:
None
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "provider": "STRIPE",
  • "mode": "SANDBOX",
  • "public_key": "string",
  • "secret_key": "string",
  • "webhook_secret": "string",
  • "extra": { },
  • "active": true,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

(Admin) Update payment provider configuration

Authorizations:
None
path Parameters
id
required
string
Request Body schema: application/json
required
provider
string
Enum: "STRIPE" "PAYPAL" "FUSIONPAY"

Payment provider type

mode
string
Enum: "SANDBOX" "LIVE"

Environment mode

public_key
object

Public key for the provider

secret_key
object

Secret key for the provider

webhook_secret
object

Webhook secret for the provider

extra
object

Additional configuration data

active
boolean
Default: true

Whether the configuration is active

Responses

Request samples

Content type
application/json
{
  • "provider": "STRIPE",
  • "mode": "SANDBOX",
  • "public_key": "pk_test_...",
  • "secret_key": "sk_test_...",
  • "webhook_secret": "whsec_...",
  • "extra": {},
  • "active": true
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "provider": "STRIPE",
  • "mode": "SANDBOX",
  • "public_key": "string",
  • "secret_key": "string",
  • "webhook_secret": "string",
  • "extra": { },
  • "active": true,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

(Admin) Delete payment provider configuration

Authorizations:
None
path Parameters
id
required
string

Responses

(Admin) Get all plans

Authorizations:
None
query Parameters
page
number
Default: 1
Example: page=1

Page number

limit
number
Default: 20
Example: limit=20

Items per page

search
string
Example: search=Professional

Search term

Responses

Response samples

Content type
application/json
[
  • {
    }
]

(Admin) Create plan

Authorizations:
None
Request Body schema: application/json
required
display_name
required
string

Display name of the plan

description
object

Description of the plan

tier
required
string

Plan tier

features
Array of strings

Plan features

Responses

Request samples

Content type
application/json
{
  • "display_name": "Professional Plan",
  • "description": "Advanced features for growing teams",
  • "tier": "PRO",
  • "features": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "display_name": "string",
  • "description": "string",
  • "tier": "string",
  • "features": { },
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "prices": [
    ],
  • "_count": { }
}

(Admin) Get plan by ID

Authorizations:
None
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "display_name": "string",
  • "description": "string",
  • "tier": "string",
  • "features": { },
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "prices": [
    ],
  • "_count": { }
}

(Admin) Update plan

Authorizations:
None
path Parameters
id
required
string
Request Body schema: application/json
required
display_name
string

Display name of the plan

description
object

Description of the plan

tier
string

Plan tier

features
Array of strings

Plan features

Responses

Request samples

Content type
application/json
{
  • "display_name": "Professional Plan",
  • "description": "Advanced features for growing teams",
  • "tier": "PRO",
  • "features": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "display_name": "string",
  • "description": "string",
  • "tier": "string",
  • "features": { },
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "prices": [
    ],
  • "_count": { }
}

(Admin) Delete plan

Authorizations:
None
path Parameters
id
required
string

Responses

(Admin) Get all prices

Authorizations:
None
query Parameters
page
number
Default: 1
Example: page=1

Page number

limit
number
Default: 20
Example: limit=20

Items per page

plan_id
string
Example: plan_id=123e4567-e89b-12d3-a456-426614174000

Plan ID filter

Responses

Response samples

Content type
application/json
[
  • {
    }
]

(Admin) Create price

Authorizations:
None
Request Body schema: application/json
required
plan_id
required
string

Plan ID this price belongs to

currency
required
string

Currency code

unit_amount
required
number

Unit amount as decimal (e.g., 29.99)

interval
required
string
Enum: "ONE_TIME" "MONTH" "YEAR"

Billing interval

seat_included
number
Default: 1

Number of seats included in this price

external_id
string

External provider ID

active
boolean
Default: true

Whether the price is active

Responses

Request samples

Content type
application/json
{
  • "plan_id": "123e4567-e89b-12d3-a456-426614174000",
  • "currency": "usd",
  • "unit_amount": 29.99,
  • "interval": "MONTH",
  • "seat_included": 5,
  • "external_id": "price_1234567890",
  • "active": true
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "plan_id": "string",
  • "currency": "string",
  • "unit_amount": 0,
  • "interval": "ONE_TIME",
  • "seat_included": 0,
  • "external_id": "string",
  • "active": true,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "plan": { }
}

(Admin) Get price by ID

Authorizations:
None
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "plan_id": "string",
  • "currency": "string",
  • "unit_amount": 0,
  • "interval": "ONE_TIME",
  • "seat_included": 0,
  • "external_id": "string",
  • "active": true,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "plan": { }
}

(Admin) Update price

Authorizations:
None
path Parameters
id
required
string
Request Body schema: application/json
required
plan_id
string

Plan ID this price belongs to

currency
string

Currency code

unit_amount
number

Unit amount as decimal (e.g., 29.99)

interval
string
Enum: "ONE_TIME" "MONTH" "YEAR"

Billing interval

seat_included
number
Default: 1

Number of seats included in this price

external_id
string

External provider ID

active
boolean
Default: true

Whether the price is active

Responses

Request samples

Content type
application/json
{
  • "plan_id": "123e4567-e89b-12d3-a456-426614174000",
  • "currency": "usd",
  • "unit_amount": 29.99,
  • "interval": "MONTH",
  • "seat_included": 5,
  • "external_id": "price_1234567890",
  • "active": true
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "plan_id": "string",
  • "currency": "string",
  • "unit_amount": 0,
  • "interval": "ONE_TIME",
  • "seat_included": 0,
  • "external_id": "string",
  • "active": true,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "plan": { }
}

(Admin) Delete price

Authorizations:
None
path Parameters
id
required
string

Responses

(Admin) Get all orders (bypass RLS)

Authorizations:
None
query Parameters
page
number
Default: 1
Example: page=1

Page number

limit
number
Default: 20
Example: limit=20

Items per page

status
string
Enum: "PENDING" "REQUIRES_ACTION" "SUCCEEDED" "CANCELED" "REFUNDED"

Order status filter

provider
string
Enum: "STRIPE" "PAYPAL" "FUSIONPAY"

Payment provider filter

tenant_id
string
Example: tenant_id=123e4567-e89b-12d3-a456-426614174000

Tenant ID filter

Responses

Response samples

Content type
application/json
[
  • {
    }
]

(Admin) Get order by ID (bypass RLS)

Authorizations:
None
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "123e4567-e89b-12d3-a456-426614174000",
  • "tenant_id": "123e4567-e89b-12d3-a456-426614174001",
  • "payer_user_id": "123e4567-e89b-12d3-a456-426614174002",
  • "provider": "STRIPE",
  • "provider_intent_id": "pi_1234567890abcdef",
  • "status": "SUCCEEDED",
  • "amount": 2999,
  • "currency": "usd",
  • "description": "Pro plan subscription",
  • "metadata": {
    },
  • "created_at": "2024-01-01T00:00:00.000Z",
  • "updated_at": "2024-01-01T00:00:00.000Z"
}

(Admin) Get all subscriptions (bypass RLS)

Authorizations:
None
query Parameters
page
number
Default: 1
Example: page=1

Page number

limit
number
Default: 20
Example: limit=20

Items per page

status
string
Enum: "PENDING" "ACTIVE" "PAST_DUE" "CANCELED"

Subscription status filter

tenant_id
string
Example: tenant_id=123e4567-e89b-12d3-a456-426614174000

Tenant ID filter

Responses

Response samples

Content type
application/json
[
  • {
    }
]

(Admin) Get subscription by ID (bypass RLS)

Authorizations:
None
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "123e4567-e89b-12d3-a456-426614174000",
  • "tenant_id": "123e4567-e89b-12d3-a456-426614174001",
  • "payer_user_id": "123e4567-e89b-12d3-a456-426614174002",
  • "plan_id": "123e4567-e89b-12d3-a456-426614174003",
  • "plan": {
    },
  • "provider": "STRIPE",
  • "provider_sub_id": "sub_1234567890abcdef",
  • "status": "ACTIVE",
  • "seatCount": 5,
  • "current_period_start": "2024-01-01T00:00:00.000Z",
  • "current_period_end": "2024-02-01T00:00:00.000Z",
  • "cancel_at_period_end": false,
  • "created_at": "2024-01-01T00:00:00.000Z",
  • "updated_at": "2024-01-01T00:00:00.000Z"
}

(Admin) Get all invoices (bypass RLS)

Authorizations:
None
query Parameters
page
number
Default: 1
Example: page=1

Page number

limit
number
Default: 20
Example: limit=20

Items per page

status
string
Enum: "DRAFT" "OPEN" "PAID" "VOID"

Invoice status filter

tenant_id
string
Example: tenant_id=123e4567-e89b-12d3-a456-426614174000

Tenant ID filter

Responses

Response samples

Content type
application/json
[
  • {
    }
]

(Admin) Get invoice by ID (bypass RLS)

Authorizations:
None
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "123e4567-e89b-12d3-a456-426614174000",
  • "tenant_id": "123e4567-e89b-12d3-a456-426614174001",
  • "subscription_id": "123e4567-e89b-12d3-a456-426614174002",
  • "subscription": {
    },
  • "provider": "STRIPE",
  • "provider_invoice_id": "in_1234567890abcdef",
  • "total": 2999,
  • "status": "PAID",
  • "due_date": "2024-01-31T23:59:59.000Z",
  • "created_at": "2024-01-01T00:00:00.000Z",
  • "updated_at": "2024-01-01T00:00:00.000Z"
}

(Admin) Get all entitlements (bypass RLS)

Authorizations:
None
query Parameters
page
number
Default: 1
Example: page=1

Page number

limit
number
Default: 20
Example: limit=20

Items per page

tenant_id
string
Example: tenant_id=123e4567-e89b-12d3-a456-426614174000

Tenant ID filter

feature_key
string
Example: feature_key=hr

Feature key filter

Responses

Response samples

Content type
application/json
[
  • {
    }
]

(Admin) Get entitlement by ID (bypass RLS)

Authorizations:
None
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "123e4567-e89b-12d3-a456-426614174000",
  • "tenant_id": "123e4567-e89b-12d3-a456-426614174001",
  • "feature_key": "analytics",
  • "valid_from": "2024-01-01T00:00:00.000Z",
  • "valid_to": "2024-12-31T23:59:59.000Z",
  • "seat_limit": 10,
  • "usage_count": 5
}

(Admin) Get all stripe events (bypass RLS)

Authorizations:
None
query Parameters
page
number
Default: 1
Example: page=1

Page number

limit
number
Default: 20
Example: limit=20

Items per page

type
string
Example: type=invoice.payment_succeeded

Event type filter

processed
boolean
Example: processed=true

Processed status filter

tenant_id
string
Example: tenant_id=123e4567-e89b-12d3-a456-426614174000

Tenant ID filter

Responses

Response samples

Content type
application/json
[
  • {
    }
]

(Admin) Get stripe event by ID (bypass RLS)

Authorizations:
None
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "evt_1234567890abcdef",
  • "tenant_id": "123e4567-e89b-12d3-a456-426614174001",
  • "type": "customer.subscription.created",
  • "api_version": "2020-08-27",
  • "payload": {
    },
  • "context": "Authentication context for the event",
  • "processed": true,
  • "retries": 0,
  • "created": 1640995200,
  • "processed_at": "2024-01-01T00:00:00.000Z",
  • "received_at": "2024-01-01T00:00:00.000Z"
}