> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voucherify.io/llms.txt
> Use this file to discover all available pages before exploring further.

# CSV export with API

Voucherify enables programmable export of:

* [vouchers](/api-reference/vouchers/get-voucher),
* [redemptions](/api-reference/redemptions/get-redemption),
* [publications](/api-reference/publications/list-publications),
* [customers](/api-reference/customers/get-customer),
* [order](/api-reference/orders/get-order) and point expirations to a CSV file

## How to export data to CSV

1. Trigger the export with [Create Export](/api-reference/exports/create-export) and store the `id` of [the export object](/api-reference/exports/get-export) you'll get in the response from Voucherify.

2. [Get](/api-reference/exports/get-export) the export's status providing the `id` and take a look at the `status` field from the response. If it's still `SCHEDULED`, this means that the export is still in progress and you should ask later.

3. When the status is finally `DONE`, the `result` will store the URL as in the example below:

<CodeGroup>
  ```json Response theme={null}
  {
    "id": "export_lhZvHKphiMESVdIncRKvoaZh",
    "object": "export",
    "created_at": "2017-02-24T14:03:00.196Z",
    "status": "DONE",
    "channel": "API",
    "exported_object": "voucher",
    "parameters": {
      "fields": [
        "code",
        "voucher_type"
      ],
      "filter": {
        "categories": {
          "conditions": {
            "$in": [
              "postman"
            ]
          }
        }
      }
    },
    "result": {
      "url": "https://download.voucherify.io/v1/exports/export_lhZvHKphiMESVdIncRKvoaZh?token=TOKEN"
    }
  }
  ```
</CodeGroup>

4. To [download the export file](/api-reference/exports/download-export), use the provided URL together with authentication headers.

## Filters

Voucherify allows you to specify the time frame for the records you want to retrieve. Thanks to this mechanism, it should be easy to implement a pagination mechanism. See the example of a request body:

<CodeGroup>
  ```json Request theme={null}
  {
     "exported_object":"redemption",
     "parameters":{
        "order":"-created_at",
        "fields":[
           "id",
           "object",
           "date",
           "voucher_code",
           "customer_id",
           "result"
        ],
        "filters":{
           "junction":"and",
           "created_at":{
              "conditions":{
                 "$after":[
                    "2018-05-30T22:00:00.000Z"
                 ],
                 "$before":[
                    "2018-06-29T22:00:00.000Z"
                 ]
              }
           }
        }
     }
  }
  ```
</CodeGroup>

The export request will result in a single file being generated by the system.
