Billing
Every /v1 route for billing. This page is generated from the API's OpenAPI contract, so it always matches what the API accepts and returns.
Authentication, pagination, errors and idempotency work the same on every route. They are described once, in the API overview.
One invoice with its line items
GET /v1/invoices/{invoiceId}
Key scopes: READ and PLATFORM_API.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
invoiceId | string | yes | The invoice's id. |
Returns
200withV1InvoiceView.
bash
curl "https://api.naijacloud.com/v1/invoices/$INVOICE_ID" \
-H "Authorization: Bearer $NC_API_KEY"The wallet balance paid services run on, in kobo
GET /v1/workspaces/{workspaceId}/balance
Key scopes: READ and PLATFORM_API.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
workspaceId | string | yes | The workspace's id. |
Returns
200withV1WalletBalance.
bash
curl "https://api.naijacloud.com/v1/workspaces/$WORKSPACE_ID/balance" \
-H "Authorization: Bearer $NC_API_KEY"A workspace's monthly invoices, newest first
GET /v1/workspaces/{workspaceId}/invoices
Key scopes: READ and PLATFORM_API.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
workspaceId | string | yes | The workspace's id. |
Query parameters
| Name | Type | Required | Notes |
|---|---|---|---|
limit | integer | no | Rows per page. Ignored when a cursor is given. |
cursor | string | no | The nextCursor of the previous page, unchanged. |
Returns
200with a page:{ data: V1InvoiceView[], nextCursor }, where each item isV1InvoiceView.
bash
curl "https://api.naijacloud.com/v1/workspaces/$WORKSPACE_ID/invoices" \
-H "Authorization: Bearer $NC_API_KEY"This month's metered usage against the free allowances
GET /v1/workspaces/{workspaceId}/usage
Key scopes: READ and PLATFORM_API.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
workspaceId | string | yes | The workspace's id. |
Returns
200withV1WorkspaceUsageMeters.
bash
curl "https://api.naijacloud.com/v1/workspaces/$WORKSPACE_ID/usage" \
-H "Authorization: Bearer $NC_API_KEY"Types
V1InvoiceLineItemView
| Field | Type | Notes |
|---|---|---|
amountKobo | number | |
category | ANALYTICS, BANDWIDTH, CACHE, COMPUTE, DATABASE, EMAIL, PREVIEW, STORAGE | |
description | string | |
hours | number | |
id | string |
V1InvoiceView
| Field | Type | Notes |
|---|---|---|
code | string | |
creditKobo | number | |
debitedKobo | number | |
id | string | |
issuedAt | string (date-time) | |
lineItems | array of V1InvoiceLineItemView | |
number | integer | |
periodEnd | string (date-time) | |
periodStart | string (date-time) | |
status | OPEN, PAID, VOID | |
totalKobo | number | |
unbilledKobo | number | |
usageKobo | number |
V1WalletBalance
| Field | Type | Notes |
|---|---|---|
balanceMinor | number | |
currency | string | |
low | boolean | |
lowBalanceThresholdMinor | number |
V1WorkspaceUsageMeters
| Field | Type | Notes |
|---|---|---|
bandwidthAllowanceBytes | number, or null | |
bandwidthBytes | number, or null | |
computeAllowanceHours | number, or null | |
computeHours | number | |
databaseAllowanceBytes | number, or null | |
databaseBytes | number | |
storageAllowanceBytes | number, or null | |
storageBytes | number |