---
title: "Search billing subscriptions"
method: POST
path: "/api/billing-subscriptions/search"
tags: ["billing_subscriptions"]
---

# Search billing subscriptions

`POST /api/billing-subscriptions/search`

## Request

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

The caller's subscriptions, the orders they bought. status for dunning or canceled ones, paddle_subscription_id.is_null true for the trial sentinel, current_period_ends_at for expiry windows. include lines for what each holds (accounts, inbox packages, credits a month, amounts), price, product, latest_transactions; team is always null here. The split across workspaces is search_subscription_allocations (/mcp/id/partner). page_size 0 returns the counts only.

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

## Request body

- SearchBillingSubscriptionsRequest: Request body of `search_billing_subscriptions`.
  - `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: Subscription sid(s).
      - `eq` string
      - `in` string[]
    - `owner_user_sid` object: The buyer.
      - `eq` string
      - `in` string[]
    - `team_sid` object: Always null here; kept for the shared contract.
      - `eq` string
      - `in` string[]
      - `is_null` boolean
    - `paddle_subscription_id` object: is_null true = the internal sentinels (the trial).
      - `eq` string
      - `in` string[]
      - `is_null` boolean
    - `status` object: active | past_due | paused | canceled.
      - `eq` 'active' | 'past_due' | 'paused' | 'canceled'
      - `ne` 'active' | 'past_due' | 'paused' | 'canceled'
      - `in` string[]
      - `nin` string[]
    - `collection_mode` object: automatic | manual.
      - `eq` 'automatic' | 'manual'
      - `in` string[]
    - `price_sid` object: The first line's price.
      - `eq` string
      - `in` string[]
    - `current_period_ends_at` object: Expiry window.
      - `gte` string
      - `lte` string
      - `gt` string
      - `lt` string
      - `is_null` boolean
    - `next_billed_at` object: ISO 8601 bounds.
      - `gte` string
      - `lte` string
      - `gt` string
      - `lt` string
      - `is_null` boolean
    - `canceled_at` object: ISO 8601 bounds.
      - `gte` string
      - `lte` string
      - `is_null` boolean
    - `created_at` object: ISO 8601 bounds.
      - `gte` string
      - `lte` string
      - `gt` string
      - `lt` string
    - `updated_at` object: ISO 8601 bounds.
      - `gte` string
      - `lte` string
      - `gt` string
      - `lt` string
    - `deleted_at` object: Default scope is { is_null: true }.
      - `gte` string
      - `lte` string
      - `is_null` boolean
  - `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` 'created_at' | 'updated_at' | 'current_period_ends_at', 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.

- SearchBillingSubscriptionsResponse
  - `success` true, required
  - `operation` 'search', required
  - `items` object[], required
    - `item` object, required
      - `sid` string, required: Subscription sid (bl_sb_...).
      - `owner_user_sid` string, required: The buyer (us_mb_...): the one who manages the pool.
      - `team_sid` string, nullable, required: Always null on this product: a subscription floats and allocations bind workspaces to it.
      - `paddle_subscription_id` string, nullable, required: Paddle's id (sub_...); null on an internal sentinel (the trial).
      - `status` 'active' | 'past_due' | 'paused' | 'canceled', required: active; past_due (a failed renewal: LinkedIn and email run 3 more days); paused; canceled (terminal).
      - `collection_mode` 'automatic' | 'manual', required: automatic = the card is charged; manual = invoiced (a sales deal) or the trial sentinel.
      - `price_sid` string, required: The first line's price (bl_pc_...); the lines include says what each line is.
      - `quantity` integer, required: 1 on a resource subscription: a line is one item of quantity 1.
      - `addons` object[], required: The other lines of the order, one item each.
        - `product_sid` string, required: The line's product (bl_pr_...).
        - `price_sid` string, required: The line's price (bl_pc_...), a non-catalog price of this order.
        - `paddle_item_id` string, nullable, required: Paddle's item id on the subscription; null on a sentinel.
        - `quantity` integer, required: Always 1 on a resource subscription: a line is one item.
        - `status` 'active' | 'canceled', required: canceled = the line grants nothing any more.
      - `currency` string, required: ISO 4217: USD, EUR or GBP.
      - `current_period_starts_at` string, nullable, required: ISO 8601 UTC.
      - `current_period_ends_at` string, nullable, required: ISO 8601 UTC; the trial's end on the sentinel.
      - `next_billed_at` string, nullable, required: ISO 8601 UTC; null when nothing is billed next.
      - `paused_at` string, nullable, required: ISO 8601 UTC; null unless paused.
      - `scheduled_resume_at` string, nullable, required: ISO 8601 UTC; null unless a resume is scheduled.
      - `scheduled_change` object, nullable, required: A cancel, pause or resume waiting for the period end; null = none.
        - `action` 'cancel' | 'pause' | 'resume', required: What happens at effective_at.
        - `effective_at` string, required: ISO 8601 UTC.
        - `resume_at` string, nullable, required: For a scheduled pause: when it resumes; null = open-ended.
      - `canceled_at` string, nullable, required: ISO 8601 UTC; null unless canceled.
      - `canceled_by` object, nullable, required: Who canceled; null unless canceled by a person.
        - `actor_type` 'user' | 'support' | 'api_key' | 'system' | 'agent', required
        - `actor_sid` string, nullable, required
        - `team_sid` string, required
        - `actor_name` string, nullable: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
        - `oauth_client_sid` string, nullable: The acting OAuth client (id_oc_*); null off the OAuth path.
        - `reason` string, nullable: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
        - `permissions` object, required: Internal audit context: the grant set the actor held at write time. Not a contract.
        - `cluster_id` integer, nullable: Internal audit context: the cluster that served the write.
        - `trace_id` string, nullable: Internal audit context: the trace id of the request that wrote the row.
      - `created_at` string, required: ISO 8601 UTC.
      - `updated_at` string, required: ISO 8601 UTC.
      - `deleted_at` string, nullable, required: ISO 8601 UTC; null = live.
    - `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: Subscriptions matching the filter.
    - `groups` object, required: status and collection_mode: 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)
