List Balances
List balances
client.v1.contracts.listBalances(ContractListBalancesParamsbody, RequestOptionsoptions?): dataarraynext_pageunionContractListBalancesResponse
post/v1/contracts/customerBalances/list
List balances (commits and credits).
Parameters
bodycustomer_idstringidstringcovering_datestringeffective_beforestringinclude_archivedbooleaninclude_balancebooleaninclude_contract_balancesbooleaninclude_ledgersbooleanlimitnumbernext_pagestringstarting_atstringContractListBalancesParams
Returns
ContractListBalancesResponse
import Metronome from '@metronome/sdk';
const client = new Metronome({
bearerToken: 'My Bearer Token',
});
const response = await client.v1.contracts.listBalances({
customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
include_ledgers: true,
});
console.log(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"
}