promotion-codes
Stable. Describes behaviour that is built and covered by tests in this repository.
GET /v1/promotion-codes #
Promotion codes, newest first
Parameters
| Name | In | Type | Description |
|---|---|---|---|
coupon | query | string | Only the codes of this coupon |
state | query | active | inactive | |
search | query | string | Part of the code |
page_size | query | integer | |
page_token | query | string |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | OK | ListPromotionCodesResponse |
400 | Error envelope | Error |
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
| Name | In | Type | Description |
|---|---|---|---|
code required | path | string |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | OK | PromotionCode |
404 | Error envelope | Error |
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
| Field | Type | Description |
|---|---|---|
error required | object |
ListPromotionCodesResponse
| Field | Type | Description |
|---|---|---|
codes required | array of PromotionCode | |
next_page_token required | string | |
total required | integer |
PromotionCode
| Field | Type | Description |
|---|---|---|
id required | string · uuid | |
coupon_id required | string · uuid | |
coupon_code required | string | |
code required | string | |
active required | boolean | |
max_redemptions required | integer | 0 or absent = unlimited |
redeemed required | integer | |
expire_time required | string · date-time | |
first_purchase_only required | boolean | Only a customer who has paid for nothing yet |
one_per_customer required | boolean | |
min_amount_minor required | string · int64 | A purchase under this amount cannot use the code; needs min_amount_currency |
min_amount_currency required | string | |
allowed_plans required | array of string | Plan codes; empty means any |
allowed_packs required | array of string | Credit pack ids; empty means any |
allowed_currencies required | array of string | Empty means any |
restore_on_reversal required | boolean | A void or full refund gives the use back to the count. Off by default |
create_time required | string · date-time |