Contents
Billing and usage
Subscription, invoices, the open usage period and the payment method.
Examples marked as generated are built from the schema with synthetic values.
- GETGet the subscription
/api/v2/billing/subscription - GETList invoices
/api/v2/billing/invoices - GETGet usage
/api/v2/usage - POSTPayment provider notifications
/api/v2/billing/providers/{provider}/webhooks - GETGet the payment method
/api/v2/billing/payment-method - POSTChange the payment method
/api/v2/billing/payment-method/update-session
/api/v2/billing/subscriptionGet the subscription
Returns the current subscription of the organization: plan, status, price and period.
- Authentication
- API token or portal session
- Required permission
billing.read
Responses
200OKapplication/json
Fields (14)
Responses getSubscription 200 Field Type Required Rules id string Yes - Pattern: ^sub_
plan object Yes plan.code string Yes plan.name string Yes status string Yes - One of: trialing, active, past_due, cancel_requested, cancelled, expired, legacy_unverified
price object Yes price.amount_minor string Yes - Pattern: ^-?[0-9]+$
price.currency string Yes - Pattern: ^[A-Z]{3}$
interval_days integer Yes included_bytes integer Yes - Format: int64
sites_limit integer Yes - Can be null
started_at string Yes - Format: date-time
current_period_ends_at string Yes - Format: date-time
- Can be null
next_refresh_at string Yes - Format: date-time
- Can be null
Example (generated from the schema) { "id": "sub_", "plan": { "code": "string", "name": "Example" }, "status": "trialing", "price": { "amount_minor": "0", "currency": "USD" }, "interval_days": 1, "included_bytes": 1, "sites_limit": 1, "started_at": "2026-01-15T10:00:00Z", "current_period_ends_at": "2026-01-15T10:00:00Z", "next_refresh_at": "2026-01-15T10:00:00Z" }401Unauthorizedapplication/problem+json
Headers: WWW-Authenticate
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/unauthenticated", "title": "Authentication required", "status": 401, "code": "unauthenticated", "request_id": "req_01EXAMPLE00000000000000000" }403Forbiddenapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/insufficient_scope", "title": "Insufficient permissions", "status": 403, "code": "insufficient_scope", "request_id": "req_01EXAMPLE00000000000000000" }404Not foundapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/not_found", "title": "Not found", "status": 404, "code": "not_found", "request_id": "req_01EXAMPLE00000000000000000" }
curl 'https://api.cdnify.lat/api/v2/billing/subscription' \
-H "Authorization: Bearer $CDNIFY_API_TOKEN"/api/v2/billing/invoicesList invoices
Returns the invoices of the organization, newest first.
- Authentication
- API token or portal session
- Required permission
billing.read
Parameters
| Name | In | Type | Required | Rules |
|---|---|---|---|---|
| limit | Query | integer | No |
|
| cursor | Query | string | No |
|
Responses
200OKapplication/json
Fields (13)
Responses listInvoices 200 Field Type Required Rules data array<object> Yes data[].id string Yes - Pattern: ^inv_
data[].provider string Yes data[].reference string Yes data[].type string Yes - One of: subscription, one_time, unknown
data[].status string Yes - One of: draft, open, paid, void, refunded
data[].amount object Yes data[].amount.amount_minor string Yes - Pattern: ^-?[0-9]+$
data[].amount.currency string Yes - Pattern: ^[A-Z]{3}$
data[].issued_at string Yes - Format: date-time
pagination object Yes pagination.next_cursor string Yes - Can be null
pagination.has_more boolean Yes Example (generated from the schema) { "data": [ { "id": "inv_", "provider": "string", "reference": "string", "type": "subscription", "status": "draft", "amount": { "amount_minor": "0", "currency": "USD" }, "issued_at": "2026-01-15T10:00:00Z" } ], "pagination": { "next_cursor": "string", "has_more": false } }400Bad requestapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/malformed_request", "title": "Malformed request", "status": 400, "code": "malformed_request", "request_id": "req_01EXAMPLE00000000000000000" }401Unauthorizedapplication/problem+json
Headers: WWW-Authenticate
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/unauthenticated", "title": "Authentication required", "status": 401, "code": "unauthenticated", "request_id": "req_01EXAMPLE00000000000000000" }403Forbiddenapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/insufficient_scope", "title": "Insufficient permissions", "status": 403, "code": "insufficient_scope", "request_id": "req_01EXAMPLE00000000000000000" }
curl 'https://api.cdnify.lat/api/v2/billing/invoices' \
-H "Authorization: Bearer $CDNIFY_API_TOKEN"/api/v2/usageGet usage
Returns the open usage period: bytes, requests, the limit and the active data blocks.
- Authentication
- API token or portal session
- Required permission
billing.read
Responses
200OKapplication/json
Fields (13)
Responses getUsage 200 Field Type Required Rules period_number integer Yes starts_at string Yes - Format: date-time
ends_at string Yes - Format: date-time
- Can be null
bytes_used integer Yes - Format: int64
bytes_limit integer Yes - Format: int64
- Can be null
requests_used integer Yes - Format: int64
metering_policy string Yes - One of: actual_bytes, uncached_multiplier, legacy_x4
metered_until string Yes - Format: date-time
- Can be null
blocks array<object> Yes blocks[].kind string Yes blocks[].bytes_limit integer Yes - Format: int64
blocks[].bytes_used integer Yes - Format: int64
blocks[].expires_at string Yes - Format: date-time
Example (generated from the schema) { "period_number": 1, "starts_at": "2026-01-15T10:00:00Z", "ends_at": "2026-01-15T10:00:00Z", "bytes_used": 1, "bytes_limit": 1, "requests_used": 1, "metering_policy": "actual_bytes", "metered_until": "2026-01-15T10:00:00Z", "blocks": [ { "kind": "string", "bytes_limit": 1, "bytes_used": 1, "expires_at": "2026-01-15T10:00:00Z" } ] }401Unauthorizedapplication/problem+json
Headers: WWW-Authenticate
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/unauthenticated", "title": "Authentication required", "status": 401, "code": "unauthenticated", "request_id": "req_01EXAMPLE00000000000000000" }403Forbiddenapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/insufficient_scope", "title": "Insufficient permissions", "status": 403, "code": "insufficient_scope", "request_id": "req_01EXAMPLE00000000000000000" }404Not foundapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/not_found", "title": "Not found", "status": 404, "code": "not_found", "request_id": "req_01EXAMPLE00000000000000000" }
curl 'https://api.cdnify.lat/api/v2/usage' \
-H "Authorization: Bearer $CDNIFY_API_TOKEN"/api/v2/billing/providers/{provider}/webhooksPayment provider notifications
Receives the notifications of the payment provider, authenticated by its signature. It is not called by customers.
- Authentication
- None
Parameters
| Name | In | Type | Required | Rules |
|---|---|---|---|---|
| provider | Path | string | Yes |
|
Request body
Content types: */*
Body: string
…Responses
202Acceptedapplication/json
Fields (2)
Responses receiveProviderWebhook 202 Field Type Required Rules event_id string Yes - Format: uuid
duplicate boolean Yes Example (generated from the schema) { "event_id": "00000000-0000-4000-8000-000000000000", "duplicate": false }400Bad requestapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/malformed_request", "title": "Malformed request", "status": 400, "code": "malformed_request", "request_id": "req_01EXAMPLE00000000000000000" }404Not foundapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/not_found", "title": "Not found", "status": 404, "code": "not_found", "request_id": "req_01EXAMPLE00000000000000000" }413Content too largeapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/payload_too_large", "title": "Request too large", "status": 413, "code": "payload_too_large", "request_id": "req_01EXAMPLE00000000000000000" }503Service unavailableapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/service_unavailable", "title": "Service unavailable", "status": 503, "code": "service_unavailable", "request_id": "req_01EXAMPLE00000000000000000" }
Called by a third party, not by customers. There is no curl example.
/api/v2/billing/payment-methodGet the payment method
Returns the details of the default payment method as the payment provider reports them. Card data is never returned.
- Authentication
- API token or portal session
- Required permission
billing.read
Responses
200OKapplication/json
Fields (6)
Responses getPaymentMethod 200 Field Type Required Rules provider string Yes kind string Yes - One of: card, paypal, other
brand string Yes - Can be null
last4 string Yes - Pattern: ^[0-9]{4}$
- Can be null
expires_on string Yes - Can be null
updated_at string Yes - Format: date-time
Example (generated from the schema) { "provider": "string", "kind": "card", "brand": "string", "last4": "0123", "expires_on": "string", "updated_at": "2026-01-15T10:00:00Z" }401Unauthorizedapplication/problem+json
Headers: WWW-Authenticate
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/unauthenticated", "title": "Authentication required", "status": 401, "code": "unauthenticated", "request_id": "req_01EXAMPLE00000000000000000" }403Forbiddenapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/insufficient_scope", "title": "Insufficient permissions", "status": 403, "code": "insufficient_scope", "request_id": "req_01EXAMPLE00000000000000000" }404Not foundapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/not_found", "title": "Not found", "status": 404, "code": "not_found", "request_id": "req_01EXAMPLE00000000000000000" }409Conflictapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/alias_in_use", "title": "Site name already in use", "status": 409, "code": "alias_in_use", "request_id": "req_01EXAMPLE00000000000000000" }422Unprocessable contentapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/validation_failed", "title": "Validation failed", "status": 422, "code": "validation_failed", "request_id": "req_01EXAMPLE00000000000000000" }
curl 'https://api.cdnify.lat/api/v2/billing/payment-method' \
-H "Authorization: Bearer $CDNIFY_API_TOKEN"/api/v2/billing/payment-method/update-sessionChange the payment method
Returns a page of the payment provider where the payment method is changed. No charge is made.
- Authentication
- API token or portal session
- Required permission
billing.manage
Responses
201Createdapplication/json
Headers: Cache-Control
Fields (3)
Responses createPaymentUpdateSession 201 Field Type Required Rules provider string Yes url string Yes - Format: uri
sandbox boolean Yes Example (generated from the schema) { "provider": "string", "url": "https://example.com/", "sandbox": false }401Unauthorizedapplication/problem+json
Headers: WWW-Authenticate
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/unauthenticated", "title": "Authentication required", "status": 401, "code": "unauthenticated", "request_id": "req_01EXAMPLE00000000000000000" }403Forbiddenapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/insufficient_scope", "title": "Insufficient permissions", "status": 403, "code": "insufficient_scope", "request_id": "req_01EXAMPLE00000000000000000" }409Conflictapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/alias_in_use", "title": "Site name already in use", "status": 409, "code": "alias_in_use", "request_id": "req_01EXAMPLE00000000000000000" }503Service unavailableapplication/problem+json
Error codes:
Problem details body
Example { "type": "https://www.cdnify.lat/docs/errors/service_unavailable", "title": "Service unavailable", "status": 503, "code": "service_unavailable", "request_id": "req_01EXAMPLE00000000000000000" }
curl -X POST 'https://api.cdnify.lat/api/v2/billing/payment-method/update-session' \
-H "Authorization: Bearer $CDNIFY_API_TOKEN"