Fetch Vouchers API
### Fetch Vouchers API
This API endpoint makes an HTTP GET request to retrieve vouchers from Dice.
### Request Parameters
| **Params** | **Required** | **Description** |
| --- | --- | --- |
| start_date | Mandatory | Date filter, from which date the voucher needs to be fetched. <br> <br>Format - **dd-MM-yyyy** |
| end_date | Mandatory | Date filter, till which date the voucher need to be fetched. <br> <br>Format - **dd-MM-yyyy** |
| offset | Mandatory | Page Number |
| pageSize | Optional | Number of vouchers to be fetched in a single page. Value cannot be greater than 5000. <br> <br>If not provided along with the request then default value will be 1000 considered. |
#### Example
```
{{host}}/apis/external/voucher/getVouchers?offset=0&pageSize=1000&start_date=01-06-2023&end_date=30-12-2023
```
### Response
The response returns a status code of 200 along with a JSON object containing an array of vouchers and additional metadata.
#### Response Object
- `vouchers` (array): Contains the list of vouchers with various details such as ID, employee information, currency, amounts, status, and other attributes.
- `total` (integer): Represents the total number of vouchers available.
- `currentPage` (integer): Indicates the current page number.
- `totalPages` (integer): Specifies the total number of pages based on the pageSize.
The `vouchers` array includes objects with details about each voucher, including ID, employee information, currency, amounts, status, transaction details, creation and update timestamps, and additional attributes.
Each voucher object also includes a `forms` array, which contains key-value pairs representing the form data associated with the voucher.
#### Example Response
``` json
{
"vouchers": [
{
"id": 0,
"voucherId": "",
"employee": {
"id": 0,
"code": "",
"name": "",
"email": "",
"office": "",
"department": "",
"team": ""
},
"currency": "",
"initialAmount": 0,
"totalAmount": 0,
"approvedAt": 0,
"claimedAmount": 0,
"pettyAmount": 0,
"size": 0,
"voucherStatus": "",
"initialTxns": [""],
"currentTxns": [""],
"createdAt": 0,
"updatedAt": 0,
"attrs": {
"approved": "",
"auto": "",
"reimbursed": "",
"created": "",
"settlement_ledger_id": "",
"admin": "",
"title": "",
"type": ""
},
"forms": [
{
"key": "",
"id": "",
"value": ""
}
]
}
],
"total": 0,
"currentPage": 0,
"totalPages": 0
}
```
Headers
DICE-APP-ID
Company Code of client
X-CLIENT-ID
API Client ID
X-CLIENT-SECRET
API Client Secret
Query parameters
offset
pageSize
start_date
end_date
Response
OK
vouchers
total
currentPage
totalPages

