# Get expenses by subcategory _id

Endpoint: GET /expenses/bySubCategory/{subcategoryId}
Version: 2.0.0
Security: oauth2ClientCredentials

## Path parameters:

  - `subcategoryId` (string, required)

## Query parameters:

  - `page` (number)
    Page number (minimum: 1)

  - `limit` (number)
    Number of items per page (minimum: 1, maximum: 1000)

## Header parameters:

  - `org_wallet_ref` (string)
    Organization wallet reference, defaults to "1" if not provided

  - `business_id` (string, required)
    Business identifier for the request

## Response 200 fields (application/json):

  - `docs` (array)
    Expense documents

  - `docs._id` (string)
    MongoDB ID

  - `docs.amount` (number)
    Expense amount

  - `docs.fees` (number)
    Transaction fees

  - `docs.charge` (number)
    Total charge amount

  - `docs.original_currency` (string)
    Original currency

  - `docs.currency` (string)
    Current currency

  - `docs.original_amount` (number)
    Original amount

  - `docs.transaction_ref` (string)
    Transaction reference

  - `docs.provider_ref` (string)
    Provider reference

  - `docs.employee_id` (string)
    Employee ID

  - `docs.person` (string)
    Person name

  - `docs.vendor_ref` (object)
    Vendor reference

  - `docs.transaction_date` (string)
    Transaction date

  - `docs.MerchantCategoryCode` (string)
    Merchant category code

  - `docs.MerchantIdentifier` (string)
    Merchant identifier

  - `docs.fx_rate` (number)
    Foreign exchange rate

  - `docs.card_vcn` (string)
    Card VCN

  - `docs.receiver` (string)
    Transaction receiver

  - `docs.accno` (string)
    Account number

  - `docs.payment_type` (string)
    Payment type

  - `docs.channel` (string)
    Payment channel

  - `docs.subcategory` (object)
    Subcategory details

  - `docs.subcategory._id` (string)
    Subcategory MongoDB ID

  - `docs.subcategory.category` (object)
    Category details

  - `docs.subcategory.category._id` (string)
    Category MongoDB ID

  - `docs.subcategory.category.groupid` (string)
    Category group ID

  - `docs.subcategory.category.name` (string)
    Category name

  - `docs.subcategory.code` (string)
    Subcategory code

  - `docs.subcategory.name` (string)
    Subcategory name

  - `docs.team` (object)
    Team details

  - `docs.team._id` (string)
    Team MongoDB ID

  - `docs.team.name` (string)
    Team name

  - `docs.team.code` (string)
    Team code

  - `docs.tag` (array)
    Tags array

  - `docs.tag._id` (string)
    Tag MongoDB ID

  - `docs.tag.name` (string)
    Tag name

  - `docs.tag.tag_group` (string)
    Tag group ID

  - `docs.tag.employee` (object)
    Employee info

  - `docs.tag.employee._id` (string)
    Employee MongoDB ID

  - `docs.tag.employee.name` (string)
    Employee name

  - `docs.tag.employee.organization_email` (string)
    Employee organization email

  - `docs.tag.employee.tags` (array)
    Employee tags

  - `docs.tag.employee.supervisor` (object)
    Employee supervisor

  - `docs.tag.employee.customer_id` (string)
    Customer ID

  - `docs.tag.employee.customer_name` (string)
    Customer name

  - `docs.tag.is_deleted` (boolean)
    Is deleted flag

  - `docs.tag.__v` (number)
    Version key

  - `docs.tag.createdAt` (string)
    Created timestamp

  - `docs.tag.updatedAt` (string)
    Updated timestamp

  - `docs.tag.teams` (array)
    Associated team IDs

  - `docs.notes` (string)
    Transaction notes

  - `docs.risk` (string)
    Risk level

  - `docs.risk_notes` (string)
    Risk notes

  - `docs.ip` (string)
    IP address

  - `docs.attachments` (array)
    Attachment URLs

  - `docs.invoice_attachments` (array)
    Invoice attachment URLs

  - `docs.payment_status` (string)
    Payment status

  - `docs.status` (string)
    Expense status

  - `docs.review_participants` (array)
    Review participants

  - `docs.review_mandate` (number)
    Review mandate

  - `docs.review_level` (number)
    Review level

  - `docs.priority` (number)
    Priority level

  - `docs.events` (array)
    Events array

  - `docs.exported` (boolean)
    Exported flag

  - `docs.tax_compliant` (boolean)
    Tax compliant flag

  - `docs.sync_successful` (boolean)
    Sync successful flag

  - `docs.org_wallet_ref` (string)
    Organization wallet reference

  - `docs.vendor` (string)
    Vendor name

  - `docs.customer` (object)
    Customer info

  - `docs.subscription_id` (string)
    Subscription ID

  - `docs.account_number` (string)
    Account number

  - `docs.scan` (array)
    Scan results

  - `docs.scan.scanId` (string)
    Scan ID

  - `docs.scan.total` (object)
    Total amount from scan

  - `docs.scan.date` (string)
    Date from scan

  - `docs.scan.vendorNames` (string)
    Vendor names from scan

  - `docs.scan.taxValidity` (object)
    Tax validity info

  - `docs.scan.taxValidity.pin` (string)
    PIN number

  - `docs.scan.taxValidity.cu` (object)
    CU details

  - `docs.scan.taxValidity.invoice` (object)
    Invoice details

  - `docs.scan.taxValidity.tax` (object)
    Tax details

  - `docs.scan.lineItems` (array)
    Line items from scan

  - `docs.scan.lineItems.description` (string)
    Item description

  - `docs.scan.lineItems.price` (number)
    Item price

  - `docs.scan.lineItems.quantity` (number)
    Item quantity

  - `docs.scan.taxCompliant` (boolean)
    Tax compliant flag

  - `docs.scan.expenseAmountMatchesTotal` (boolean)
    Expense amount matches total flag

  - `docs.scan.validityScore` (number)
    Validity score

  - `docs.scan.caption` (string)
    Validity caption

  - `docs.batched` (boolean)
    Batched flag

  - `docs.line_items` (array)
    Line items

  - `docs.employee_external_id` (object)
    Employee external ID

  - `docs.employee` (object)
    Employee details

  - `docs.reviews` (array)
    Reviews array

  - `docs.reviews.person` (string)
    Reviewer person name

  - `docs.reviews.notes` (string)
    Review notes

  - `docs.reviews.employee_id` (string)
    Reviewer employee ID

  - `docs.reviews.status` (string)
    Review status

  - `docs.reviews._id` (string)
    Review MongoDB ID

  - `docs.reviews.reviewed_on` (string)
    Review timestamp

  - `docs.createdAt` (string)
    Created timestamp

  - `docs.updatedAt` (string)
    Updated timestamp

  - `docs.__v` (number)
    Version key

  - `docs.requisition_reference` (string)
    Requisition reference

  - `docs.acknowledged_by_ai` (boolean)
    AI acknowledged flag

  - `docs.analysed_by_ai` (boolean)
    AI analysed flag

  - `docs.attachments_data` (array)
    Attachments data array

  - `docs.deleted_attachments` (array)
    Deleted attachments array

  - `docs.ready_for_ai` (boolean)
    Ready for AI processing flag

  - `docs.send_to_ai_attempts` (number)
    Send to AI attempts count

  - `docs.sent_to_ai` (boolean)
    Sent to AI flag

  - `docs.id` (string)
    Auto-generated ID field

  - `total` (number)
    Total count

  - `limit` (object)
    Limit per page

  - `page` (object)
    Current page

  - `pages` (number)
    Total pages

