---
title: "Export cart rule coupons as csv, xls or xlsx"
method: GET
path: "/marketing/cart-rules/{cartRuleId}/coupons/export"
tags: ["Admin Marketing: Promotions"]
---

# Export cart rule coupons as csv, xls or xlsx

`GET /marketing/cart-rules/{cartRuleId}/coupons/export`

## Request

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

Downloads the coupons datagrid shown on the cart rule edit screen — ID, Coupon Code, Times Used, Created Date, Expiration Date — for this cart rule only. Binary download, not JSON. Requires `marketing.promotions.cart_rules`.

## Path parameters

- `cartRuleId` integer, required

## Query parameters

- `format` 'csv' | 'xls' | 'xlsx'

## Response `200`

Export file downloaded as an attachment.

## Other responses

- `401`: Missing or invalid admin token.
- `403`: Admin role lacks marketing.promotions.cart_rules.
- `404`: Cart rule 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/marketing/cart-rules/:cartRuleId/coupons/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)
