# Setu Bill Object - minimal implementation samples ## API details to be consumed ### Sample 1 1. Customer name 2. Customer account ID 3. Bill amount 4. Generated date 5. Biller Bill ID 6. Setu (platform) Biller ID 7. Recurrence 8. Exactness ```json= { "status": 200, "success": true, "data": { "bills": [ { "aggregates": { "total": { "amount": { "value": 311446 }, "displayName": "Total amount to be paid" } }, "generatedOn": "2020-03-17T09:30:20.000Z", "amountExactness": "EXACT", "billType": "COLLECT", "billerBillID": "1956947-1956947", "billerCategory": "7322", "customer": { "name": "Nikhilesh Pinnamaneni" }, "customerAccount": { "id": "18GES1040181" }, "recurrence": "ONE_TIME", "validationRules": {}, "platformBillID": "323209135397013202", "platformBillStatus": "BILL_CREATED", "taxes": [], "fees": [], "items": [], "discounts": [] } ] } } ``` ### Sample 2 1. Customer name 2. Customer account ID 3. Bill amount 4. Generated date 5. Due date 6. Biller Bill ID 7. Setu (platform) Biller ID 8. Recurrence 9. Exactness ```json= { "status": 200, "success": true, "data": { "bills": [ { "aggregates": { "total": { "amount": { "value": 311446 }, "displayName": "Total amount to be paid" } }, "generatedOn": "2020-03-17T09:30:20.000Z", "dueDate": "2019-04-15T00:00:00.000Z", "amountExactness": "EXACT", "billType": "COLLECT", "billerBillID": "1956947-1956947", "billerCategory": "7322", "customer": { "name": "Nikhilesh Pinnamaneni" }, "customerAccount": { "id": "18GES1040181" }, "recurrence": "ONE_TIME", "validationRules": {}, "platformBillID": "323209135397013202", "platformBillStatus": "BILL_CREATED", "fees": [], "items": [] } ] } } ``` ### Sample 3: line items and fees 1. Customer name 2. Customer account ID 3. Bill amount 4. Generated date 5. Biller Bill ID 6. Setu (platform) Biller ID 7. Recurrence 8. Exactness 9. Fees 10. Items Let us look at a sample bill response ```json= { "status": 200, "success": true, "data": { "bills": [ { "aggregates": { "total": { "amount": { "value": 311446 }, "displayName": "Total amount to be paid" } }, "amountExactness": "EXACT", "billType": "COLLECT", "billerActorID": "4253121318099926", "billerBillID": "1956947- 1956947", "billerCategory": "7322", "customer": { "name": "Nikhilesh Pinnamaneni" }, "customerAccount": { "id": "18GES1040181" }, "dueDate": "2019-04-15T00:00:00.000Z", "fees": [ { "aggregates": { "total": { "value": 1446 } }, "displayName": "other fees" }, { "aggregates": { "total": { "value": 100000 } }, "displayName": "Late payment fees" } ], "generatedOn": "2020-03-17T09:30:20.000Z", "items": [ { "aggregates": { "total": { "value": 300000 } }, "displayName": "EMI" } ], "recurrence": "ONE_TIME", "validationRules": {}, "name": "Bill-1956949", "paymentAddresses": [], "platformBillID": "323209135397013202", "platformBillStatus": "BILL_CREATED" } ] } } ``` Here, take a look at the fees and items section ```json= { .... "fees": [ { "aggregates": { "total": { "value": 1446 } }, "displayName": "other fees" }, { "aggregates": { "total": { "value": 100000 } }, "displayName": "Late payment fees" } ], "generatedOn": "2020-03-17T09:30:20.000Z", "items": [ { "aggregates": { "total": { "value": 300000 } }, "displayName": "EMI" } ] .... } ``` There are these fees and line items in the above sample <table> <tbody> <tr> <td><strong>Item</strong></td> <td><strong>Value</strong></td> </tr> <tr> <td>EMI</td> <td>3000.00</td> </tr> <tr> <td>Late payment fees</td> <td>100.00</td> </tr> <tr> <td>Other fees</td> <td>14.46</td> </tr> <tr> <td><strong>Total</strong></td> <td><strong>3114.46</strong></td> </tr> </tbody> </table> Both `items` and `fees` are `arrays` and each item in the `array` has the following structure ```json= { "aggregates": { "total": { "value": <integer> } }, "displayName": <String> } ``` You need to loop through the array to get the all the fees and items in the bill.