List Balances
List balances
v1.contracts.list_balances(**kwargs) -> dataarraynext_pageStringContractListBalancesResponse
post/v1/contracts/customerBalances/list
List balances (commits and credits).
Parameters
customer_idString
formatuuid
idString
optional
formatuuid
covering_dateTime
optional
Return only balances that have access schedules that "cover" the provided date
formatdate-time
effective_beforeTime
optional
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.
limitInteger
optional
The maximum number of commits to return. Defaults to 25.
minimum1
maximum25
next_pageString
optional
The next page token from a previous response.
starting_atTime
optional
Include only balances that have any access on or after the provided date
formatdate-time
Returns
ContractListBalancesResponseclass
require "metronome_sdk"
metronome = MetronomeSDK::Client.new(bearer_token: "My Bearer Token")
response = metronome.v1.contracts.list_balances(customer_id: "13117714-3f05-48e5-a6e9-a66093f13b4d")
puts(response)
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"
}