---
title: "Get accounts payable statistics"
method: GET
path: "/v1/platform/businesses/{business_id}/ap/stats/"
tags: ["Accounts Payable"]
---

# Get accounts payable statistics

`GET /v1/platform/businesses/{business_id}/ap/stats/`

## Request

- Base URL: `https://docs.thredfi.com` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.thredfi.com/v1/platform/businesses/{business_id}/ap/stats/`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP basic
  - HTTP bearer
  - HTTP bearer

Retrieve statistics for all Accounts Payable entities grouped by status.

        Returns counts for:
        - **Bills**: all, unpaid (received + partially_paid), paid
        - **Vendor Credits**: all, unapplied, applied
        - **Vendor Refunds**: all, pending (to get non-pending, use list endpoint with status filter)
        - **Receipts**: all, breakdown by payment method

        **Note**: For vendor refunds, "pending" only includes status=pending. To filter by other
        statuses (partially_allocated, allocated, completed, cancelled), use the vendor-refunds
        list endpoint with the status query parameter.

        This endpoint is optimized for efficient counting (5 queries total).

## Path parameters

- `business_id` string, uuid, required

## Response `200`

- APStats[]
  - `bills` BillStats, required: Statistics for purchase bills.
    - `all` integer, required: Total number of bills
    - `unpaid` integer, required: Number of unpaid bills (received + partially_paid)
    - `paid` integer, required: Number of fully paid bills
  - `vendor_credits` VendorCreditStats, required: Statistics for vendor credits.
    - `all` integer, required: Total number of vendor credits
    - `unapplied` integer, required: Number of unapplied credits (draft, sent, received, partially_applied)
    - `applied` integer, required: Number of fully applied credits
  - `vendor_refunds` VendorRefundStats, required: Statistics for vendor refunds.
    - `all` integer, required: Total number of vendor refunds
    - `pending` integer, required: Number of pending refunds (status=pending). Non-pending statuses: partially_allocated, allocated, completed, cancelled
  - `receipts` ReceiptStats, required: Statistics for receipts with payment method breakdown.
    - `all` integer, required: Total number of receipts
    - `payment_method` ReceiptPaymentMethodStats, required: Payment method breakdown for receipts.
      - `cash` integer: Number of cash receipts
      - `credit_card` integer: Number of credit card receipts
      - `debit_card` integer: Number of debit card receipts
      - `bank_transfer` integer: Number of bank transfer receipts
      - `check` integer: Number of check receipts
      - `other` integer: Number of receipts with other payment methods

## Other responses

- `400`: Validation errors in request data
- `401`: Authentication required - missing or invalid API key
- `403`: Permission denied - insufficient privileges
- `404`: Resource not found
- `409`: Conflict - resource already exists or invalid state transition
- `422`: Unprocessable entity - business logic validation failed
- `500`: Internal server error

---

[API](https://skmtc.dev/thredfi/apis/thredfi-accounting-platform-api.md) - [All operations](https://skmtc.dev/thredfi/apis/thredfi-accounting-platform-api/llms.txt) - [OpenAPI document](https://skmtc.dev/thredfi/apis/thredfi-accounting-platform-api/revisions/0c1918254db3?raw)
