NNO Docs
API ReferenceBilling

NNO Billing Service API

Billing, subscriptions, payments, and usage metering for the NNO platform.

Get active subscription for a platform

GET
/api/billing/subscription

Query Parameters

platformId*string
Length1 <= length

Response Body

application/json

application/json

application/json

curl -X GET "https://billing.svc.nno.app/api/billing/subscription?platformId=string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Reserved for future use

POST
/api/billing/subscription

Response Body

application/json

curl -X POST "https://billing.svc.nno.app/api/billing/subscription"
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Cancel subscription at period end

POST
/api/billing/subscription/cancel

Response Body

application/json

application/json

application/json

curl -X POST "https://billing.svc.nno.app/api/billing/subscription/cancel"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Upgrade or downgrade subscription tier

POST
/api/billing/subscription/change-tier

Request Body

application/json

tier*string
Value in"starter" | "growth" | "scale"

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://billing.svc.nno.app/api/billing/subscription/change-tier" \  -H "Content-Type: application/json" \  -d '{    "tier": "starter"  }'
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Preview proration before changing tier

GET
/api/billing/subscription/proration-preview

Query Parameters

tier*string
Value in"starter" | "growth" | "scale"

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://billing.svc.nno.app/api/billing/subscription/proration-preview?tier=starter"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Get current usage snapshot

GET
/api/billing/usage/current

Query Parameters

platformId*string
Length1 <= length
tenantId?string

Response Body

application/json

application/json

application/json

curl -X GET "https://billing.svc.nno.app/api/billing/usage/current?platformId=string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Get paginated usage history

GET
/api/billing/usage/history

Query Parameters

limit?number
Default25
Range1 <= value <= 100
cursor?string
tenantId?string

Response Body

application/json

application/json

application/json

curl -X GET "https://billing.svc.nno.app/api/billing/usage/history"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

List distinct tenant IDs with usage data

GET
/api/billing/usage/entities

Query Parameters

limit?number
Default25
Range1 <= value <= 100
cursor?string

Response Body

application/json

application/json

application/json

curl -X GET "https://billing.svc.nno.app/api/billing/usage/entities"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

List invoices (cursor-paginated)

GET
/api/billing/invoices

Query Parameters

platformId*string
Length1 <= length
cursor?string

Response Body

application/json

application/json

application/json

curl -X GET "https://billing.svc.nno.app/api/billing/invoices?platformId=string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Get a single Stripe invoice with line items

GET
/api/billing/invoices/{id}

Path Parameters

id*string

Response Body

application/json

application/json

application/json

curl -X GET "https://billing.svc.nno.app/api/billing/invoices/string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

List payment methods for the platform's customer

GET
/api/billing/payment-methods

Response Body

application/json

application/json

application/json

curl -X GET "https://billing.svc.nno.app/api/billing/payment-methods"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Create a Stripe SetupIntent for payment method collection

POST
/api/billing/setup-intent

Response Body

application/json

application/json

application/json

curl -X POST "https://billing.svc.nno.app/api/billing/setup-intent"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Create a Stripe Customer Portal session

POST
/api/billing/portal

Request Body

application/json

returnUrl*string
Formaturi

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://billing.svc.nno.app/api/billing/portal" \  -H "Content-Type: application/json" \  -d '{    "returnUrl": "http://example.com"  }'
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Get a single invoice with line items

GET
/api/billing/invoices/{invoiceId}

Path Parameters

invoiceId*string

Query Parameters

platformId*string
Length1 <= length

Response Body

application/json

application/json

application/json

curl -X GET "https://billing.svc.nno.app/api/billing/invoices/string?platformId=string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Get daily usage time-series

GET
/api/billing/usage/daily

Query Parameters

platformId*string
Length1 <= length
tenantId?string
from*string
Match^\d{4}-\d{2}-\d{2}$
to*string
Match^\d{4}-\d{2}-\d{2}$

Response Body

application/json

application/json

curl -X GET "https://billing.svc.nno.app/api/billing/usage/daily?platformId=string&from=string&to=string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Get active usage alerts

GET
/api/billing/usage/alerts

Query Parameters

platformId*string
Length1 <= length

Response Body

application/json

application/json

curl -X GET "https://billing.svc.nno.app/api/billing/usage/alerts?platformId=string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Get active subscription for a platform

GET
/subscription

Query Parameters

platformId*string
Length1 <= length

Response Body

application/json

application/json

application/json

curl -X GET "https://billing.svc.nno.app/subscription?platformId=string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Reserved for future use

POST
/subscription

Response Body

application/json

curl -X POST "https://billing.svc.nno.app/subscription"
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Cancel subscription at period end

POST
/subscription/cancel

