---
title: "Export refunds as csv, xls or xlsx"
method: GET
path: "/refunds/export"
tags: ["Admin Sales: Refunds"]
---

# Export refunds as csv, xls or xlsx

`GET /refunds/export`

## Request

- Base URL: `http://localhost:8000/api/admin`
- URL: `http://localhost:8000/api/admin/refunds/export`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-admin-api/docs/refunds/export/get.ts> (a function with typed inputs; its response is checked against the schema)

Downloads the refunds datagrid as a csv, xls or xlsx file — the same data the admin Refunds "Export" button produces (ID, Order ID, Refunded Amount, Billed To, Refund Date). Honours the same filters as the listing (`id`, `order_id`, `state`, `base_grand_total_from`/`_to`, `billed_to`, `created_at_from`/`_to`). The response is a binary download, not JSON. Requires `sales.refunds.view`.

## Query parameters

- `format` 'csv' | 'xls' | 'xlsx'
- `id` string
- `order_id` string
- `state` string
- `base_grand_total_from` number
- `base_grand_total_to` number
- `billed_to` string
- `created_at_from` string, date
- `created_at_to` string, date

## Response `200`

The refunds export file is downloaded as an attachment.

## Other responses

- `401`: Missing or invalid admin token.
- `403`: Admin role lacks sales.refunds.view.
- `404`: Not found
- `422`: Unsupported format (csv, xls and xlsx only).

---

[API](https://skmtc.dev/bagisto/apis/bagisto-admin-api.md) - [All operations](https://skmtc.dev/bagisto/apis/bagisto-admin-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bagisto/apis/bagisto-admin-api/revisions/3198f11be70f?raw)
