---
title: "Search billing transactions"
method: POST
path: "/api/billing-transactions/search"
tags: ["billing_transactions"]
---

# Search billing transactions

`POST /api/billing-transactions/search`

## Request

- Base URL: `https://beta.getsales.io/id/v1`
- URL: `https://beta.getsales.io/id/v1/api/billing-transactions/search`
- Auth: HTTP bearer and API key in header `Team-SID`

The buyer's invoices and charges: one row per Paddle transaction, newest first, wherever their workspaces are. Filter by status, origin, collection_mode, currency or a billed_at window; locate one by invoice_number. include subscription / owner / team. Read-only, append-only. page_size 0 returns the counts only.

Contract:
- MCP tool `search_billing_transactions`, registry package `mcp.id/billing_transactions`, mount `id.billing`.
- Operation `search`, response envelope `search`.
- Flags: read only.

## Request body

- SearchBillingTransactionsRequest: Request body of `search_billing_transactions`.
  - `filter` object: Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt | lt | is_null}}; q inside it is free text. Omit for every row.
    - `sid` object: Transaction sid(s).
      - `eq` string
      - `in` string[]
    - `owner_user_sid` object: The buyer.
      - `eq` string
      - `in` string[]
    - `team_sid` object: The notified workspace.
      - `eq` string
      - `in` string[]
      - `is_null` boolean
    - `subscription_sid` object: One subscription's charges.
      - `eq` string
      - `in` string[]
      - `is_null` boolean
    - `paddle_transaction_id` object: Paddle's id.
      - `eq` string
      - `in` string[]
    - `invoice_number` object: Locate one invoice; is_null false = the rows with a PDF.
      - `eq` string
      - `in` string[]
      - `is_null` boolean
    - `status` object: billed | paid | completed | past_due | canceled.
      - `eq` 'billed' | 'paid' | 'completed' | 'past_due' | 'canceled'
      - `ne` 'billed' | 'paid' | 'completed' | 'past_due' | 'canceled'
      - `in` string[]
      - `nin` string[]
    - `origin` object: subscription_charge | subscription_update | one_time.
      - `eq` 'subscription_charge' | 'subscription_update' | 'one_time'
      - `ne` 'subscription_charge' | 'subscription_update' | 'one_time'
      - `in` string[]
      - `nin` string[]
    - `collection_mode` object: automatic | manual.
      - `eq` 'automatic' | 'manual'
      - `ne` 'automatic' | 'manual'
      - `in` string[]
    - `currency` object: ISO 4217.
      - `eq` string
      - `in` string[]
    - `billed_at` object: ISO 8601 bounds.
      - `gte` string
      - `lte` string
      - `gt` string
      - `lt` string
      - `is_null` boolean
    - `created_at` object: ISO 8601 bounds.
      - `gte` string
      - `lte` string
      - `gt` string
      - `lt` string
  - `include` string[]: Relations to attach to every item; omit for the bare rows.
  - `sort` object: One column and its direction; omit for the default order.
    - `field` 'billed_at' | 'created_at' | 'total', required: The column to order by.
    - `direction` 'asc' | 'desc': asc or desc; default desc.
  - `page_size` integer: 0..500, default 50; 0 = counts only, 1 = the first row.
  - `cursor` string, nullable: pagination.next_cursor of the previous page.

## Response `200`

`search` success envelope.

- SearchBillingTransactionsResponse
  - `success` true, required
  - `operation` 'search', required
  - `items` object[], required
    - `item` object, required
      - `sid` string, required: Transaction sid (bl_tx_...).
      - `owner_user_sid` string, required: The buyer (us_mb_...).
      - `team_sid` string, nullable, required: The workspace notified of it at ingestion (the first allocated one); null when none.
      - `subscription_sid` string, nullable, required: The subscription charged (bl_sb_...); attached on a later event when the charge came first.
      - `paddle_transaction_id` string, required: Paddle's id (txn_...).
      - `status` 'billed' | 'paid' | 'completed' | 'past_due' | 'canceled', required: billed, paid, completed, past_due or canceled, as Paddle reports it.
      - `origin` 'subscription_charge' | 'subscription_update' | 'one_time', required: subscription_charge (a period's charge, the first checkout included), subscription_update (a proration), one_time.
      - `collection_mode` 'automatic' | 'manual', required: automatic = charged to the card; manual = invoiced.
      - `invoice_number` string, nullable, required: Paddle's invoice number; the rows that carry one have a PDF.
      - `total` string, required: The total as a decimal string in currency.
      - `tax` string, nullable, required: The tax part as a decimal string; null when unknown.
      - `currency` string, required: ISO 4217.
      - `items` object[], required: The frozen line items of the charge.
        - `price_sid` string, nullable, required: The price charged (bl_pc_...); null when Paddle named one we do not mirror.
        - `product_sid` string, nullable, required: The product (bl_pr_...).
        - `product_type` 'plan' | 'addon' | 'credits_pack', required: plan | addon | credits_pack.
        - `quantity` integer, required: Units charged.
        - `unit_amount` string, required: The unit price as a decimal string.
        - `paddle_price_id` string, nullable, required: Paddle's price id.
      - `billed_at` string, nullable, required: ISO 8601 UTC; null until billed.
      - `created_at` string, required: ISO 8601 UTC.
      - `updated_at` string, required: ISO 8601 UTC.
    - `included` object, required
  - `pagination` object, required
    - `next_cursor` string, nullable, required
    - `has_more` boolean, required
    - `total_count` integer, nullable, required
  - `applied_filters` object, required
  - `includes` string[], required
  - `meta` object, required
    - `trace_id` string, required: UUID v7; same 128-bit value as the X-Trace-Id header.
    - `span_id` string, required: 16 hex chars, root span of this request.
    - `timestamp` string, required: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
    - `duration_ms` integer, required: Server-side wall clock.
    - `team_sid` string, nullable: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
    - `actor_type` string, nullable: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
  - `counts` object
    - `total_count` number, required: Transactions matching the filter.
    - `groups` object, required: status, origin, collection_mode and currency: the count per value.

## Other responses

- `4XX`: MCP error envelope. `error.code` is one of validation_failed, nothing_to_update, not_found, relation_not_found, invalid_transition, limit_exceeded, payment_required, duplicate_rejected, conflict, delete_blocked, unauthorized, forbidden, rate_limited, not_implemented.
- `5XX`: MCP error envelope with `error.code` internal_error or service_unavailable.

---

[API](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-id.md) - [All operations](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-id/llms.txt) - [OpenAPI document](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-id/revisions/95e48541fe85?raw)
