Skip to main content
POST
/
v1
/
users
/
{userId}
/
statements
/
generate
Generate statement
curl --request POST \
  --url https://api.ledger.so/v1/users/{userId}/statements/generate \
  --header 'Api-Key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "startDate": "2023-12-25",
  "endDate": "2023-12-25"
}
'
{
  "object": "statement",
  "id": "<string>",
  "userId": "<string>",
  "periodStart": 123,
  "periodEnd": 123,
  "openingBalance": 123,
  "closingBalance": 123,
  "creditLimit": 123,
  "availableCredit": 123,
  "totalSpent": 123,
  "transactionCount": 123,
  "transactions": [
    {
      "id": "<string>",
      "cardId": "<string>",
      "amount": 123,
      "currency": "<string>",
      "status": "pending",
      "createdAt": 123,
      "agentId": "<string>",
      "userId": "<string>",
      "authorizedAmount": 123,
      "localAmount": 123,
      "localCurrency": "<string>",
      "merchant": {
        "name": "<string>",
        "id": "<string>",
        "category": "<string>",
        "categoryCode": "<string>",
        "city": "<string>",
        "country": "<string>",
        "enrichedName": "<string>",
        "enrichedIcon": "<string>",
        "enrichedCategory": "<string>"
      },
      "declinedReason": "<string>",
      "attestationStatus": "attested",
      "notes": "<string>",
      "tags": [
        "<string>"
      ],
      "category": "<string>",
      "receipt": {
        "hasReceipt": true,
        "mimeType": "<string>",
        "uploadedAt": 123
      },
      "authorizedAt": 123,
      "postedAt": 123,
      "updatedAt": 123
    }
  ],
  "type": "monthly",
  "createdAt": 123,
  "totalRefunds": 123,
  "totalFees": 123,
  "summaryByMerchant": [
    {
      "merchantName": "<string>",
      "transactionCount": 123,
      "totalAmount": 123
    }
  ],
  "summaryByCategory": [
    {
      "category": "<string>",
      "categoryCode": "<string>",
      "transactionCount": 123,
      "totalAmount": 123
    }
  ]
}

Authorizations

Api-Key
string
header
required

API key for authentication. Get your key from the Dashboard.

Path Parameters

userId
string
required

The user ID

Body

application/json
startDate
string<date>
required

Start date in YYYY-MM-DD format

endDate
string<date>
required

End date in YYYY-MM-DD format

Response

Statement generated

object
enum<string>
required
Available options:
statement
id
string
required

Unique statement ID

userId
string
required

User this statement belongs to

periodStart
integer
required

Unix timestamp of statement period start

periodEnd
integer
required

Unix timestamp of statement period end

openingBalance
integer
required

Balance at period start in cents

closingBalance
integer
required

Balance at period end in cents

creditLimit
integer
required

Credit limit during this period in cents

availableCredit
integer
required

Available credit at period end in cents

totalSpent
integer
required

Total spending during period in cents

transactionCount
integer
required

Number of transactions in period

transactions
object[]
required

All transactions in this statement period

type
enum<string>
required

Whether this is a regular monthly statement or custom-generated

Available options:
monthly,
custom
createdAt
integer
required

Unix timestamp when statement was generated

totalRefunds
integer

Total refunds during period in cents

totalFees
integer

Total fees during period in cents

summaryByMerchant
object[]

Spending breakdown by merchant

summaryByCategory
object[]

Spending breakdown by merchant category