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": "13117714-3f05-48e5-a6e9-a66093f13b4d",
  "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc",
  "subscription_ids": [
    "8deed800-1b7a-495d-a207-6c52bac54dc9"
  ],
  "include_credits_and_commits": true,
  "include_ledgers": true,
  "covering_date": "2024-03-01T00:00:00.000Z",
  "limit": 25
}
'
import requests

url = "https://api.metronome.com/v1/contracts/seatBalances/list"

payload = {
"customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d",
"contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc",
"subscription_ids": ["8deed800-1b7a-495d-a207-6c52bac54dc9"],
"include_credits_and_commits": True,
"include_ledgers": True,
"covering_date": "2024-03-01T00:00:00.000Z",
"limit": 25
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
subscription_ids: ['8deed800-1b7a-495d-a207-6c52bac54dc9'],
include_credits_and_commits: true,
include_ledgers: true,
covering_date: '2024-03-01T00:00:00.000Z',
limit: 25
})
};

fetch('https://api.metronome.com/v1/contracts/seatBalances/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.metronome.com/v1/contracts/seatBalances/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer_id' => '13117714-3f05-48e5-a6e9-a66093f13b4d',
'contract_id' => 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
'subscription_ids' => [
'8deed800-1b7a-495d-a207-6c52bac54dc9'
],
'include_credits_and_commits' => true,
'include_ledgers' => true,
'covering_date' => '2024-03-01T00:00:00.000Z',
'limit' => 25
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.metronome.com/v1/contracts/seatBalances/list"

payload := strings.NewReader("{\n \"customer_id\": \"13117714-3f05-48e5-a6e9-a66093f13b4d\",\n \"contract_id\": \"d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc\",\n \"subscription_ids\": [\n \"8deed800-1b7a-495d-a207-6c52bac54dc9\"\n ],\n \"include_credits_and_commits\": true,\n \"include_ledgers\": true,\n \"covering_date\": \"2024-03-01T00:00:00.000Z\",\n \"limit\": 25\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.metronome.com/v1/contracts/seatBalances/list")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"13117714-3f05-48e5-a6e9-a66093f13b4d\",\n \"contract_id\": \"d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc\",\n \"subscription_ids\": [\n \"8deed800-1b7a-495d-a207-6c52bac54dc9\"\n ],\n \"include_credits_and_commits\": true,\n \"include_ledgers\": true,\n \"covering_date\": \"2024-03-01T00:00:00.000Z\",\n \"limit\": 25\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.metronome.com/v1/contracts/seatBalances/list")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"13117714-3f05-48e5-a6e9-a66093f13b4d\",\n \"contract_id\": \"d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc\",\n \"subscription_ids\": [\n \"8deed800-1b7a-495d-a207-6c52bac54dc9\"\n ],\n \"include_credits_and_commits\": true,\n \"include_ledgers\": true,\n \"covering_date\": \"2024-03-01T00:00:00.000Z\",\n \"limit\": 25\n}"

response = http.request(request)
puts response.read_body
{
  "data": [
    {
      "seat_id": "seat_1",
      "balances": [
        {
          "credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
          "balance": 30000,
          "starting_balance": 50000
        }
      ],
      "commits": [
        {
          "id": "62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35",
          "balance": 30000,
          "start_date": "2024-01-01T00:00:00.000Z",
          "end_date": "2024-02-01T00:00:00.000Z",
          "ledger_entries": [
            {
              "type": "PREPAID_COMMIT_SEGMENT_START",
              "amount": 50000,
              "timestamp": "2024-01-01T00:00:00.000Z"
            },
            {
              "type": "PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION",
              "amount": -20000,
              "timestamp": "2024-01-31T00:00:00.000Z"
            }
          ]
        }
      ],
      "credits": [
        {
          "id": "fa411f5b-fb85-4755-9d4d-530717be083c",
          "balance": 20000,
          "start_date": "2024-01-01T00:00:00.000Z",
          "end_date": "2024-02-01T00:00:00.000Z",
          "ledger_entries": [
            {
              "type": "CREDIT_SEGMENT_START",
              "amount": 25000,
              "timestamp": "2024-01-01T00:00:00.000Z"
            },
            {
              "type": "CREDIT_AUTOMATED_INVOICE_DEDUCTION",
              "amount": -5000,
              "timestamp": "2024-01-31T00:00:00.000Z"
            }
          ]
        }
      ]
    },
    {
      "seat_id": "seat_2",
      "balances": [
        {
          "credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
          "balance": 45000,
          "starting_balance": 45000
        }
      ],
      "commits": [
        {
          "id": "62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35",
          "balance": 45000,
          "start_date": "2024-01-01T00:00:00.000Z",
          "end_date": "2024-02-01T00:00:00.000Z",
          "ledger_entries": [
            {
              "type": "PREPAID_COMMIT_SEGMENT_START",
              "amount": 45000,
              "timestamp": "2024-01-01T00:00:00.000Z"
            }
          ]
        }
      ],
      "credits": []
    }
  ],
  "pagination": {
    "next_page": "eyJsYXN0X3NlYXRfaWQiai",
    "seats_included": 2,
    "seats_available_for_next_page": 8
  }
}
{
"message": "<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.

skip_missing_seat_ids
boolean
default:false

When true, any seat_ids not found in contract subscriptions will be silently omitted from the response instead of returning a 400 error.

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