# 주문 취소(결제 및 거래 세부 정보 포함)

사용자, 파트너 또는 자동으로 결제가 취소된 경우 엑솔라 측에서 지정된 URL로 order_canceled 웹훅을 
전송합니다. 웹훅에는 반품된 아이템 정보, 결제 데이터, 취소된 주문의 세부 정보가 포함되어 있습니다.

결제에 실패할 경우 웹훅이 전송되지 않습니다. 예:
* 결제 UI가 열렸지만 사용자가 주문을 결제하지 않은 경우
* 결제 UI가 열렸지만 결제 중 오류가 발생한 경우

권장되는 웹훅 처리 시간은 3초 이내입니다.

Endpoint: POST order-cancellation
Version: 1.0

## Request fields (application/json):

  - `billing` (object)
    거래 및 결제 세부 정보.

  - `billing.notification_type` (string, required)
    알림 유형.

  - `billing.payment_details` (object, required)
    결제 내역 관련 값.

  - `billing.payment_details.country_wht` (object)
    국경 간 거래로 인해 특정 국가에 적용되는 원천징수 비용에 대한 데이터가 포함된 개체입니다.

  - `billing.payment_details.country_wht.amount` (number)
    금액.

  - `billing.payment_details.country_wht.currency` (string)
    통화. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)에 따른 3자리 통화 코드입니다.

  - `billing.payment_details.country_wht.percent` (number)
    원천징수 비용 비율의 백분율.

  - `billing.payment_details.direct_wht` (object)
    직접 원천징수세.

  - `billing.payment_details.direct_wht.amount` (number)
    금액.

  - `billing.payment_details.direct_wht.currency` (string)
    통화. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)에 따른 3자리 통화 코드입니다.

  - `billing.payment_details.direct_wht.percent` (number)
    직접 원천징수세율.

  - `billing.payment_details.payment` (object)
    게임유저 결제 데이터 관련 값.

  - `billing.payment_details.payment.amount` (number)
    금액.

  - `billing.payment_details.payment.currency` (string)
    통화. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)에 따른 3자리 통화 코드입니다.

  - `billing.payment_details.payment_method_fee` (object)
    결제 방식 수수료율.

  - `billing.payment_details.payment_method_fee.amount` (number)
    금액.

  - `billing.payment_details.payment_method_fee.currency` (string)
    통화. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)에 따른 3자리 통화 코드입니다.

  - `billing.payment_details.payment_method_sum` (object)
    결제 방법에서 청구된 금액에 대한 데이터가 포함된 값.

  - `billing.payment_details.payment_method_sum.amount` (number)
    금액.

  - `billing.payment_details.payment_method_sum.currency` (string)
    통화. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)에 따른 3자리 통화 코드입니다.

  - `billing.payment_details.payout` (object)
    지급 내역 관련 값.

  - `billing.payment_details.payout.amount` (number)
    금액.

  - `billing.payment_details.payout.currency` (string)
    통화. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)에 따른 3자리 통화 코드입니다.

  - `billing.payment_details.payout_currency_rate` (string)
    결제 통화를 지급 통화로 환전할 때의 환율.

  - `billing.payment_details.repatriation_commission` (object)
    본국 송금 비용에 대한 데이터가 있는 오브젝트. 타사가 엑솔라에 부과.

  - `billing.payment_details.repatriation_commission.amount` (number)
    금액.

  - `billing.payment_details.repatriation_commission.currency` (string)
    통화. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)에 따른 3자리 통화 코드입니다.

  - `billing.payment_details.sales_tax` (object)
    판매세(미국과 캐나다만 해당).

  - `billing.payment_details.sales_tax.amount` (number)
    금액.

  - `billing.payment_details.sales_tax.currency` (string)
    통화. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)에 따른 3자리 통화 코드입니다.

  - `billing.payment_details.sales_tax.percent` (number)
    판매세율.

  - `billing.payment_details.user_acquisition_fee` (object)
    제휴 네트워크 및 인플루언서를 통한 구매에 대해 공제된 사용자 확보 수수료의 총액(대상)입니다.

  - `billing.payment_details.user_acquisition_fee.amount` (number)
    금액.

  - `billing.payment_details.user_acquisition_fee.currency` (string)
    통화. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)에 따른 3자리 통화 코드입니다.

  - `billing.payment_details.user_acquisition_fee.percent` (number)
    사용자 확보 수수료율(%).

  - `billing.payment_details.vat` (object)
    VAT 세율(유럽연합만 해당).

  - `billing.payment_details.vat.amount` (number)
    금액.

  - `billing.payment_details.vat.currency` (string)
    통화. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)에 따른 3자리 통화 코드입니다.

  - `billing.payment_details.vat.percent` (number)
    부가가치세율.

  - `billing.payment_details.xsolla_balance_sum` (object)
    엑솔라 잔액에서 청구된 금액에 대한 데이터가 포함된 값.

  - `billing.payment_details.xsolla_balance_sum.amount` (number)
    금액.

  - `billing.payment_details.xsolla_balance_sum.currency` (string)
    통화. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)에 따른 3자리 통화 코드입니다.

  - `billing.payment_details.xsolla_fee` (object)
    엑솔라 수수료 요율.

  - `billing.payment_details.xsolla_fee.amount` (number)
    금액.

  - `billing.payment_details.xsolla_fee.currency` (string)
    통화. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)에 따른 3자리 통화 코드입니다.

  - `billing.purchase` (object)
    구매 데이터 관련 값.

  - `billing.purchase.subscription` (object)
    정기결제 내역 관련 값.

  - `billing.purchase.subscription.amount` (number)
    구매 금액입니다.

  - `billing.purchase.subscription.currency` (string)
    통화. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)에 따른 3자리 통화 코드입니다.

  - `billing.purchase.subscription.date_create` (string)
    정기결제 생성 날짜입니다. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)에 따른 날짜 및 시간입니다.

  - `billing.purchase.subscription.plan_id` (string)
    요금제 ID(API를 통해 생성된 경우, 외부 ID).

  - `billing.purchase.subscription.subscription_id` (integer)
    엑솔라 시스템 내의 정기결제 ID입니다.

  - `billing.purchase.subscription.tags` (array)
    플랜 태그.

  - `billing.purchase.total` (object, required)
    구매 총 가격 데이터 관련 값.

  - `billing.purchase.total.amount` (number)
    총 구매 금액.

  - `billing.purchase.total.currency` (string)
    통화. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)에 따른 3자리 통화 코드입니다.

  - `billing.refund_details` (object)
    환불 세부 정보(개체).

  - `billing.refund_details.author` (string)
    환불 시작자. 필드 값이 다음 표에 따라 전달됩니다.


    
    
        환불 시작자
        필드 값
    
    
    
    
        게임(API를 통해).
        API
    
    
        Account user (automatic refund).
        사용자 이메일
    
    
        Account user (with assistance from Xsolla customer support).
        support@xsolla.com
    
    
        엑솔라(엑솔라 고객 지원의 도움을 받아).
        support@xsolla.com

  - `billing.refund_details.code` (integer)
    코드 ID.

  - `billing.refund_details.reason` (string)
    환불 이유.

  - `billing.settings` (object)
    사용자 정의 프로젝트 설정(개체).

  - `billing.settings.merchant_id` (integer)
    판매자 ID입니다.

  - `billing.settings.project_id` (integer)
    Project ID. You can find this parameter in your [account](/ko/webhooks/overview/#business-accounts) next to the name of the project.

  - `billing.transaction` (object, required)
    트랜잭션 데이터 관련 값.

  - `billing.transaction.agreement` (integer)
    계약 ID.

  - `billing.transaction.dry_run` (integer)
    테스트 트랜잭션. 테스트 트랜잭션의 경우 매개 변수는 1개 값을 갖습니다. 또는, 트랜잭션이 실제로 이루어지는 경우 매개 변수가 전송되지 않습니다.

  - `billing.transaction.external_id` (string)
    트랜잭션 외부 ID.

  - `billing.transaction.id` (integer)
    트랜잭션 ID.

  - `billing.transaction.payment_method_order_id` (string)
    결제 시스템의 결제 ID.

  - `custom_parameters` (object)
    추가 정보입니다.

  - `items` (array, required)
    사용자가 구매한 아이템 목록입니다.

The set of parameters included in the array depends on the webhook version. 
Version 2 includes additional parameters: is_free, is_bonus, and 
is_bundle_content. To switch the version, pass its number in the version 
parameter in the [Update webhook version](/ko/api/catalog/common-webhooks/update-webhook-version/) API call.

  - `notification_type` (string, required)
    알림 유형.

  - `order` (object, required)
    주문에 대한 정보입니다.

  - `order.amount` (string, required)
    선택한 통화를 기준으로 한 장바구니의 총 비용입니다.

  - `order.comment` (string,null, required)
    주문에 대한 사용자의 코멘트.

  - `order.coupons` (array)
    적용된 쿠폰. 쿠폰을 적용되지 않았으면 배열이 돌아오지 않습니다.

  - `order.coupons.code` (string)
    적용된 쿠폰 코드.

  - `order.coupons.external_id` (string)
    외부 ID.

  - `order.currency` (string, required)
    주문 통화. 가상 화폐는 SKU를 사용하고 실제 화폐는 3글자 [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 코드를 사용합니다.

  - `order.currency_type` (string, required)
    결제 통화 유형. 무료 주문의 경우 unknown 값이 지정됩니다.
    Enum: "real", "virtual", "unknown", "loyalty_point"

  - `order.id` (integer, required)
    엑솔라 측에서 사용자 주문의 고유 식별자입니다.

  - `order.invoice_id` (string,null, required)
    실질 화폐 결제 인보이스 ID. 인게임 재화 결제 또는 무료 아이템은 null 값을 사용합니다.

  - `order.mode` (string, required)
    결제 모드. 실제 결제에는 default를 사용합니다. 테스트 결제에는 sandbox를 사용합니다.
    Enum: "default", "sandbox"

  - `order.platform` (string,null, required)
    결제 플랫폼. 엑솔라를 통한 결제에 xsolla 값을 사용합니다. 다른 결제의 경우 playstation_network, xbox_live, pc_standalone, nintendo_shop, google_play, app_store_ios, android_standalone, ios_standalone, android_other, ios_other, pc_other와 같이 게임 퍼블리싱 플랫폼의 이름에 해당하는 값을 사용합니다.
    Enum: "xsolla", "playstation_network", "xbox_live", "pc_standalone", "nintendo_shop", "google_play", "app_store_ios", "android_standalone", "ios_standalone", "android_other", "ios_other", "pc_other"

  - `order.promocodes` (array)
    적용된 프로모션 코드. 프로모션 코드가 적용되지 않았으면 배열이 돌아오지 않습니다.

  - `order.promocodes.code` (string)
    적용된 프로모션 코드의 코드.

  - `order.promocodes.external_id` (string)
    외부 ID.

  - `order.promotions` (array, required)
    전체 주문에 프로모션을 적용했습니다.
배열은 다음의 경우에 반환됩니다.
  - 프로모션이 총 구매 금액에 영향을 미치는 경우(예: 구매 할인 설정이 적용된 프로모션 코드).
  - 구매에 할인이 적용되지 않지만, 보너스 아이템이 주문에 추가된 경우. 이 경우, 할인이 적용된 가격([amount_with_discount](/ko/webhooks/#operation/order-cancellation!path=order/promotions/amount_with_discount&t=request)) 및 할인이 적용되지 않은 가격([amount_without_discount](/ko/webhooks/#operation/order-cancellation!path=order/promotions/amount_without_discount&t=request))은 할인이 적용되지 않으므로 반환되고 동일하게 유지됩니다.

주문 수준 프로모션이 적용되지 않으면 빈 배열이 반환됩니다.

  - `order.promotions.amount_with_discount` (string)
    할인이 적용된 아이템의 총 비용.

  - `order.promotions.amount_without_discount` (string)
    할인이 미적용된 아이템의 총 비용.

  - `order.promotions.sequence` (integer)
    프로모션 신청 순서입니다.

  - `order.status` (string, required)
    주문 상태.

  - `user` (object, required)
    사용자 정보.

  - `user.country` (string)
    사용자의 국가. [ISO 3166-1 alpha-2 standard](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)에 따른 2자로 된 국가 코드를 사용합니다.

  - `user.email` (string, required)
    사용자 이메일 주소.

  - `user.external_id` (string, required)
    사용자 ID.


## Response 200 fields

## Response 400 fields
