Skip to main content
POST
/
coupons
/
coupon
curl -X POST \
  'https://api.appcharge.com/coupons/coupon' \
  -H 'Content-Type: application/json' \
  -H 'x-publisher-token: <x-publisher-token>' \
  -d '{
    "name": "summer26",
    "discountPercentage": 10,
    "maxRedemptionsPerCustomer": 2,
    "allowedPlayers": ["player123", "player456", "player789"],
    "supportedOfferExternalIds": ["bundle1", "rollingoffer3"],
    "expiredBy": "2025-04-02T06:54:51.670Z",
    "startsAt": "2025-02-02T06:54:51.670Z"
}'
{
    "name": "summer26",
    "active": true,
    "discountPercentage": 10,
    "maxRedemptionsPerCustomer": 2,
    "expiredBy": "2025-04-02T06:54:51.670Z",
    "startsAt": "2025-02-02T06:54:51.670Z",
    "supportedOfferExternalIds": ["bundle1", "rollingoffer3"],
    "firstTimePurchase": false,
    "allowedPlayers": ["player123", "player456", "player789"]
}
curl -X POST \
  'https://api.appcharge.com/coupons/coupon' \
  -H 'Content-Type: application/json' \
  -H 'x-publisher-token: <x-publisher-token>' \
  -d '{
    "name": "summer26",
    "discountPercentage": 10,
    "maxRedemptionsPerCustomer": 2,
    "allowedPlayers": ["player123", "player456", "player789"],
    "supportedOfferExternalIds": ["bundle1", "rollingoffer3"],
    "expiredBy": "2025-04-02T06:54:51.670Z",
    "startsAt": "2025-02-02T06:54:51.670Z"
}'
{
    "name": "summer26",
    "active": true,
    "discountPercentage": 10,
    "maxRedemptionsPerCustomer": 2,
    "expiredBy": "2025-04-02T06:54:51.670Z",
    "startsAt": "2025-02-02T06:54:51.670Z",
    "supportedOfferExternalIds": ["bundle1", "rollingoffer3"],
    "firstTimePurchase": false,
    "allowedPlayers": ["player123", "player456", "player789"]
}

Authorizations

x-publisher-token
string
header
required

Publisher token, as displayed in the Publisher Dashboard.

Body

application/json
name
string
required

Coupon name. Can't contain spaces or special characters.

Example:

"summer26"

discountPercentage
number
required

Discount percentage applied by the coupon.

Example:

1

active
boolean
default:true

Whether the coupon is active.

Example:

true

maxRedemptionsPerCustomer
integer

Maximum number of times a customer can redeem this coupon.

Example:

2

expiredBy
string<date-time>

Expiration date of the coupon.

Example:

"2025-04-02T06:54:51.670Z"

startsAt
string<date-time>

Start date of the coupon validity. If not provided, defaults to current date and time.

Example:

"2025-02-02T06:54:51.670Z"

supportedOfferExternalIds
string[]

List of offer IDs which this coupon applies. Empty array means all offers are supported.

Note: This represents both the offer.sku value in the Create Checkout Session API, and the publisherOfferId in the Offers V2 API.

Example:
["bundle1", "rollingoffer3"]
firstTimePurchase
boolean
default:false

Whether the coupon is only valid for first-time purchases.

Example:

false

allowedPlayers
string[]

List of player IDs that can redeem this coupon.

Response

Coupon created successfully.

name
string

Coupon name.

Example:

"summer26"

active
boolean

Whether the coupon is active.

Example:

true

discountPercentage
number

Discount percentage applied by the coupon.

Example:

1

maxRedemptionsPerCustomer
integer

Maximum number of times a customer can redeem this coupon.

Example:

2

expiredBy
string<date-time>

Expiration date of the coupon.

Example:

"2025-04-02T06:54:51.670Z"

startsAt
string<date-time>

Start date of the coupon validity.

Example:

"2025-02-02T06:54:51.670Z"

supportedOfferExternalIds
string[]

List of offer external IDs that support this coupon. Empty array means all offers are supported.

Example:
["bundle1", "rollingoffer3"]
firstTimePurchase
boolean

Whether the coupon is only valid for first-time purchases.

Example:

false

allowedPlayers
string[]

List of player IDs allowed to use this coupon. Empty array means all players are allowed.

Example:
["player123", "player456", "player789"]