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

# Export customers as csv, xls or xlsx

`GET /customers/export`

## Request

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

Downloads the customers datagrid — the same columns the admin Export button produces (Channel, Customer ID, Customer Name, Email, Contact Number, Status, Gender, Group, Suspended, Order Count, Address Count). Honours the same filters as the listing and exports every matching row. Binary download, not JSON. Requires `customers.customers`.

## Query parameters

- `format` 'csv' | 'xls' | 'xlsx'
- `query` string
- `name` string
- `email` string
- `phone` string
- `customer_group_id` integer
- `status` integer
- `channel_id` integer
- `created_at_from` string
- `created_at_to` string

## Response `200`

Export file downloaded as an attachment.

## Other responses

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

## Changes

- **2026-10-28** `3198f11be70f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/bagisto/apis/bagisto-admin-api/changes/customers/export/get.md)

---

[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)
