Skip to content
  • Auto
  • Light
  • Dark
Talk to an expert

List Balances

List balances
v1.contracts.list_balances(ContractListBalancesParams**kwargs) -> datalistnext_pagestrContractListBalancesResponse
post/v1/contracts/customerBalances/list

List balances (commits and credits).

Parameters
customer_idstr
formatuuid
idstr
optional
formatuuid
covering_dateunion
optional
Union[str, datetime]

Return only balances that have access schedules that "cover" the provided date

formatdate-time
effective_beforeunion
optional
Union[str, datetime]

Include only balances that have any access before the provided date (exclusive)

formatdate-time
include_archivedbool
optional

Include archived credits and credits from archived contracts.

include_balancebool
optional

Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower.

include_contract_balancesbool
optional

Include balances on the contract level.

include_ledgersbool
optional

Include ledgers in the response. Setting this flag may cause the query to be slower.

limitint
optional

The maximum number of commits to return. Defaults to 25.

minimum1
maximum25
next_pagestr
optional

The next page token from a previous response.

starting_atunion
optional
Union[str, datetime]

Include only balances that have any access on or after the provided date

formatdate-time
Returns
ContractListBalancesResponseclass
Hide ParametersShow Parameters
datalist
List[Data]
Hide ParametersShow Parameters
idstrproductProducttypeliteralaccess_scheduleScheduleDurationamountfloatapplicable_contract_idslistapplicable_product_idslistapplicable_product_tagslistarchived_atdatetimebalancefloatcontractContractcustom_fieldsDict[str, str]descriptionstrhierarchy_configurationHierarchyConfigurationinvoice_contractInvoiceContractinvoice_scheduleSchedulePointInTimeledgerlistnamestrnetsuite_sales_order_idstrpriorityfloatrate_typeliteralrolled_over_fromRolledOverFromrollover_fractionfloatsalesforce_opportunity_idstrspecifierslistuniqueness_keystrCommit
idstrproductProducttypeliteralaccess_scheduleScheduleDurationapplicable_contract_idslistapplicable_product_idslistapplicable_product_tagslistbalancefloatcontractContractcustom_fieldsDict[str, str]descriptionstrhierarchy_configurationHierarchyConfigurationledgerlistnamestrnetsuite_sales_order_idstrpriorityfloatrate_typeliteralsalesforce_opportunity_idstrspecifierslistuniqueness_keystrCredit
next_pagestr
from metronome import Metronome

client = Metronome(
    bearer_token="My Bearer Token",
)
response = client.v1.contracts.list_balances(
    customer_id="13117714-3f05-48e5-a6e9-a66093f13b4d",
    id="6162d87b-e5db-4a33-b7f2-76ce6ead4e85",
    include_ledgers=True,
)
print(response.data)
200 Example
{
  "data": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "product": {
        "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "name": "name"
      },
      "type": "PREPAID",
      "access_schedule": {
        "schedule_items": [
          {
            "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            "amount": 0,
            "ending_before": "2019-12-27T18:11:19.117Z",
            "starting_at": "2019-12-27T18:11:19.117Z"
          }
        ],
        "credit_type": {
          "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "name": "name"
        }
      },
      "amount": 0,
      "applicable_contract_ids": [
        "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
      ],
      "applicable_product_ids": [
        "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
      ],
      "applicable_product_tags": [
        "string"
      ],
      "archived_at": "2019-12-27T18:11:19.117Z",
      "balance": 0,
      "contract": {
        "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
      },
      "custom_fields": {
        "foo": "string"
      },
      "description": "description",
      "hierarchy_configuration": {
        "child_access": {
          "type": "ALL"
        }
      },
      "invoice_contract": {
        "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
      },
      "invoice_schedule": {
        "credit_type": {
          "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "name": "name"
        },
        "do_not_invoice": true,
        "schedule_items": [
          {
            "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            "amount": 0,
            "quantity": 0,
            "timestamp": "2019-12-27T18:11:19.117Z",
            "unit_price": 0,
            "invoice_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
          }
        ]
      },
      "ledger": [
        {
          "amount": 0,
          "segment_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "timestamp": "2019-12-27T18:11:19.117Z",
          "type": "PREPAID_COMMIT_SEGMENT_START"
        }
      ],
      "name": "name",
      "netsuite_sales_order_id": "netsuite_sales_order_id",
      "priority": 0,
      "rate_type": "COMMIT_RATE",
      "rolled_over_from": {
        "commit_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "contract_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
      },
      "rollover_fraction": 0,
      "salesforce_opportunity_id": "salesforce_opportunity_id",
      "specifiers": [
        {
          "presentation_group_values": {
            "foo": "string"
          },
          "pricing_group_values": {
            "foo": "string"
          },
          "product_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "product_tags": [
            "string"
          ]
        }
      ],
      "uniqueness_key": "x"
    }
  ],
  "next_page": "next_page"
}