# 쿠폰 코드 사용

쿠폰 코드를 사용합니다. 쿠폰이 사용되면 사용자는 보너스를 받습니다. 


  참고
    이 API 호출은 인증을 위해 사용자 JWT를 사용합니다.
    이 토큰은 Authorization 헤더에 다음 형식으로 포함해야 합니다: Bearer &lt;user_JWT&gt;. 사용자 JWT에 대한 자세한 내용은 이 호출의 보안 블록을 참조하십시오.

Endpoint: POST /v2/project/{project_id}/coupon/redeem
Version: 2.0.0
Security: XsollaLoginUserJWT

## Path parameters:

  - `project_id` (integer, required)
    프로젝트 ID. 이 매개 변수는 프로젝트 이름 옆의 관리자 페이지에서 또는 프로젝트 작업 시 브라우저 주소 표시줄에서 확인할 수 있습니다. URL 형식은 다음과 같습니다: https://publisher.xsolla.com//projects/.
    Example: 44056

## Request fields (application/json):

  - `coupon_code` (string)
    고유한 쿠폰 코드입니다. 문자와 숫자를 포함합니다.
    Example: "WINTER2021"

  - `selected_unit_items` (object)
    사용자가 보너스로 선택한 플랫폼 전용 게임 키. 키로 [received](/ko/api/liveops/promotions-coupons/get-coupon-rewards-by-code#promotions-coupons/get-coupon-rewards-by-code/t=response&c=200&path=bonus/item) bonus.item.sku를 전달학고 값으로 선택된 bonus.item.unit_items.sku를 전달합니다.

## 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.sku` (string)

  - `items.groups` (array)

  - `items.groups.external_id` (string)

  - `items.groups.name` (string)

  - `items.name` (string,null)

  - `items.price` (object,null)
    아이템 가격입니다.

  - `items.price.amount` (string)
    할인된 아이템 가격입니다.
    Example: "2.9900"

  - `items.price.amount_without_discount` (string)
    아이템 가격입니다.
    Example: "2.9900"

  - `items.price.currency` (string)
    아이템 가격 통화입니다. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)에 따른 3자리 코드입니다.
    Example: "USD"

  - `items.type` (string)

  - `items.virtual_item_type` (string)
    가상 아이템의 유형입니다.

사용 가능한 값: - consumable - 사용 후 인벤토리에서 사라지는 아이템(예: 탄약). - non_consumable - 인벤토리에 무기한으로 남아 있는 아이템. - non_renewing_subscription - 일정 기간 동안 서비스나 콘텐츠에 대한 이용 권한을 나타낼 수 있는 기간 한정 아이템.
    Enum: "consumable", "non_consumable", "non_renewing_subscription"

  - `items.virtual_prices` (array)

  - `items.description` (string)

  - `items.image_url` (string)

  - `items.quantity` (integer)

  - `items.is_free` (boolean)

  - `items.attributes` (array)

## Response 401 fields (application/json):

  - `statusCode` (integer)
    Example: 401

  - `errorCode` (integer)
    Example: 1501

  - `errorMessage` (string)
    Example: "[0401-1501]: Authorization failed: Provide authorization"

## Response 403 fields (application/json):

  - `statusCode` (integer)
    Example: 403

  - `errorCode` (integer)

  - `errorMessage` (string)
    Example: "Authorization header not sent."

  - `transactionId` (string)
    Example: "x-x-x-x-transactionId-mock-x-x-x"

## Response 404 fields (application/json):

  - `statusCode` (integer)
    Example: 404

  - `errorCode` (integer)
    Example: 4001

  - `errorMessage` (string)
    Example: "[0401-9807]: Enter valid coupon code."

## Response 422 fields (application/json):

  - `statusCode` (integer)
    Example: 422

  - `errorCode` (integer)
    Example: 1102

  - `errorMessage` (string)
    Example: "[0401-1102]: Unprocessable Entity. The property `coupon_code` is required"

  - `transactionId` (string)
    Example: "x-x-x-x-transactionId-mock-x-x-x"


