Querying for an account's invoice streams
Use the following endpoints to query for an account's invoice streams:
- GET
/billing/v1/accounts/{accountId}/invoice-streams
- GET
/billing/v1/accounts/{accountId}/invoice-streams/{invoiceStreamId}
Invoice streams for policy-level billing
For example, account bc:PLB01 uses policy-level billing. The following retrieves all invoice streams for this account:
GET /billing/v1/accounts/bc:PLB01/invoice-streams
{
"count": 2,
"data": [
{
"attributes": {
"creationOrder": 1,
"currency": {
"code": "usd",
"name": "USD"
},
"displayName": "Monthly",
"id": "bc:SP5d2fO6Gi-r_yhkjKgYe",
"overridingBillDateOrDueDateBilling": {
"code": "BillDateBilling",
"name": "Bill Date"
},
"overridingFirstAnchorDate": "2023-04-30",
"periodicity": {
"code": "monthly",
"name": "Monthly"
},
"policy": {
"displayName": "PolicyNumber_BZTBRA100",
"id": "bc:SSVRxw5FeE46PHhuNrjRM",
"type": "Policy",
"uri": "/billing/v1/accounts/bc:S7NGdmcIgJWx-KudX23aj/policies/bc:SSVRxw5FeE46PHhuNrjRM"
},
"unappliedFund": {
"displayName": "Default",
"id": "bc:S64vTSj7xe3R2st7ch9N3",
"type": "UnappliedFund",
"uri": "/billing/v1/accounts/bc:S7NGdmcIgJWx-KudX23aj/unapplied-funds/bc:S64vTSj7xe3R2st7ch9N3"
}
},
...
},
{
"attributes": {
"creationOrder": 1,
"currency": {
"code": "usd",
"name": "USD"
},
"displayName": "Every Week",
"id": "bc:StCo1pf57KOzwyLz8bJ-Y",
"overridingBillDateOrDueDateBilling": {
"code": "BillDateBilling",
"name": "Bill Date"
},
"overridingFirstAnchorDate": "2023-04-07",
"periodicity": {
"code": "everyweek",
"name": "Every Week"
},
"policy": {
"displayName": " PolicyNumber_GREDWW100",
"id": "bc:SAaEU67PiQ74A1-9UGbgK",
"type": "Policy",
"uri": "/billing/v1/accounts/bc:S7NGdmcIgJWx-KudX23aj/policies/bc:SAaEU67PiQ74A1-9UGbgK"
},
"unappliedFund": {
"displayName": "Custom Unapplied",
"id": "bc:S64vTSj7xe3R2st7ch9N3",
"type": "UnappliedFund",
"uri": "/billing/v1/accounts/bc:S7NGdmcIgJWx-KudX23aj/unapplied-funds/bc:S64vTSj7xe3R2st7ch9N3"
}
},
...
Invoice streams for account-level billing
Account bc:ALB02 uses account-level billing. The following retrieves all invoice streams for this account. Note the following:
- These invoice streams do not have any overrides.
- Because these invoices streams can be associated with multiple policies, the
policy
property is null (and therefore not returned by the GET).
GET /billing/v1/accounts/bc:ALB02/invoice-streams
{
"count": 2,
"data": [
{
"attributes": {
"creationOrder": 1,
"currency": {
"code": "usd",
"name": "USD"
},
"displayName": "Account Charges / Monthly",
"id": "bc:SivQCeWJhYQenjwIe4mQ6",
"periodicity": {
"code": "monthly",
"name": "Monthly"
},
"unappliedFund": {
"displayName": "Default",
"id": "bc:S-8f9mQPAQWR2J5zS0jLZ",
"type": "UnappliedFund",
"uri": "/billing/v1/accounts/bc:SSuIzycDGsN-ZNKVdpMQ1/unapplied-funds/bc:S-8f9mQPAQWR2J5zS0jLZ"
}
},
...
},
{
"attributes": {
"creationOrder": 1,
"currency": {
"code": "usd",
"name": "USD"
},
"displayName": "Every Other Week",
"id": "bc:Sp7U1Ik4C1Mz24k7TdsBt",
"periodicity": {
"code": "everyotherweek",
"name": "Every Other Week"
},
"unappliedFund": {
"displayName": "Custom Unapplied",
"id": "bc:SPiKPsJfLZLdJ5e1c3xbC",
"type": "UnappliedFund",
"uri": "/billing/v1/accounts/bc:SSuIzycDGsN-ZNKVdpMQ1/unapplied-funds/bc:SPiKPsJfLZLdJ5e1c3xbC"
}
},
...