On the My Account page, they click the My invoices option to check all the invoices associated with their accounts.
The following sample code calls the List invoices operation, which returns all invoices (including invoice items) associated with their account.
Note that The account ID (3A8b48f158e0b6af326c49d9b098a1db84) can be obtained from the "Create an account" API call.
cURL
curl -L -g -X GET 'https://rest.apisandbox.zuora.com/object-query/invoices?expand[]=invoiceitems&filter[]=accountId.EQ%3A8b48f158e0b6af326c49d9b098a1db84' \
-H 'Authorization: Bearer 42759df698e348528d5ec2a1df53f7ac'If the request succeeds, you will get a response similar to the following snippet:
{
"data": [
{
"accountId": "3A8b48f158e0b6af326c49d9b098a1db84",
"adjustmentAmount": 0.0,
"amount": 49.99,
"amountWithoutTax": 49.99,
"autoPay": true,
"balance": 49.99,
"comments": "",
"createdById": "ebd653b0f1ea46df87835085e26897ce",
"createdDate": "2024-08-07T09:30:39Z",
"creditBalanceAdjustmentAmount": 0.0,
"creditMemoAmount": 0.0,
"currency": "USD",
"dueDate": "2024-08-07",
"id": "8a8aa2fe912c061f01912c2d1c4a525e",
"includesOneTime": true,
"includesRecurring": true,
"includesUsage": true,
"invoiceDate": "2024-08-07",
"invoiceNumber": "INV00000041",
"paymentAmount": 0.0,
"postedBy": "ebd653b0f1ea46df87835085e26897ce",
"postedDate": "2024-08-07T09:30:39Z",
"refundAmount": 0.0,
"reversed": false,
"source": "API",
"sourceType": "Subscription",
"status": "Posted",
"targetDate": "2024-07-01",
"taxAmount": 0.0,
"taxExemptAmount": 0.0,
"updatedById": "ebd653b0f1ea46df87835085e26897ce",
"updatedDate": "2024-08-07T09:30:39Z"
},
{
"accountId": "3A8b48f158e0b6af326c49d9b098a1db84",
"adjustmentAmount": 0.0,
"amount": 49.99,
"amountWithoutTax": 49.99,
"autoPay": true,
"balance": 49.99,
"comments": "",
"createdById": "ebd653b0f1ea46df87835085e26897ce",
"createdDate": "2024-08-07T09:19:08Z",
"creditBalanceAdjustmentAmount": 0.0,
"creditMemoAmount": 0.0,
"currency": "USD",
"dueDate": "2024-08-07",
"id": "8a8aa16f912bed7901912c22904a15f0",
"includesOneTime": true,
"includesRecurring": true,
"includesUsage": true,
"invoiceDate": "2024-08-07",
"invoiceNumber": "INV00000040",
"paymentAmount": 0.0,
"postedBy": "ebd653b0f1ea46df87835085e26897ce",
"postedDate": "2024-08-07T09:19:08Z",
"refundAmount": 0.0,
"reversed": false,
"source": "API",
"sourceType": "Subscription",
"status": "Posted",
"targetDate": "2024-07-01",
"taxAmount": 0.0,
"taxExemptAmount": 0.0,
"updatedById": "ebd653b0f1ea46df87835085e26897ce",
"updatedDate": "2024-08-07T09:19:08Z"
}
]
}