Skip to main content
POST
/
billing
/
generate-invoices
Generate billing invoices
curl --request POST \
  --url https://api.platform.dakota.xyz/billing/generate-invoices \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "year": 2025,
  "month": 1,
  "clientIds": [
    "1NFHrqBHb3cTfLVkFSGmHZqdDPi"
  ],
  "dryRun": true
}
'
{
  "invoices": [
    {
      "id": 12345,
      "clientId": "1NFHrqBHb3cTfLVkFSGmHZqdDPi",
      "periodStart": "2025-01-01T00:00:00Z",
      "periodEnd": "2025-02-01T00:00:00Z",
      "volumeUSD": "1250000.50",
      "transactionCount": 150,
      "transferFeeCalculated": "2250.00",
      "monthlyMinimum": "1500.00",
      "baseFeeCharged": "2250.00",
      "achCount": 120,
      "wireCount": 25,
      "sepaCount": 5,
      "achFees": "120.00",
      "wireFees": "625.00",
      "sepaFees": "7.50",
      "totalAmount": "3002.50",
      "stripeInvoiceId": "in_1234567890",
      "createdAt": "2025-01-15T10:30:00Z"
    }
  ],
  "totalAmount": "15750.00",
  "dryRun": true
}

Authorizations

x-api-key
string
header
required

Body

application/json

Request to generate invoices for a billing month

year
integer
required

Year for the billing period

Required range: 2020 <= x <= 2100
Example:

2025

month
integer
required

Month for the billing period (1-12)

Required range: 1 <= x <= 12
Example:

1

clientIds
string[]

Optional list of specific client IDs to generate invoices for. If omitted, generates for all active clients.

KSUID is a 27-character globally unique ID that combines a timestamp with a random component. Used for all entity identifiers in the Dakota platform.

Required string length: 27
dryRun
boolean
default:true

If true, calculate and preview invoices without saving to database or sending to Stripe. Defaults to true for safety.

Response

Invoices generated successfully

invoices
object[]
required

List of generated invoices

totalAmount
string
required

Sum of all invoice amounts

Example:

"15750.00"

dryRun
boolean

Whether this was a dry run