# 注文キャンセル（支払いと取引の詳細を含む）

ユーザー、パートナー、またはシステムによって支払いがキャンセルされた場合、エクソーラは指定された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の詳細（オブジェクト；EUのみ）。

  - `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)
    VAT率。

  - `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を使用して作成された場合は外部）。

  - `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
    
    
        パブリッシャーアカウントのユーザー（自動返金）。
        ユーザーのメールアドレス
    
    
        パブリッシャー アカウント ユーザー（エクソラカスタマーサポートの支援を受けて)。
        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)
    プロジェクトID。このパラメータは、[ドメインページ](https://publisher.xsolla.com/)のプロジェクト名の横にあります。

  - `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](/ja/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)
    External ID。

  - `order.currency` (string, required)
    注文の通貨。仮想通貨はSKUを使用し、実際通貨は3文字の[ISO4217](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の値は、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)
    External ID。

  - `order.promotions` (array, required)
    注文全体に適用されたプロモーションです。
この配列は、次のいずれかのケースで返されます。：
  - 購入割引 設定のプロモーションコードなど、購入合計金額に影響するプロモーションが設定されている場合。
  - 購入に割引は適用されませんが、ボーナスアイテムが注文に追加される場合。この場合、割引ありのコスト（[amount_with_discount](/ja/webhooks/#operation/order-cancellation!path=order/promotions/amount_with_discount&t=request)）と割引なしのコスト（[amount_without_discount](/ja/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)
    ユーザーの国。2文字の国コード（大文字）は、[ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)に従って使用されます。

  - `user.email` (string, required)
    ユーザーのメールアドレス。

  - `user.external_id` (string, required)
    ユーザーID。


## Response 200 fields

## Response 400 fields
