---
search:
  tags:
    - billing
    - POST
seo:
  description: >-
    Apply a coupon to a customer, account, or subscription. Reference for the
    POST /v1/coupons/{couponId}/apply endpoint in the Vortex Payments API.
sidebar:
  label: Apply a coupon to a customer, account, or subscription
  badge: POST
title: Apply a coupon to a customer, account, or subscription
type: openapi-operation
---
`POST /v1/coupons/{couponId}/apply`

**curl**

```bash
curl "https://api.vortex.nyc/v1/coupons/{couponId}/apply?environment=sandbox&merchantAccountId=..." \
  -X POST \
  -H "Authorization: Bearer $VORTEX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"appliedCouponId":"acpn_123","customerId":"bcust_123","subscriptionId":"bsub_123","appliedAt":"2026-06-01T00:00:00.000Z"}'
```

**TypeScript**

```ts
import { applyCoupon, createVortex } from "@vortex-api/vortex/2026-09";

const vortex = createVortex({ apiKey: process.env.VORTEX_API_KEY });
const { data } = await applyCoupon({
  client: vortex,
  path: { couponId: "..." },
  query: { environment: "sandbox", merchantAccountId: "..." },
  body: {"appliedCouponId":"acpn_123","customerId":"bcust_123","subscriptionId":"bsub_123","appliedAt":"2026-06-01T00:00:00.000Z"},
});
```

**Request body** (`application/json`, required)

- `appliedCouponId` (string)
- `customerId` (string, required)
- `billingAccountId` (string)
- `subscriptionId` (string)
- `appliedAt` (string<date-time>)
- `metadata` (Metadata)

Request body example:

```json
{
  "appliedCouponId": "acpn_123",
  "customerId": "bcust_123",
  "subscriptionId": "bsub_123",
  "appliedAt": "2026-06-01T00:00:00.000Z"
}
```

**Responses**

- `200` — Success
- `400` — Bad request, including malformed JSON
- `401` — Missing or invalid API key
- `409` — Conflict, including idempotency body drift
- `422` — Validation failed
- `429` — API key rate limit exceeded
- `default` — Error

Response example, 200:

```json
{
  "data": {},
  "requestId": "string"
}
```