Response Body

application/json

application/json

application/json

curl -X POST "https://billing.svc.nno.app/subscription/cancel"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Upgrade or downgrade subscription tier

POST
/subscription/change-tier

Request Body

application/json

tier*string
Value in"starter" | "growth" | "scale"

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://billing.svc.nno.app/subscription/change-tier" \  -H "Content-Type: application/json" \  -d '{    "tier": "starter"  }'
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Preview proration before changing tier

GET
/subscription/proration-preview

Query Parameters

tier*string
Value in"starter" | "growth" | "scale"

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://billing.svc.nno.app/subscription/proration-preview?tier=starter"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Get current usage snapshot

GET
/usage/current

Query Parameters

platformId*string
Length1 <= length
tenantId?string

Response Body

application/json

application/json

application/json

curl -X GET "https://billing.svc.nno.app/usage/current?platformId=string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Get paginated usage history

GET
/usage/history

Query Parameters

limit?number
Default25
Range1 <= value <= 100
cursor?string
tenantId?string

Response Body

application/json

application/json

application/json

curl -X GET "https://billing.svc.nno.app/usage/history"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

List distinct tenant IDs with usage data

GET
/usage/entities

Query Parameters

limit?number
Default25
Range1 <= value <= 100
cursor?string

Response Body

application/json

application/json

application/json

curl -X GET "https://billing.svc.nno.app/usage/entities"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

List invoices (cursor-paginated)

GET
/invoices

Query Parameters

platformId*string
Length1 <= length
cursor?string

Response Body

application/json

application/json

application/json

curl -X GET "https://billing.svc.nno.app/invoices?platformId=string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Get a single Stripe invoice with line items

GET
/invoices/{id}

Path Parameters

id*string

Response Body

application/json

application/json

application/json

curl -X GET "https://billing.svc.nno.app/invoices/string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

List payment methods for the platform's customer

GET
/payment-methods

Response Body

application/json

application/json

application/json

curl -X GET "https://billing.svc.nno.app/payment-methods"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Create a Stripe SetupIntent for payment method collection

POST
/setup-intent

Response Body

application/json

application/json

application/json

curl -X POST "https://billing.svc.nno.app/setup-intent"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Create a Stripe Customer Portal session

POST
/portal

Request Body

application/json

returnUrl*string
Formaturi

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://billing.svc.nno.app/portal" \  -H "Content-Type: application/json" \  -d '{    "returnUrl": "http://example.com"  }'
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Get a single invoice with line items

GET
/invoices/{invoiceId}

Path Parameters

invoiceId*string

Query Parameters

platformId*string
Length1 <= length

Response Body

application/json

application/json

application/json

curl -X GET "https://billing.svc.nno.app/invoices/string?platformId=string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Get daily usage time-series

GET
/usage/daily

Query Parameters

platformId*string
Length1 <= length
tenantId?string
from*string
Match^\d{4}-\d{2}-\d{2}$
to*string
Match^\d{4}-\d{2}-\d{2}$

Response Body

application/json

application/json

curl -X GET "https://billing.svc.nno.app/usage/daily?platformId=string&from=string&to=string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Get active usage alerts

GET
/usage/alerts

Query Parameters

platformId*string
Length1 <= length

Response Body

application/json

application/json

curl -X GET "https://billing.svc.nno.app/usage/alerts?platformId=string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Apply a credit to a customer

POST
/operator/credits

Request Body

application/json

customerId*string
Length1 <= length
amount*number
Range0 < value
currency?string
Default"usd"
Length3 <= length <= 3
description*string
Length1 <= length

Response Body

application/json

application/json

application/json

curl -X POST "https://billing.svc.nno.app/operator/credits" \  -H "Content-Type: application/json" \  -d '{    "customerId": "string",    "amount": 0,    "description": "string"  }'
null
null
null

Generate and finalize an invoice for a customer

POST
/operator/invoices/generate

Request Body

application/json

customerId*string
Length1 <= length
description?string

Response Body

application/json

application/json

application/json

curl -X POST "https://billing.svc.nno.app/operator/invoices/generate" \  -H "Content-Type: application/json" \  -d '{    "customerId": "string"  }'
null
null
null

Override subscription plan tier or trial end

PATCH
/operator/subscriptions/{id}/override

Path Parameters

id*string

Request Body

application/json

planTier?string
trialEnd?number

Response Body

application/json

application/json

application/json

curl -X PATCH "https://billing.svc.nno.app/operator/subscriptions/string/override" \  -H "Content-Type: application/json" \  -d '{}'
null
null
null

Start a trial for a subscription

POST
/operator/subscriptions/{id}/trial

Path Parameters

id*string

