Skip to main content
POST
/
v1
/
contracts
/
seatBalances
/
list
List seat balances
curl --request POST \
  --url https://api.metronome.com/v1/contracts/seatBalances/list \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "contract_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "subscription_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "seat_ids": [
    "<string>"
  ],
  "include_credits_and_commits": false,
  "include_ledgers": false,
  "starting_at": "2023-11-07T05:31:56Z",
  "effective_before": "2023-11-07T05:31:56Z",
  "covering_date": "2023-11-07T05:31:56Z",
  "limit": 123,
  "cursor": "<string>"
}
'
{
  "data": [
    {
      "seat_id": "<string>",
      "balances": [
        {
          "credit_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "balance": 123,
          "starting_balance": 123
        }
      ],
      "commits": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "balance": 123,
          "start_date": "2023-11-07T05:31:56Z",
          "end_date": "2023-11-07T05:31:56Z",
          "ledger_entries": [
            {
              "type": "PREPAID_COMMIT_SEGMENT_START",
              "amount": 123,
              "timestamp": "2023-11-07T05:31:56Z"
            }
          ]
        }
      ],
      "credits": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "balance": 123,
          "start_date": "2023-11-07T05:31:56Z",
          "end_date": "2023-11-07T05:31:56Z",
          "ledger_entries": [
            {
              "type": "CREDIT_SEGMENT_START",
              "amount": 123,
              "timestamp": "2023-11-07T05:31:56Z"
            }
          ]
        }
      ]
    }
  ],
  "pagination": {
    "seats_included": 123,
    "seats_available_for_next_page": 123,
    "next_page": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

List seat-level balances for commits and credits.

customer_id
string<uuid>
required

The customer ID to retrieve seat balances for

contract_id
string<uuid>
required

The contract ID to retrieve seat balances for

subscription_ids
string<uuid>[]

Optional filter to only include seats from specific subscriptions. If subscriptions ids are not mapped to SEAT_BASED subscriptions, error will be returned.

seat_ids
string[]

Optional filter to only include specific seats

include_credits_and_commits
boolean
default:false

Include credits and commits in the response

include_ledgers
boolean
default:false

Include ledger entries for each commit and commit. include_credits_and_commits must be set to true for include_ledgers=true to apply.

starting_at
string<date-time>

Include only commits or credits with access effective on or after this date (cannot be used with covering_date).

effective_before
string<date-time>

Include only commits or credits with access effective on or before this date (cannot be used with covering_date).

covering_date
string<date-time>

Include only commits or credits with access that cover this specific date (cannot be used with starting_at or ending_before).

limit
integer

Maximum number of seats to return. Range: 1-100. Default: 25. When include_credits_and_commits = true, if the total commits/credits across all seats exceeds 100, a limit of 100 applies to the total credits and commits. Seats are included greedily to maximize the number of seats returned. Example: if seat 1 has 98 commits and seat 2 has 10 commits, both seats will be returned (total: 108 commits). Each returned seat includes all of its associated credits and commits.

cursor
string

Page token from a previous response to retrieve the next page

Response

Success

data
object[]
required
pagination
object
required