promotion-codes

Stable. Describes behaviour that is built and covered by tests in this repository.

API reference

GET /v1/promotion-codes #

Promotion codes, newest first

Parameters

NameInTypeDescription
couponquerystringOnly the codes of this coupon
statequeryactive | inactive
searchquerystringPart of the code
page_sizequeryinteger
page_tokenquerystring

Responses

StatusMeaningBody
200OKListPromotionCodesResponse
400Error envelopeError
Example response
{
  "codes": [
    {
      "id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
      "coupon_id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
      "coupon_code": "string",
      "code": "string",
      "active": false,
      "max_redemptions": 1,
      "redeemed": 1,
      "expire_time": "2026-11-03T10:15:00Z",
      "first_purchase_only": false,
      "one_per_customer": false,
      "min_amount_minor": "string",
      "min_amount_currency": "string",
      "allowed_plans": [
        "string"
      ],
      "allowed_packs": [
        "string"
      ],
      "allowed_currencies": [
        "string"
      ],
      "restore_on_reversal": false,
      "create_time": "2026-11-03T10:15:00Z"
    }
  ],
  "next_page_token": "string",
  "total": 1
}
curl
curl -X GET https://YOUR-API-ADDRESS/v1/promotion-codes \
  -H "Authorization: Bearer $PAYRUDDER_API_KEY"

DELETE /v1/promotion-codes/{code} #

Stop new redemptions of one code (the coupon and its other codes keep working)

Parameters

NameInTypeDescription
code requiredpathstring

Responses

StatusMeaningBody
200OKPromotionCode
404Error envelopeError
Example response
{
  "id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
  "coupon_id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
  "coupon_code": "string",
  "code": "string",
  "active": false,
  "max_redemptions": 1,
  "redeemed": 1,
  "expire_time": "2026-11-03T10:15:00Z",
  "first_purchase_only": false,
  "one_per_customer": false,
  "min_amount_minor": "string",
  "min_amount_currency": "string",
  "allowed_plans": [
    "string"
  ],
  "allowed_packs": [
    "string"
  ],
  "allowed_currencies": [
    "string"
  ],
  "restore_on_reversal": false,
  "create_time": "2026-11-03T10:15:00Z"
}
curl
curl -X DELETE https://YOUR-API-ADDRESS/v1/promotion-codes/<code> \
  -H "Authorization: Bearer $PAYRUDDER_API_KEY"

Models

Error

FieldTypeDescription
error requiredobject

ListPromotionCodesResponse

FieldTypeDescription
codes requiredarray of PromotionCode
next_page_token requiredstring
total requiredinteger

PromotionCode

FieldTypeDescription
id requiredstring · uuid
coupon_id requiredstring · uuid
coupon_code requiredstring
code requiredstring
active requiredboolean
max_redemptions requiredinteger0 or absent = unlimited
redeemed requiredinteger
expire_time requiredstring · date-time
first_purchase_only requiredbooleanOnly a customer who has paid for nothing yet
one_per_customer requiredboolean
min_amount_minor requiredstring · int64A purchase under this amount cannot use the code; needs min_amount_currency
min_amount_currency requiredstring
allowed_plans requiredarray of stringPlan codes; empty means any
allowed_packs requiredarray of stringCredit pack ids; empty means any
allowed_currencies requiredarray of stringEmpty means any
restore_on_reversal requiredbooleanA void or full refund gives the use back to the count. Off by default
create_time requiredstring · date-time