Request Body

application/json

trialDays*integer
Range0 < value <= 365

Response Body

application/json

application/json

application/json

curl -X POST "https://billing.svc.nno.app/operator/subscriptions/string/trial" \  -H "Content-Type: application/json" \  -d '{    "trialDays": 365  }'
null
null
null

Get billing overview (MRR, active platforms, trials)

GET
/operator/overview

Response Body

application/json

application/json

curl -X GET "https://billing.svc.nno.app/operator/overview"
null
null

List available billing plans

GET
/plans

Response Body

application/json

curl -X GET "https://billing.svc.nno.app/plans"
[
  null
]

Create a Stripe customer

POST
/customers

Request Body

application/json

email*string
Formatemail
name?string
metadata?

Response Body

application/json

application/json

application/json

curl -X POST "https://billing.svc.nno.app/customers" \  -H "Content-Type: application/json" \  -d '{    "email": "user@example.com"  }'
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Get a Stripe customer

GET
/customers/{id}

Path Parameters

id*string

Response Body

application/json

application/json

curl -X GET "https://billing.svc.nno.app/customers/string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Update a Stripe customer

PATCH
/customers/{id}

Path Parameters

id*string

Request Body

application/json

email?string
Formatemail
name?string
metadata?

Response Body

application/json

application/json

application/json

curl -X PATCH "https://billing.svc.nno.app/customers/string" \  -H "Content-Type: application/json" \  -d '{}'
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

List subscriptions for a customer

GET
/customers/{id}/subscriptions

Path Parameters

id*string

Response Body

application/json

application/json

curl -X GET "https://billing.svc.nno.app/customers/string/subscriptions"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

List payment methods for a customer

GET
/customers/{id}/payment-methods

Path Parameters

id*string

Query Parameters

type?string

Response Body

application/json

application/json

curl -X GET "https://billing.svc.nno.app/customers/string/payment-methods"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Get the default payment method for a customer

GET
/customers/{id}/payment-methods/default

Path Parameters

id*string

Response Body

application/json

application/json

curl -X GET "https://billing.svc.nno.app/customers/string/payment-methods/default"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Create a Stripe subscription

POST
/subscriptions

Request Body

application/json

userId*string
Length1 <= length
priceId*string
Length1 <= length
paymentMethodId*string
Length1 <= length
quantity?integer
Range0 < value
metadata?

Response Body

application/json

application/json

application/json

curl -X POST "https://billing.svc.nno.app/subscriptions" \  -H "Content-Type: application/json" \  -d '{    "userId": "string",    "priceId": "string",    "paymentMethodId": "string"  }'
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Get a subscription

GET
/subscriptions/{id}

Path Parameters

id*string

Response Body

application/json

application/json

curl -X GET "https://billing.svc.nno.app/subscriptions/string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Update a subscription

PATCH
/subscriptions/{id}

Path Parameters

id*string

Request Body

application/json

priceId?string
Length1 <= length
quantity?integer
Range0 < value
paymentMethodId?string
Length1 <= length
cancelAtPeriodEnd?boolean

Response Body

application/json

application/json

application/json

curl -X PATCH "https://billing.svc.nno.app/subscriptions/string" \  -H "Content-Type: application/json" \  -d '{}'
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Cancel a subscription

DELETE
/subscriptions/{id}

Path Parameters

id*string

Query Parameters

immediately?string

Response Body

application/json

application/json

curl -X DELETE "https://billing.svc.nno.app/subscriptions/string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Attach a payment method to a customer

POST
/payment-methods/{id}/attach

Path Parameters

id*string

Request Body

application/json

customerId*string
Length1 <= length
setAsDefault?boolean

Response Body

application/json

application/json

application/json

curl -X POST "https://billing.svc.nno.app/payment-methods/string/attach" \  -H "Content-Type: application/json" \  -d '{    "customerId": "string"  }'
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Detach a payment method

POST
/payment-methods/{id}/detach

Path Parameters

id*string

Response Body

application/json

application/json

curl -X POST "https://billing.svc.nno.app/payment-methods/string/detach"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Get a payment method

GET
/payment-methods/{id}

Path Parameters

id*string

Response Body

application/json

application/json

curl -X GET "https://billing.svc.nno.app/payment-methods/string"
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}

Set a payment method as default

POST
/payment-methods/{id}/set-default

Path Parameters

id*string

Request Body

application/json

customerId*string
Length1 <= length

Response Body

application/json

application/json

application/json

curl -X POST "https://billing.svc.nno.app/payment-methods/string/set-default" \  -H "Content-Type: application/json" \  -d '{    "customerId": "string"  }'
null
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "requestId": "string",
    "details": null
  }
}