---
title: "Apply a coupon to a payment"
method: POST
path: "/api/server/payment/{paymentId}/coupon"
tags: ["Payment"]
---

# Apply a coupon to a payment

`POST /api/server/payment/{paymentId}/coupon`

**Applies a coupon to a pending payment before confirmation.** The coupon system (one-time vs subscription) is auto-detected from the payment; applying a coupon of the wrong type returns an error. The payment amount is reduced so the discounted total is charged at confirmation.

## Path parameters

- `paymentId` string, required

## Request body

- ApplyCouponDto
  - `code` string, required — Coupon code to apply to the payment

## Response `200`

Apply a coupon to a payment successful

- CouponResultDto
  - `paymentId` string, required — The payment ID
  - `paymentType` 'ONE_TIME' | 'SUBSCRIPTION', required — Whether the payment is a single one-time payment or the first payment of a subscription
  - `status` string, required — The payment status
  - `amount` number, required — The amount in cents (excluding taxes), after any discount
  - `amountTaxesIncluded` number, nullable — The total amount including taxes in cents, after any discount
  - `currency` string, required — The currency
  - `couponDiscountInCents` number, nullable — Discount applied on the HT amount in cents (null if no coupon)
  - `coupon` CouponDto
    - `code` string, required — Coupon code
    - `discountType` 'PERCENTAGE' | 'FIXED_AMOUNT', required — Discount type
    - `discountAmountInCents` number, required — Discount applied on the HT (tax-exclusive) amount, in cents
    - `finalAmountInCents` number, required — HT (tax-exclusive) amount after discount, in cents

## Other responses

- `400` — Invalid, inactive, expired or unknown coupon; wrong coupon type for this payment; coupon already applied; usage limit reached; minimum spend not met; payment not pending; payment not in server-to-server mode; or card payments not unlocked
- `401` — Unauthorized - Invalid API key
- `404` — Payment not found for the given user

---

[API](https://skmtc.dev/inflowpay/apis/inflow-api.md) · [All operations](https://skmtc.dev/inflowpay/apis/inflow-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/inflowpay/inflow-api/revisions/3012dd3dd14a/schema)
