---
title: "Query commitments"
method: POST
path: "/commitments/search"
tags: ["Commitments"]
---

# Query commitments

`POST /commitments/search`

## Request

- Base URL: `https://us.api.flexprice.io/v1`
- URL: `https://us.api.flexprice.io/v1/commitments/search`
- Auth: API key in header `x-api-key`

Lists commitments with filtering and sorting. Returns a paginated list.

## Request body

- CommitmentFilter
  - `active_from` string: ActiveFrom/ActiveTo select commitments whose term overlaps [ActiveFrom, ActiveTo).
  - `active_to` string
  - `customer_ids` string[]
  - `end_time` string, date-time
  - `expand` string
  - `filters` TypesFilterCondition[]
    - `data_type` 'string' | 'number' | 'date' | 'array'
    - `field` string
    - `operator` 'eq' | 'contains' | 'not_contains' | 'gt' | 'lt' | 'gte' | 'in' | 'not_in' | 'before' | 'after'
    - `value` TypesValue
      - `array` string[]
      - `boolean` boolean
      - `date` string
      - `number` number
      - `string` string
  - `ids` string[]
  - `limit` integer
  - `offset` integer
  - `order` 'asc' | 'desc'
  - `scope_entity_ids` string[]
  - `scope_entity_type` 'subscription' | 'group' | 'meter' | 'price'
  - `sort` TypesSortCondition[]
    - `direction` 'asc' | 'desc'
    - `field` string
  - `start_time` string, date-time
  - `status` 'published' | 'deleted' | 'archived'
  - `statuses` TypesCommitmentStatus[]
  - `subscription_ids` string[]

## Response `200`

OK

- ListCommitmentsResponse
  - `items` CommitmentResponse[]
    - `active_windows` TypesActiveWindow[]
      - `end` TypesBucket
        - `hour` integer
        - `minute` integer
      - `start` TypesBucket
        - `hour` integer
        - `minute` integer
    - `binding` boolean
    - `collection_method` 'per_period' | 'billing_terms'
    - `commitment_status` 'active' | 'ended' | 'terminated'
    - `commitment_value` string
    - `committed_price_id` string
    - `created_at` string, date-time
    - `created_by` string
    - `currency` string
    - `customer_id` string
    - `end_date` string, date-time: EndDate is exclusive; nil for an open-ended commitment, which runs until terminated.
    - `environment_id` string
    - `id` string
    - `idempotency_key` string
    - `instalment_invoicing` string
    - `invoice_description` string
    - `invoice_label` string
    - `measurement` 'billing_period' | 'window'
    - `metadata` TypesMetadata
    - `name` string
    - `on_early_termination` 'forfeit' | 'credit_note' | 'bill_remaining'
    - `overage_price_id` string
    - `priority` integer
    - `scope_entity_id` string
    - `scope_entity_type` 'subscription' | 'group' | 'meter' | 'price'
    - `start_date` string, date-time
    - `status` 'published' | 'deleted' | 'archived'
    - `subscription_id` string
    - `tenant_id` string
    - `terminated_at` string, date-time
    - `termination_invoice_id` string
    - `timezone` string
    - `total_amount` string
    - `type` 'amount' | 'quantity'
    - `updated_at` string, date-time
    - `updated_by` string
    - `value` string
  - `pagination` TypesPaginationResponse
    - `limit` integer
    - `offset` integer
    - `total` integer

## Other responses

- `400`: Invalid request
- `500`: Server error

## Changes

- **2026-10-25** `4746c65d9396`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/flexprice/apis/flexprice-api/changes/commitments/search/post.md)

---

[API](https://skmtc.dev/flexprice/apis/flexprice-api.md) - [All operations](https://skmtc.dev/flexprice/apis/flexprice-api/llms.txt) - [OpenAPI document](https://skmtc.dev/flexprice/apis/flexprice-api/revisions/e1348d61034c?raw)
