# Canjear código de cupón Canjea un código de cupón. El usuario recibe una bonificación tras canjear un cupón. Endpoint: POST /v2/project/{project_id}/coupon/redeem Version: 2.0.0 Security: XsollaLoginUserJWT ## Path parameters: - `project_id` (integer, required) ID del proyecto. Encontrará este parámetro en su Cuenta del editor junto al nombre del proyecto. Example: 44056 ## Request fields (application/json): - `coupon_code` (string) Código único de cupón. Contiene letras y números. Example: "WINTER2021" - `selected_unit_items` (object) La recompensa que selecciona un usuario. La clave del objeto es un SKU de una unidad, y el valor es un SKU de uno de los artículos de una unidad. Example: {"game_1":"game_1_steam","game_2":"game_2_playstation"} ## Response 200 fields (application/json): - `items` (array) Example: [{"attributes":[],"description":"Take it, take it all! All of Xsolla's riches in one Mega Booster.","groups":[{"external_id":"powerups","name":"Power Ups"}],"image_url":"https://cdn.xsolla.net/img/misc/images/e9f2f4a634bc96ea03b5d5ceadd7c55f.png","is_free":false,"name":"Xsolla Booster Mega","price":{"amount":"50.0000000000000000","amount_without_discount":"100.0000000000000000","currency":"USD"},"quantity":1,"sku":"com.xsolla.booster_mega_1","type":"virtual_good","virtual_item_type":"consumable","virtual_prices":[]}] - `items.attributes` (array) - `items.description` (string) - `items.groups` (array) - `items.groups.external_id` (string) - `items.groups.name` (string) - `items.image_url` (string) - `items.is_free` (boolean) - `items.price` (object,null) Precios de artículos. - `items.price.amount` (string) Precio del artículo con descuento. Example: "2.9900" - `items.price.amount_without_discount` (string) Precio del artículo. Example: "2.9900" - `items.price.currency` (string) Divisa del precio del artículo. Código de tres letras según [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). Example: "USD" - `items.quantity` (integer) - `items.sku` (string) - `items.type` (string) - `items.virtual_item_type` (string) Tipo de artículo virtual. Enum: "consumable", "non_consumable", "non_renewing_subscription" - `items.virtual_prices` (array) ## Response 401 fields (application/json): - `errorCode` (integer) Example: 1501 - `errorMessage` (string) Example: "[0401-1501]: Authorization failed: Provide authorization" - `statusCode` (integer) Example: 401 ## Response 403 fields (application/json): - `errorCode` (integer) - `errorMessage` (string) Example: "Authorization header not sent." - `statusCode` (integer) Example: 403 - `transactionId` (string) Example: "x-x-x-x-transactionId-mock-x-x-x" ## Response 404 fields (application/json): - `errorCode` (integer) Example: 4001 - `errorMessage` (string) Example: "[0401-9807]: Enter valid coupon code." - `statusCode` (integer) Example: 404 ## Response 422 fields (application/json): - `errorCode` (integer) Example: 1102 - `errorMessage` (string) Example: "[0401-1102]: Unprocessable Entity. The property `coupon_code` is required" - `statusCode` (integer) Example: 422 - `transactionId` (string) Example: "x-x-x-x-transactionId-mock-x-x-x"