# カートにアイテムを入れる 現在のカートにアイテムを入れます。カートにすでに同じSKUのアイテムがある場合、既存のアイテムは渡された値で置き換えられます。 Endpoint: PUT /v2/admin/project/{project_id}/cart/fill Version: 2.0.0 Security: basicAuth ## Path parameters: - `project_id` (integer, required) プロジェクトID。このパラメータは、パブリッシャーアカウントのプロジェクト名の横にあります。 Example: 44056 ## Query parameters: - `locale` (string) 応答言語。ISO 639-1に基づく小文字の2文字言語コード。 ## Header parameters: - `x-user-for` (string) ユーザー識別子は、エクソーラログインユーザーJWTまたはペイステーションアクセストークンを使用して転送することができます。 Example: "ACCESS_TOKEN/LOGIN_JWT" - `x-user-id` (string) ゲーム付きカートを販売する場合、自分のユーザーIDを使用することができます。 Example: "UNIQUE_ID" ## Request fields (application/json): - `country` (string) [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)に従った2文字の大文字の国名コード。[エクソーラがサポートする国](https://developers.xsolla.com/ja/doc/shop-builder/references/supported-countries/)の詳細情報については、ドキュメントを確認してください。例:country=US Example: "US" - `currency` (string) カートに表示されるアイテム価格の通貨。[ISO4217規格](https://en.wikipedia.org/wiki/ISO_4217)詳細については、ドキュメントを参照してください。[エクソーラでサポートされている通貨](https://developers.xsolla.com/ja/doc/pay-station/references/supported-currencies/)。 Example: "USD" - `items` (array, required) - `items.quantity` (number, required) アイテムの数量。 Example: 2 - `items.sku` (string, required) 一意のアイテムID。SKUには、小文字と大文字のラテン英数字、ピリオド、ダッシュ、およびアンダースコアのみが含まれます。 Example: "t-shirt" ## Response 200 fields (application/json): - `cart_id` (string) カートID。購入ページや決済APIのエンドポイントへの問い合わせに渡します。 Example: "cart_id" - `is_free` (boolean) trueの場合で、カートは無料です。 - `items` (array) - `items.attributes` (array) アイテムに対応する属性と値のリスト。カタログのフィルタリングに使用できます。 Example: {"value":{"external_id":"genre","name":"Жанр","values":[{"external_id":"genre_e3364991f92e751689a68b96598a5a5a84010b85","value":"Casual"},{"external_id":"genre_eba07bfd0f982940773cba3744d97264dd58acd7","value":"Strategy"},{"external_id":"genre_b8d0c6d8f0524c2b2d79ebb93aa3cd0e8b5199a8","value":"Mobile"}]}} - `items.attributes.external_id` (string) 一意の属性ID。external_idには、小文字と大文字のラテン英数字、ダッシュ、およびアンダースコアのみが含まれます。 Example: "attribute_1" - `items.attributes.name` (string) 属性名。 Example: "Genre" - `items.attributes.values` (array) - `items.attributes.values.external_id` (string) 属性の一意の値ID。external_idには、英小文字、ダッシュ、およびアンダースコアのみが含まれます。 Example: "attribute_value" - `items.attributes.values.value` (string) 属性値。 Example: "Strategy" - `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.is_bonus` (boolean) - `items.is_free` (boolean) trueの場合で、アイテムは無料です。 - `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) 1ユーザーあたりのユーザーが購入できるアイテムの最大数。 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.price` (object,null) アイテム価格。 - `items.price.amount` (string) - `items.price.amount_without_discount` (string) - `items.price.currency` (string) - `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.virtual_prices` (array) 仮想価格。 - `items.virtual_prices.amount` (integer) 割引を適用された仮想通貨建てのアイテム価格。 Example: 100 - `items.virtual_prices.amount_without_discount` (integer) 仮想通貨建てのアイテム価格。 Example: 200 - `items.virtual_prices.description` (string,null) 仮想通貨の説明。 Example: "Most popular gold" - `items.virtual_prices.image_url` (string,null) 仮想通貨のイメージ。 Example: "http://image.png" - `items.virtual_prices.is_default` (boolean) アイテムの価格をデフォルトにするかどうか。 Example: true - `items.virtual_prices.name` (string) 仮想通貨名。 Example: "Gold" - `items.virtual_prices.sku` (string) 仮想通貨アイテムSKU。 Example: "gold" - `items.virtual_prices.type` (string) 仮想通貨のタイプ。 Example: "virtual_currency" - `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) カート価格。 - `promotions` (array) カート全体に適用されたプロモーション。この配列は、次の場合に返されます: * プロモーションがカート合計金額に影響する場合。例えば、購入割引設定が適用されたプロモーションコード。 * プロモーションがボーナスアイテムをカートに追加する場合。 注文レベルに適用されるプロモーションがない場合は、空の配列が返されます。 - `warnings` (array) - `warnings.errorCode` (integer) - `warnings.errorMessage` (string) ## Response 401 fields (application/json): - `errorCode` (integer) Example: 1020 - `errorMessage` (string) Example: "[0401-1020]: Error in Authentication method occurred" - `statusCode` (integer) Example: 401 ## Response 404 fields (application/json): - `errorCode` (integer) Example: 5008 - `errorMessage` (string) Example: "[0401-5008]: Could not find User" - `statusCode` (integer) Example: 404 ## Response 422 fields (application/json): - `errorCode` (integer) Example: 1401 - `errorMessage` (string) Example: "[0401-1401]: Invalid cart" - `statusCode` (integer) Example: 422