# 프로모션 코드 사용 프로모션 코드 프로모션용 코드를 사용합니다. 프로모션 코드를 사용하면 사용자가 무료 아이템을 받게 되며, 장바구니 및/또는 특정 아이템의 가격이 할인됩니다. Endpoint: POST /v2/project/{project_id}/promocode/redeem Version: 2.0.0 Security: AuthForCart ## Path parameters: - `project_id` (integer, required) 프로젝트 ID입니다. 이 매개 변수는 관리자 페이지의 프로젝트 이름 옆에서 확인할 수 있습니다. Example: 44056 ## Request fields (application/json): - `cart` (object,null) - `cart.id` (string, required) 장바구니 ID입니다. - `coupon_code` (string) 고유한 프로모션 코드입니다. 문자와 숫자를 포함합니다. Example: "SUMMER2021" - `selected_unit_items` (object) 사용자가 선택한 보상입니다. 개체 키는 단위의 SKU이며 값은 단위의 아이템 중 하나의 SKU입니다. Example: {"game_1":"game_1_steam","game_2":"game_2_playstation"} ## Response 200 fields (application/json): - `cart_id` (string) 장바구니 ID입니다. Example: "cart_id" - `is_free` (boolean) true일 경우 아이템은 무료입니다. - `items` (array) Example: [{"attributes":[],"can_be_bought":{"$ref":"../schemas/Can_be_bought.yaml"},"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,"limits":{"$ref":"../schemas/Catalog_item_limits.yaml"},"name":"Xsolla Booster Mega","periods":{"$ref":"../schemas/item-periods.yaml"},"price":{"amount":"50.0000000000000000","amount_without_discount":"100.0000000000000000","currency":"USD"},"promotions":{"$ref":"../schemas/Catalog_item_promotions.yaml"},"quantity":123,"sku":"com.xsolla.booster_mega_1","type":"virtual_good","virtual_item_type":"consumable","virtual_prices":[],"vp_rewards":{"$ref":"../schemas/reward-chain-client/client-item-value-point-reward.yaml"}}] - `items.can_be_bought` (boolean) true일 경우 사용자는 아이템을 구매할 수 있습니다. Example: true - `items.description` (string) - `items.groups` (array) - `items.groups.external_id` (string) - `items.groups.name` (string) - `items.image_url` (string) - `items.limits` (object,null) 아이템 제한 사항입니다. - `items.limits.per_item` (object,null) 한 개 아이템에 대한 아이템 제한 사항입니다. - `items.limits.per_item.available` (integer) 모든 사용자가 구매할 수 있는 남은 아이템 수량. Example: 3 - `items.limits.per_item.total` (integer) 모든 사용자가 구매할 수 있는 최대 아이템 수량. Example: 5 - `items.limits.per_user` (object,null) 사용자 한 명에 대한 아이템 제한 사항입니다. - `items.limits.per_user.available` (integer) 현재 사용자가 구매할 수 있는 남은 아이템 수량. Example: 3 - `items.limits.per_user.limit_exceeded_visibility` (string) 구매 한도에 도달한 후 다음 한도 재설정 때까지 카탈로그 내 아이템의 표시 여부를 결정합니다. recurrent_schedule 배열에서 반복 한도 재설정이 구성된 아이템에 적용됩니다. 한도 재설정이 구성되지 않은 경우, limit_exceeded_visibility 값과 무관하게 구매 한도에 도달 후 해당 아이템은 카탈로그에 표시되지 않습니다. Enum: "show", "hide" - `items.limits.per_user.recurrent_schedule` (object) 아이템이 사용자의 반복 새로고침 기간을 제한합니다. - `items.limits.per_user.recurrent_schedule.interval_type` (string) 반복 새로고침 기간 유형입니다. Enum: "daily", "weekly", "monthly", "hourly" - `items.limits.per_user.recurrent_schedule.reset_next_date` (integer) 재설정 제한이 적용되는 날짜 및 시간입니다(Unix 타임스탬프) Example: 1677553200 - `items.limits.per_user.total` (integer) 사용자 한 명이 구매할 수 있는 최대 아이템 수량. Example: 5 - `items.periods` (array,null) 아이템 판매 기간입니다. - `items.periods.date_from` (string) 지정된 아이템을 판매할 수 있는 날짜입니다. Example: "2020-08-11T10:00:00+03:00" - `items.periods.date_until` (string,null) 지정된 아이템을 판매할 수 없게 되는 날짜입니다. null일 수 있습니다. Example: "2020-08-11T20:00:00+03:00" - `items.promotions` (array) 장바구니의 특정 아이템에 적용된 프로모션. 다음의 경우 배열이 반환됩니다. * 특정 아이템에 대한 할인 프로모션이 구성된 경우 * 선택한 아이템 할인 설정이 있는 프로모션 코드가 적용된 경우 적용된 아이템 수준 프로모션이 없는 경우 빈 배열이 반환됩니다. - `items.promotions.bonus` (array) - `items.promotions.bonus.bundle_type` (string) 보너스 번들 아이템 유형입니다. bundle 보너스 아이템 유형에서만 사용할 수 있습니다. Enum: "standard", "virtual_currency_package" - `items.promotions.bonus.image_url` (string) 보너스 아이템 이미지 URL입니다. physical_good 보너스 아이템 유형에는 사용할 수 없습니다. - `items.promotions.bonus.name` (string) 보너스 아이템 이름입니다. physical_good 보너스 아이템 유형에는 사용할 수 없습니다. - `items.promotions.bonus.quantity` (integer) - `items.promotions.bonus.sku` (string) - `items.promotions.bonus.type` (string) 보너스 아이템 유형입니다. Enum: "virtual_good", "virtual_currency", "bundle", "physical_good", "game_key", "nft" - `items.promotions.date_end` (string,null) - `items.promotions.date_start` (string,null) - `items.promotions.discount` (object,null) - `items.promotions.discount.percent` (string,null) - `items.promotions.discount.value` (string,null) - `items.promotions.limits` (object) - `items.promotions.limits.per_user` (object) - `items.promotions.limits.per_user.available` (integer) - `items.promotions.limits.per_user.total` (integer) - `items.type` (string) - `items.vp_rewards` (array) 가치 포인트 아이템 보상입니다. - `items.vp_rewards.amount` (integer) 가치 포인트의 금액입니다. - `items.vp_rewards.image_url` (string) 이미지 URL입니다. Example: "https://image.example.com" - `items.vp_rewards.is_clan` (boolean) 값 포인트가 클랜 보상 체인에서 사용되는지 여부입니다. Example: true - `items.vp_rewards.item_id` (integer) 내부의 고유 아이템 ID입니다. Example: 1 - `items.vp_rewards.name` (string) 가치 포인트 이름입니다. - `items.vp_rewards.sku` (string) 고유 가치 포인트 ID입니다. - `price` (object,null) 장바구니 가격입니다. Example: {"amount":"6150.0000000000000000","amount_without_discount":"6150.0000000000000000","currency":"USD"} - `price.amount` (string) Example: "6150.0000000000000000" - `price.amount_without_discount` (string) Example: "6150.0000000000000000" - `price.currency` (string) Example: "USD" - `rewards` (object) - `rewards.discount` (object,null) 퍼센트 할인입니다. 이 퍼센트를 사용하여 계산한 값을 사용하여 장바구니 항목의 가격을 낮추어 계산한 다음 소수점 이하 2자리로 반올림합니다. - `rewards.discounted_items` (array,null) 프로모션 코드로 할인한 아이템의 목록입니다. - `rewards.discounted_items.sku` (string, required) 아이템 SKU입니다. - `rewards.is_selectable` (boolean) true인 경우 사용자는 프로모션 코드를 사용하기 전에 보너스를 선택해야 합니다. ## 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 promo 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"