v1

latestOpenAPI 3.0.02026-07-24103118224.7 KB
Payment

Apply a coupon to a payment

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.

post/api/server/payment/{paymentId}/coupon

Path parameters

paymentIdstring required
Example:pay_1234567890abcdef

Unique identifier of the payment to apply the coupon to

Request body

codestring required

Coupon code to apply to the payment

Example request

{
  "code": "SAVE10"
}

Response

Apply a coupon to a payment successful

paymentIdstring 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

statusstring required

The payment status

amountnumber required

The amount in cents (excluding taxes), after any discount

amountTaxesIncludednumber nullable

The total amount including taxes in cents, after any discount

currencystring required

The currency

couponDiscountInCentsnumber nullable

Discount applied on the HT amount in cents (null if no coupon)

Example response

{
  "paymentId": "pay_1234567890",
  "paymentType": "ONE_TIME",
  "status": "INITIATION",
  "amount": 9000,
  "amountTaxesIncluded": 10800,
  "currency": "EUR",
  "couponDiscountInCents": 1000,
  "coupon": {
    "code": "SAVE10",
    "discountType": "PERCENTAGE",
    "discountAmountInCents": 1000,
    "finalAmountInCents": 9000
  }
}