Create Account

POST /api/v1/accounts

Creates a new account.

Request Body

FieldTypeRequiredDescription
namestringYesAccount name
categorystringNoAccount type: bank or credit_card
descriptionstringNoAccount description
acc_nostringNoAccount number
currencystringNoCurrency code (e.g., INR, USD)
colorstringNoHex color code
opening_balancenumberNoOpening balance
opening_balance_datestringNoDate when opening_balance was valid (YYYY-MM-DD). Auto-set to today if not provided when opening_balance is set.
upload_frequencystringNoUpload frequency (default: weekly)

Valid Values

category:

  • bank - Savings or current account
  • credit_card - Credit card

upload_frequency:

  • daily
  • weekly
  • monthly
  • quarterly
  • manual

Example Request

curl -X POST "https://statements.finopsbricks.com/api/v1/accounts" \
  -H "api-key: fob_stm_xxxxxxxxxxxx" \
  -H "api-secret: xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Savings Account",
    "category": "bank",
    "acc_no": "9876543210",
    "currency": "INR",
    "opening_balance": 50000
  }'

Response

{
  "data": {
    "id": "acc456abc",
    "name": "Savings Account",
    "category": "bank",
    "description": null,
    "acc_no": "9876543210",
    "currency": "INR",
    "color": null,
    "opening_balance": 50000.00,
    "opening_balance_date": "2025-01-05",
    "status": "active",
    "upload_frequency": "weekly",
    "created_at": "2025-01-05T10:30:00.000Z"
  }
}

Errors

CodeDescription
400Validation error (missing name, invalid category, etc.)
401Invalid or missing API credentials
403API key lacks accounts:create permission