Xsolla-logo

Redeem coupon codeClient-side

post/v2/project/{project_id}/coupon/redeem

Redeems a coupon code. The user gets a bonus after a coupon is redeemed.

SecurityXsollaLoginUserJWT
Request
path Parameters
project_id
required
integer

Project ID. You can find this parameter in your Publisher Account next to the name of the project.

Example: 44056
Request Body schema: application/json
coupon_code
string [ 1 .. 128 ] characters
Default: "WINTER2021"

Unique coupon code. Contains letters and numbers.

object

The reward that is selected by a user. Object key is an SKU of a unit, and value is an SKU of one of the items in a unit.

property name*
additional property
string
Responses
200

Coupon was successfully redeemed.

401

Authentication not passed or wrong.

403

Authorization header not sent.

404

Enter valid coupon code.

422

Invalid request.

Request samples
application/json
{
  • "coupon_code": "WINTER2021",
  • "selected_unit_items": {
    }
}
Response samples
application/json
{
  • "items": [
    ]
}