# 購入したアイテムをユーザーに付与する 指定されたユーザーインベントリに、指定された購入アイテムを追加します。 注意一度に処理できる操作は最大50個です。この制限を超える操作は無視されます。 Endpoint: POST /v2/project/{project_id}/inventory/purchase Version: 2.0.0 Security: basicAuth ## Path parameters: - `project_id` (integer, required) プロジェクトID。 ## Request fields (application/json): - `comment` (string) 操作説明。例:「毎月のチャレンジリワード」。 - `custom_parameters` (object) プロジェクト特有のパラメータ。 Example: {"array_param":[{"user_device_info":{"engine_version":"Unity 2020.2.0b5","os":"windows"},"user_public_id":{"nickname":"player1"}},{"user_device_info":{"engine_version":"UE 4.25","os":"mac"},"user_public_id":{"nickname":"player1"}}],"bool_param":true,"int_param":100,"null_param":null,"object_param":{"key":"value"}} - `items` (array, required) - `items.quantity` (number, required) このクラスのアイテムが付与されるために必要な数。 - `items.sku` (string, required) アイテムクラス識別子。SKUには、英小文字、ピリオド、ダッシュ、およびアンダースコアのみが含まれます。 - `platform` (string) ユーザーがプレイするパブリッシングプラットフォーム。 Enum: "playstation_network", "xbox_live", "xsolla", "pc_standalone", "nintendo_shop", "google_play", "app_store_ios", "android_standalone", "ios_standalone", "android_other", "ios_other", "pc_other" - `purchase` (object, required) - `purchase.amount` (string, required) 控除前の購入金額。 - `purchase.currency` (string, required) [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)に基づく通貨を購入します。 - `purchase.external_purchase_date` (string, required) ISO 8601に基づく購入日。 - `purchase.external_purchase_id` (string, required) 購入したプラットフォームからの購入インボイス識別子。 - `user` (object, required) - `user.id` (string) プラットフォーム上でユニークなユーザー識別子。 ## Response 200 fields (application/json): - `count` (integer) Example: 10 - `operations` (array) - `operations.amount` (string) 控除前の購入金額。 Example: "2.99" - `operations.comment` (string) 操作説明。例:「毎月のチャレンジリワード」。 Example: "Montly challange rewards" - `operations.currency` (string) [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)に基づく通貨を購入します。 Example: "USD" - `operations.custom_parameters` (object) プロジェクト特有のパラメータ。 Example: {"array_param":[{"user_device_info":{"engine_version":"Unity 2020.2.0b5","os":"windows"},"user_public_id":{"nickname":"player1"}},{"user_device_info":{"engine_version":"UE 4.25","os":"mac"},"user_public_id":{"nickname":"player1"}}],"bool_param":true,"int_param":100,"null_param":null,"object_param":{"key":"value"}} - `operations.external_purchase_date` (string) ISO 8601に基づく購入日。 Example: "2020-01-01T05:00:00+05:00" - `operations.external_purchase_id` (string) 購入したプラットフォームからの購入インボイス識別子。 Example: "10-534-35" - `operations.items` (array) - `operations.items.quantity` (integer) このクラスのアイテムが付与されるために必要な数。 Example: 1 - `operations.items.sku` (string) アイテムクラス識別子。SKUには、英小文字、ピリオド、ダッシュ、およびアンダースコアのみが含まれます。 Example: "com.xsolla.item_1" - `operations.order_id` (number) エクソラ側での操作説明。 Example: 123456 - `operations.platform` (string) ユーザーがプレイするパブリッシングプラットフォーム。 Enum: "playstation_network", "xbox_live", "xsolla", "pc_standalone", "nintendo_shop", "google_play", "app_store_ios", "android_standalone", "ios_standalone", "android_other", "ios_other", "pc_other" - `operations.user_id` (string) プラットフォーム上でユニークなユーザー識別子。 Example: "d.user" ## Response 422 fields (application/json): - `errorCode` (integer) エラーコード。 Example: 1102 - `errorMessage` (string) エラーメッセージ。 Example: "[0401-1102]: Unprocessable Entity. The property sku is required" - `statusCode` (integer) Example: 422