Xsolla-logo

Redeem coupon code

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.

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.

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": [
    ]
}