REST API: Fetching the statement
search cancel

REST API: Fetching the statement

book

Article ID: 421218

calendar_today

Updated On:

Products

CloudHealth

Issue/Introduction

The REST API for statement retrieval incorrectly returns multiple responses for a given month and customer, despite the existence of only a single PGB Block.

https://chapi.cloudhealthtech.com/v1/customer_statements

Cause

When the Designated Payer account has been changed in the PGB block, the RBD files related to the Old Designated Payer Account remain in the backend, and the REST API response contains two statements in this case, one for the Old Designated Payer Account WITHOUT Invoice ID and a statement for the current designated payer WITH Invoice ID. 

Resolution

If there are multiple responses, use the tree with the statement that has invoice_id present.

 

 {
"id": ,
"cloud": "AWS",
"billing_period": "2025-11-01",
"total_amount": ,
"status": "Final",
"statement_generation_time": "2025-12-03",
"currency": {
"name": "USD",
"symbol": "$"
 },
"invoice_id": "********",
"invoice_date": "2025-12-03",
"azure_invoice": "No Azure Invoice"
 }