Xsolla-logo

Redeem promo code

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

Redeems a code of promo code promotion. After redeeming a promo code, the user will get free items and/or the price of the cart and/or particular items will be decreased.

Request
Security:
path Parameters
project_id
required
integer

Project ID.

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

Unique code of promo code. Contains letters and numbers.

object or null
object (Promotions_selected_unit_items)

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

Promo code 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": "SUMMER2021",
  • "cart": {
    },
  • "selected_unit_items": {
    }
}
Response samples
application/json
{
  • "cart_id": "cart_id",
  • "is_free": false,
  • "items": [
    ],
  • "price": {
    }
}