Skip to main content
POST
Generate invoice from charge baskets

Behavior

  • Creates one AR document (invoice) per account from the charge basket line items
  • All documents are created with status ‘draft’
  • The request body is flat JSON (not JSON:API format)
  • Returns an array of created AR documents

Important Notes

  • invoice_status on charge baskets is automatically recalculated after invoice generation
  • Baskets must be in CLOSED status before generating invoices

Authorizations

Authorization
string
header
required

OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.

FlowAuthorization Code
Authorization URL
https://clarus-api.com/oauth/authorize
Token URL
https://clarus-api.com/oauth/token
FlowClient Credentials
Token URL
https://clarus-api.com/oauth/token
X-Clarus-Subdomain
string
header
required

The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.

Body

application/json
ids
integer[]
required

Array of charge basket IDs to generate invoices from

Minimum array length: 1

Response

Invoices generated successfully

data
object[]