Fianu Labs Billing API
The billing API from Fianu Labs, for billing.
The billing API from Fianu Labs, for billing.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/fianu-labs:fianu-labs-billing-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
description: 'Fianu Labs offers powerful APIs that simplify and automate governance processes.
With our flexible and customizable APIs, you can easily create, manage, and monitor governance policies, access real-time data and analytics, and automate repetitive tasks.
Let us help you streamline your governance processes and achieve your business objectives.'
title: Fianu Billing API
contact:
name: Fianu Labs
url: https://fianu.io
email: support@fianu.io
version: 1.0.0
servers:
- url: https://app.fianu.io/api
security:
- BearerToken: []
tags:
- name: Billing
paths:
/billing/licenses:
get:
description: Lists licenses for the tenant
tags:
- Billing
summary: List licenses
operationId: list_licenses
parameters:
- description: Filter by tenant ID
name: tenantId
in: query
schema:
type: string
format: uuid
responses:
'200':
description: List of licenses
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/license'
'400':
description: Bad request
'500':
description: Internal server error
post:
description: Creates a new license
tags:
- Billing
summary: Create license
operationId: create_license
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/createLicenseRequest'
description: License creation request
required: true
responses:
'201':
description: Created license
content:
application/json:
schema:
$ref: '#/components/schemas/license'
'400':
description: Bad request
'500':
description: Internal server error
/billing/licenses/{licenseId}:
get:
description: Fetches a license by ID
tags:
- Billing
summary: Fetch license
operationId: fetch_license
parameters:
- description: License UUID
name: licenseId
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: License details
content:
application/json:
schema:
$ref: '#/components/schemas/license'
'404':
description: License not found
'500':
description: Internal server error
patch:
description: Updates an existing license
tags:
- Billing
summary: Update license
operationId: update_license
parameters:
- description: License UUID
name: licenseId
in: path
required: true
schema:
type: string
format: uuid
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/updateLicenseRequest'
description: License update request
required: true
responses:
'200':
description: Updated license
content:
application/json:
schema:
$ref: '#/components/schemas/license'
'400':
description: Bad request
'404':
description: License not found
'500':
description: Internal server error
/billing/licenses/{licenseId}/invoices:
get:
description: Lists invoices from Stripe for a license's payment channel
tags:
- Billing
summary: List invoices
operationId: list_invoices
parameters:
- description: License UUID
name: licenseId
in: path
required: true
schema:
type: string
format: uuid
- description: Filter by invoice status (draft, open, paid, uncollectible, void)
name: status
in: query
schema:
type: string
- description: Maximum number of invoices to return
name: limit
in: query
schema:
type: string
default: 10
- description: Pagination cursor (invoice ID to start after)
name: starting_after
in: query
schema:
type: string
- description: Filter invoices created after this timestamp (RFC3339)
name: created_after
in: query
schema:
type: string
format: date-time
- description: Filter invoices created before this timestamp (RFC3339)
name: created_before
in: query
schema:
type: string
format: date-time
responses:
'200':
description: List of invoices from Stripe
content:
application/json:
schema:
type: array
items:
type: object
'400':
description: Bad request
'404':
description: License not found
'500':
description: Internal server error
/billing/licenses/{licenseId}/invoices/upcoming:
get:
description: Retrieves the upcoming invoice preview from Stripe
tags:
- Billing
summary: Get upcoming invoice
operationId: upcoming_invoice
parameters:
- description: License UUID
name: licenseId
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Upcoming invoice preview from Stripe
content:
application/json:
schema:
type: object
'400':
description: Bad request
'404':
description: License not found or no upcoming invoice
'500':
description: Internal server error
/billing/licenses/{licenseId}/invoices/{invoiceId}:
get:
description: Retrieves a specific invoice from Stripe
tags:
- Billing
summary: Fetch invoice
operationId: fetch_invoice
parameters:
- description: License UUID
name: licenseId
in: path
required: true
schema:
type: string
format: uuid
- description: Stripe invoice ID
name: invoiceId
in: path
required: true
schema:
type: string
responses:
'200':
description: Invoice from Stripe
content:
application/json:
schema:
type: object
'400':
description: Bad request
'404':
description: License or invoice not found
'500':
description: Internal server error
/billing/licenses/{licenseId}/usage/monthly-averages:
get:
description: All data is fetched directly from Stripe (pass-through model).
tags:
- Billing
summary: Get monthly averages
operationId: license_usage_monthly_averages
parameters:
- description: License UUID
name: licenseId
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Monthly averages from last 12 months of paid invoices
content:
application/json:
schema:
$ref: '#/components/schemas/monthlyAveragesResponse'
'400':
description: Bad request
'404':
description: License not found or no payment channel configured
'500':
description: Internal server error
/billing/licenses/{licenseId}/usage/ytd-summary:
get:
description: 'YTD start date is derived from Stripe subscription start date.
All data is fetched directly from Stripe (pass-through model).'
tags:
- Billing
summary: Get YTD summary
operationId: license_usage_ytd_summary
parameters:
- description: License UUID
name: licenseId
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Year-to-date summary with monthly breakdown and forecast
content:
application/json:
schema:
$ref: '#/components/schemas/ytdSummaryResponse'
'400':
description: Bad request
'404':
description: License not found or no active subscription
'500':
description: Internal server error
/billing/report-invoice:
post:
description: 'Supported marketplaces: Azure, GCP, AWS'
tags:
- Billing
summary: Report invoice to marketplace
operationId: report_invoice_to_marketplace
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/reportInvoiceRequest'
description: Invoice reporting request
required: true
responses:
'200':
description: Invoice reported successfully (or already reported)
content:
application/json:
schema:
$ref: '#/components/schemas/reportInvoiceResponse'
'400':
description: Bad request (invalid input or no marketplace configured)
'404':
description: License not found
'500':
description: Internal server error (marketplace API failure)
/billing/usage:
get:
description: 'Usage is tracked independently from Stripe billing periods - use since/until
parameters to filter by date range.'
tags:
- Billing
summary: List usage records
operationId: list_usage
parameters:
- description: Filter by specific attestation UUID
name: attestationUuid
in: query
schema:
type: string
format: uuid
- description: Filter by specific occurrence UUID
name: occurrenceUuid
in: query
schema:
type: string
format: uuid
- description: Filter by specific transaction UUID
name: transactionUuid
in: query
schema:
type: string
format: uuid
- description: Start date for occurred_at range (defaults to 90 days ago). Use RFC3339 format.
name: since
in: query
schema:
type: string
format: date-time
- description: End date for occurred_at range (defaults to now). Use RFC3339 format.
name: until
in: query
schema:
type: string
format: date-time
- description: Maximum number of results to return
name: limit
in: query
schema:
type: string
default: 100
- description: Number of results to skip for pagination
name: offset
in: query
schema:
type: string
default: 0
responses:
'200':
description: List of usage records
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/usage'
'400':
description: Bad request
'500':
description: Internal server error
/billing/usage/aggregate:
get:
description: Usage is tracked independently from Stripe billing periods - use since/until parameters to filter by date range.
tags:
- Billing
summary: Aggregate usage counts
operationId: aggregate_usage
parameters:
- description: Start date for occurred_at range (defaults to 90 days ago). Use RFC3339 format.
name: since
in: query
schema:
type: string
format: date-time
- description: End date for occurred_at range (defaults to now). Use RFC3339 format.
name: until
in: query
schema:
type: string
format: date-time
responses:
'200':
description: Aggregated usage counts by note type
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/usageAggregate'
'400':
description: Bad request
'500':
description: Internal server error
components:
schemas:
AzureConfig:
description: 'Note: ClientSecret is NOT stored in this struct for security reasons.
It must be provided via AZURE_MARKETPLACE_CLIENT_SECRET environment variable.'
type: object
title: 'AzureConfig holds Azure-specific marketplace fields.
Required for Azure Marketplace Metering API.'
properties:
client_id:
description: ClientID is the Azure AD application (client) ID registered in Partner Center
type: string
x-go-name: ClientID
dimension:
description: Dimension is the metering dimension name (e.g., "dollar_spend")
type: string
x-go-name: Dimension
plan_id:
description: PlanID is the Azure marketplace plan identifier
type: string
x-go-name: PlanID
resource_id:
description: ResourceID is the Azure resource ID for metering API calls
type: string
x-go-name: ResourceID
subscription_id:
description: SubscriptionID is the Azure marketplace subscription ID (from webhook)
type: string
x-go-name: SubscriptionID
tenant_id:
description: TenantID is the Azure AD tenant ID for authentication
type: string
x-go-name: TenantID
x-go-package: github.com/fianulabs/core/v2/pkg/billing/marketplace
monthlyAveragesResponse:
type: object
properties:
avgMonthlyAttestations:
description: avgMonthlyAttestations is the average attestation count per month over the subscription period
type: number
format: double
x-go-name: AvgMonthlyAttestations
avgMonthlyControls:
description: avgMonthlyControls is the average distinct control count per month over the subscription period
type: number
format: double
x-go-name: AvgMonthlyControls
avgMonthlyOccurrences:
description: avgMonthlyOccurrences is the average occurrence count per month over the subscription period
type: number
format: double
x-go-name: AvgMonthlyOccurrences
avgMonthlyTotal:
description: avgMonthlyTotal is the average invoice total per month in dollars
type: number
format: double
x-go-name: AverageMonthlyTotal
newestInvoiceDate:
description: newestInvoiceDate is the latest invoice date (RFC3339)
type: string
x-go-name: NewestInvoiceDate
oldestInvoiceDate:
description: oldestInvoiceDate is the earliest invoice date (RFC3339)
type: string
x-go-name: OldestInvoiceDate
periodMonths:
description: periodMonths is the number of months covered by the invoices
type: integer
format: int64
x-go-name: PeriodMonths
totalInvoiceCount:
description: totalInvoiceCount is the number of paid invoices in the period
type: integer
format: int64
x-go-name: TotalInvoiceCount
totalSpend:
description: totalSpend is the total amount spent in the period in dollars
type: number
format: double
x-go-name: TotalSpend
x-go-name: MonthlyAveragesResponse
x-go-package: github.com/fianulabs/core/v2/external/transport/http/v1
licensePaymentChannelUpdate:
type: object
properties:
id:
description: id is the payment channel identifier (e.g., Stripe customer ID)
type: string
x-go-name: ID
provider:
$ref: '#/components/schemas/PaymentChannelProvider'
x-go-name: PaymentChannelUpdate
x-go-package: github.com/fianulabs/core/v2/external/transport/http/v1
monthlyDataPoint:
type: object
properties:
amount:
description: amount is the invoice total in dollars
type: number
format: double
x-go-name: Amount
isCurrentEstimate:
description: isCurrentEstimate indicates if this is the current month estimate
type: boolean
x-go-name: IsCurrentEstimate
isForecast:
description: isForecast indicates if this is a forecasted value
type: boolean
x-go-name: IsForecast
month:
description: month is the calendar month (1-12)
type: integer
format: int64
x-go-name: Month
year:
description: year is the calendar year
type: integer
format: int64
x-go-name: Year
x-go-name: MonthlyDataPoint
x-go-package: github.com/fianulabs/core/v2/external/transport/http/v1
MarketplaceProvider:
description: MarketplaceProvider identifies the cloud marketplace
type: string
x-go-package: github.com/fianulabs/core/v2/pkg/billing/marketplace
usageAggregate:
type: object
x-go-name: swagUsageAggregate
x-go-package: github.com/fianulabs/core/v2/server/consulta/routes
AWSConfig:
description: Required for AWS Marketplace Metering Service.
type: object
title: AWSConfig holds AWS-specific marketplace fields.
properties:
customer_identifier:
description: CustomerIdentifier is the AWS customer ID (from registration token)
type: string
x-go-name: CustomerIdentifier
product_code:
description: ProductCode is the AWS Marketplace product code
type: string
x-go-name: ProductCode
usage_dimension:
description: UsageDimension is the AWS metering dimension name (e.g., "dollar_spend")
type: string
x-go-name: UsageDimension
x-go-package: github.com/fianulabs/core/v2/pkg/billing/marketplace
GCPConfig:
description: Required for GCP Partner Procurement API.
type: object
title: GCPConfig holds GCP-specific marketplace fields.
properties:
entitlement_name:
description: 'EntitlementName is the full entitlement resource path
Format: providers/fianu/entitlements/{entitlement_id}'
type: string
x-go-name: EntitlementName
metric_id:
description: MetricId is the GCP Partner Procurement API metric ID
type: string
x-go-name: MetricId
x-go-package: github.com/fianulabs/core/v2/pkg/billing/marketplace
Config:
description: Stored as JSONB in licenses.marketplace column.
type: object
title: Config stores provider-specific marketplace configuration.
required:
- Args
- Description
- Documentation
- Entrypoint
- Env
- Interface
- IpcHost
- Linux
- Mounts
- Network
- PidHost
- PropagatedMount
- WorkDir
properties:
aws:
$ref: '#/components/schemas/AWSConfig'
azure:
$ref: '#/components/schemas/AzureConfig'
gcp:
$ref: '#/components/schemas/GCPConfig'
last_sync_at:
description: LastSyncAt tracks when usage was last synced to marketplace
type: string
format: date-time
x-go-name: LastSyncAt
last_sync_error:
description: LastSyncError stores the last sync error message (if any)
type: string
x-go-name: LastSyncError
provider:
$ref: '#/components/schemas/MarketplaceProvider'
x-go-package: github.com/fianulabs/core/v2/pkg/billing/marketplace
PaymentChannelProvider:
description: 'PaymentChannelProvider represents the payment channel/billing provider
CREATE TYPE payment_channel_provider AS ENUM (''stripe'');'
type: string
x-go-package: github.com/fianulabs/core/v2/external/db/variables
reportInvoiceRequest:
type: object
required:
- licenseId
- stripeInvoiceId
properties:
licenseId:
description: 'licenseId is the UUID of the license that owns this invoice.
The license must have a marketplace configuration.'
type: string
format: uuid
x-go-name: LicenseID
stripeInvoiceId:
description: 'stripeInvoiceId is the Stripe invoice ID (e.g., "inv_xxx").
The invoice must exist and be associated with the license''s Stripe customer.'
type: string
x-go-name: StripeInvoiceID
x-go-name: ReportInvoiceRequest
x-go-package: github.com/fianulabs/core/v2/external/transport/http/v1
updateLicenseRequest:
type: object
properties:
marketplace:
$ref: '#/components/schemas/Config'
payment:
$ref: '#/components/schemas/licensePaymentChannelUpdate'
x-go-name: UpdateLicenseRequest
x-go-package: github.com/fianulabs/core/v2/external/transport/http/v1
license:
description: 'License represents the API response model for a license
Links a tenant to a Stripe customer with optional marketplace configuration'
type: object
properties:
createdAt:
description: createdAt is the creation timestamp (RFC3339 format)
type: string
x-go-name: CreatedAt
licenseId:
description: licenseId is the unique license identifier
type: string
x-go-name: LicenseID
marketplace:
description: marketplace contains optional marketplace configuration as JSONB
type: object
x-go-name: Marketplace
paymentChannelId:
description: paymentChannelId is the payment provider customer ID (e.g., Stripe customer ID)
type: string
x-go-name: PaymentChannelID
paymentChannelProvider:
description: paymentChannelProvider is the payment provider type (e.g., "stripe")
type: string
x-go-name: PaymentChannelProvider
tenantId:
description: tenantId is the tenant UUID
type: string
x-go-name: TenantID
tenantOrganization:
description: tenantOrganization is the tenant organization name
type: string
x-go-name: TenantOrganization
updatedAt:
description: updatedAt is the last update timestamp (RFC3339 format)
type: string
x-go-name: UpdatedAt
x-go-name: License
x-go-package: github.com/fianulabs/core/v2/external/db/billing
createLicenseRequest:
type: object
properties:
marketplace:
$ref: '#/components/schemas/Config'
payment:
$ref: '#/components/schemas/licensePaymentChannel'
x-go-name: CreateLicenseRequest
x-go-package: github.com/fianulabs/core/v2/external/transport/http/v1
usage:
description: Usage represents the API-friendly usage record model
type: object
properties:
assetType:
type: string
x-go-name: AssetType
assetUuid:
type: string
x-go-name: AssetUUID
attestationUuid:
type: string
x-go-name: AttestationUUID
createdAt:
type: string
format: date-time
x-go-name: CreatedAt
entityId:
type: string
x-go-name: EntityID
entityType:
type: string
x-go-name: EntityType
hasAttestation:
type: boolean
x-go-name: HasAttestation
id:
type: integer
format: int64
x-go-name: ID
integrationEntityId:
type: string
x-go-name: IntegrationEntityID
integrationEntityType:
type: string
x-go-name: IntegrationEntityType
occurredAt:
type: string
format: date-time
x-go-name: OccurredAt
occurrenceUuid:
type: string
x-go-name: OccurrenceUUID
origination:
type: string
format: date-time
x-go-name: Origination
parentUuid:
type: string
x-go-name: ParentUUID
paymentChannelRecordedAt:
type: string
format: date-time
x-go-name: PaymentChannelRecordedAt
pluginEntityId:
type: string
x-go-name: PluginEntityID
pluginEntityType:
type: string
x-go-name: PluginEntityType
seriesCode:
type: integer
format: int64
x-go-name: SeriesCode
seriesId:
type: string
x-go-name: SeriesID
tenantId:
type: string
x-go-name: TenantID
transactionUuid:
type: string
x-go-name: TransactionUUID
unitDiscount:
type: string
x-go-name: UnitDiscount
unitPrice:
type: string
x-go-name: UnitPrice
x-go-name: Usage
x-go-package: github.com/fianulabs/core/v2/external/db/billing
licensePaymentChannel:
type: object
properties:
id:
description: id is the payment channel identifier (e.g., Stripe customer ID)
type: string
x-go-name: ID
provider:
$ref: '#/components/schemas/PaymentChannelProvider'
x-go-name: PaymentChannelInfo
x-go-package: github.com/fianulabs/core/v2/external/transport/http/v1
ytdSummaryResponse:
type: object
properties:
currentMonthEstimate:
$ref: '#/components/schemas/monthlyDataPoint'
forecastMonths:
description: forecastMonths contains forecast for remaining months of the calendar year
type: array
items:
$ref: '#/components/schemas/monthlyDataPoint'
x-go-name: ForecastMonths
licenseYearNumber:
description: licenseYearNumber is the license year number (1st year, 2nd year, etc.)
type: integer
format: int64
x-go-name: LicenseYearNumber
licenseYearStart:
description: licenseYearStart is the start of the current license year (RFC3339)
type: string
x-go-name: LicenseYearStart
monthlyBreakdown:
description: monthlyBreakdown contains all 12 months of the calendar year (Jan-Dec) with actual or zero values
type: array
items:
$ref: '#/components/schemas/monthlyDataPoint'
x-go-name: MonthlyBreakdown
totalYtd:
description: totalYtd is the total billed amount year-to-date in dollars
type: number
format: double
x-go-name: TotalYTD
x-go-name: YTDSummaryResponse
x-go-package: github.com/fianulabs/core/v2/external/transport/http/v1
reportInvoiceResponse:
type: object
properties:
alreadyReported:
description: 'alreadyReported indicates if this invoice was previously reported to the marketplace.
If true, no new report was created (idempotent behavior).'
type: boolean
x-go-name: AlreadyReported
recordId:
description: 'recordId is the marketplace''s unique identifier for this usage report.
Empty if alreadyReported is true.
Can be used for auditing and reconciliation.'
type: string
x-go-name: RecordID
x-go-name: ReportInvoiceResponse
x-go-package: github.com/fianulabs/core/v2/external/transport/http/v1
securitySchemes:
BearerToken:
description: JWT Bearer Token Auth
type: apiKey
name: Authentication
in: header
externalDocs:
description: Fianu Labs Documentation
url: https://docs.fianu.io
x-tagGroups:
- name: Authentication
tags:
- access_tokens
- name: Console
tags:
- collections
- controls
- domains
- policies
- environments
- targets
- gates
- indexes
- description: 'Every event that occurs throughout the software development lifecycle produces evidence. A Note represents a single piece of evidence. There are four types of Notes: Origin, Occurrence, Transaction, and Attestation. Each type varies in its traits and utility, but all Notes are digitally signed and stored in an immutable ledger where they can be queried on demand. If a query returns a Note that does not match its signature, it is considered untrusted and its evidence invalid. The following routes allow you to retrieve/display evidence Notes.'
name: Evidence
tags:
- evaluation
- ledger
- signatures
- evidence
- deployments
- notes
- events
- metrics
- name: Gating
tags:
- gating_check
- gating_enforce
- description: Integrations represent third-party tools and platforms that generate evidence for attestations. Integrations are designed to manage the third-party’s toolchain relationship with Fianu.
name: Integrations
tags:
- platforms
- plugins
- instances
- platform_types
- tools
- name: Assets
tags:
- assets
- accounts
- modules
- abstract_assets
- name: Inventory
tags:
- statistics
- sources
- description: Notification catalog, effective configuration, delivery channel integrations, and the user inbox.
name: Notifications
tags:
- notifications
- description: Team management, approval workflows, and account-level administration.
name: Administration
tags:
- team
- teams
- users
- tickets
- name: Server
tags:
- settings