アップデートのお知らせ

####Bカート本体にてアップデートされておりました下記項目につきまして、BカートAPIでも4つ目以降の項目を扱えるようにいたします。

  • 会員カスタム項目
  • 商品カスタム項目
  • 商品特徴
  • 商品セットカスタム項目

####上記対応により、既存のカスタム項目に関しましては2022年2月末日をもって廃止を予定しておりますので、それまでにご確認とご対応お願いいたします。

####またリクエスト上限の場合のエラーレスポンスにおいて、判別しずらい部分の仕様改善をいたします。

###アップデート実施日時 2021年8月 18日午前10:00頃より実施いたします。

###1.新しく追加されるエンドポイント

  1. 会員カスタム項目(customer_customs)
  2. 商品カスタム項目(product_customs)
  3. 商品セットカスタム項目(product_set_customs)

###2.項目が追加、変更されるエンドポイント

  1. 会員(customers)
  2. 商品(products)
  3. 商品セット(product_sets)
  4. 受注商品(order_products)
  5. 受注(orders)
  6. 出荷(logistics)

###3.一部の項目が削除予定のエンドポイント(2022年2月末日)

  1. 会員(customers)
  2. 商品(products)
  3. 商品セット(product_sets)
  4. 受注商品(order_products)
  5. 受注(orders)

###4.エラーレスポンスの変更点

  1. リクエスト上限、エラーレスポンス

###参考 Bカート本体側の変更点



###1.1 会員カスタム項目(customer_customs) エンドポイント追加{#customer_customs} 会員カスタム項目の設定が取得(GET)可能になります。
※ 更新(PATCH)、追加(POST)は不可

####レスポンス項目

キー名 Bカートでの名称 説明
id 会員カスタム項目ID 整数
name 項目名 文字列
is_active 状態 整数 無効=0、有効=1
input_type フォームタイプ 文字列 text/textarea/select/check/radioのいずれか
input_choices 選択肢の登録 配列 text、textareaの場合はnull
input_choices[view_name] 文字列 選択肢の表示名
input_choices[value] 文字列 選択肢の値
show_flag 会員への表示・変更 整数 0=表示・変更させる,1=表示させる・変更させない,2=表示しない
required 入力確認 文字列 true=必須,false=任意
sort_priority 表示順 数値 -127~127

####レスポンスサンプル
{
    "customer_customs": [
        {
            "id": 11,
            "name": "銀行名(会員カスタム項目1)",
            "is_active": 1,
            "input_type": "text",
            "input_choices": null,
            "show_flag": 2,
            "required": true,
            "sort_priority": 1,
            "created_at": "2021-03-05 16:24:10",
            "updated_at": "2021-06-11 14:51:35"
        },
        {
            "id": 13,
            "name": "実店舗の有無(会員カスタム項目3)",
            "is_active": 1,
            "input_type": "select",
            "input_choices": [
                {
                    "view_name": "無し",
                    "value": 0
                },
                {
                    "view_name": "有",
                    "value": 1
                }
            ],
            "show_flag": 1,
            "required": true,
            "sort_priority": 0,
            "created_at": "2021-03-05 16:24:10",
            "updated_at": "2021-06-11 14:44:15"
        }
    ]
}


###1.2 商品カスタム項目(product_customs) エンドポイント追加{#product_customs} 商品カスタム項目の設定が取得(GET)可能になります。
※ 更新(PATCH)、追加(POST)は不可

####レスポンス項目

キー名 Bカートでの名称 説明
id 商品カスタム項目ID 整数
name 項目名 文字列
is_active 状態 整数 無効=0、有効=1
show_flag サイトへの表示設定 整数 0=非表示,1=表示,2=会員のみ表示
is_html HTML利用 整数 0=利用しない,1=利用する
sort_priority 表示順 数値 -127~127

####レスポンスサンプル
{
    "product_customs": [
        {
            "id": 14,
            "name": "生産者",
            "is_active": 1,
            "show_flag": 1,
            "is_html": 1,
            "sort_priority": 0,
            "created_at": "2021-04-08 11:03:38",
            "updated_at": "2021-06-11 14:43:45"
        }
    ]
}


###1.3 商品セットカスタム項目(product_set_customs) エンドポイント追加{#product_set_customs} 商品セットカスタム項目の設定が取得(GET)可能になります。
※ 更新(PATCH)、追加(POST)は不可

####レスポンス項目

キー名 Bカートでの名称 説明
id 商品セットカスタム項目ID 整数
name 項目名 文字列
is_active 状態 整数 無効=0、有効=1
show_flag サイトへの表示設定 整数 0=非表示,1=表示,2=会員のみ表示
is_html HTML利用 整数 0=利用しない,1=利用する
sort_priority 表示順 数値 -127~127

####レスポンスサンプル
{
    "product_set_customs": [
        {
            "id": 17,
            "name": "倉庫番号",
            "is_active": 1,
            "show_flag": 1,
            "is_html": 1,
            "sort_priority": 0,
            "created_at": "2021-04-08 11:03:38",
            "updated_at": "2021-06-11 14:43:45"
        }
    ]
}


###会員(customers)の変更点{#customers} 新しいキーで会員カスタム項目の取得(GET)、更新(PATCH)、追加(POST)が可能になります(4つ目以降の項目が扱えます)。
更新、追加の場合は取得時の配列形式でのリクエストが可能です。

また今回のアップデートでは既存のcustome1,2,3も引き続きお使いいただけますが、2022年2月末日をもって廃止予定となります。 カスタム項目をお使いいただく場合は、期限までにcustomsをお使いいただくようにご対応お願いいたします。
※ 更新、追加時にcustom1,2,3とcustomsが混在する場合、customsのデータ優先されます。

####2.1 追加される項目

キー名 項目名
customs 会員カスタム項目 配列
customs[field_id] 会員カスタム項目ID 整数
customs[value] 文字列

####3.1 廃止予定の項目(2022年2月末日) | キー名 | 項目名 | 型 | 値 | |:-----------|:-----------|:-----------|:-----------| | custom1| 会員カスタム項目1 | 文字列 | | | custom2| 会員カスタム項目2 | 文字列 | | | custom3| 会員カスタム項目3 | 文字列 | |
####レスポンス、リクエストサンプル ``` { "customers": [ { ~~~~~~~~~~~~ 一部省略 ~~~~~~~~~~~~ "custom1": "カスタム1", "custom2": "カスタムオプション1", "custom3": "なし", "customs": [ { "field_id": 11, "value": "カスタム1" }, { "field_id": 12, "value": "カスタムオプション1" }, { "field_id": 13, "value": "なし" }, { "field_id": 22, "value": "カスタム4" } ], ~~~~~~~~~~~~ 一部省略 ~~~~~~~~~~~~ } ] } ```

###商品(products)の変更点{#products} 新しいキーで商品カスタム項目の取得(GET)、更新(PATCH)、追加(POST)が可能になります(4つ目以降の項目が扱えます)。
更新、追加の場合は取得時の配列形式でのリクエストが可能です。
商品特徴は「new」「recommend」「limited」以外のBカート本体で作成した商品特徴(識別文字列)で取得(GET)、更新(PATCH)、追加(POST)が可能になります。

また今回のアップデートでは既存のcustome1,2,3も引き続きお使いいただけますが、2022年2月末日をもって廃止予定となります。 カスタム項目をお使いいただく場合は、期限までにcustomsをお使いいただくようにご対応お願いいたします。
※ 更新、追加時にcustom1,2,3とcustomsが混在する場合、customsのデータ優先されます。

####2.2 追加される項目

キー名 項目名
customs 商品カスタム項目 配列
customs[field_id] 商品カスタム項目ID 整数
customs[value] 文字列

####2.2 変更のある項目 | キー名 | 項目名 | 型 | 値 | |:-----------|:-----------|:-----------|:-----------| | tag| 商品特徴 | 文字列 | new/recommend/limited/Bカート本体で作成した識別文字列 |
####3.1廃止予定の項目(2022年2月末日) | キー名 | 項目名 | 型 | 値 | |:-----------|:-----------|:-----------|:-----------| | custom1| 商品カスタム項目1 | 文字列 | | | custom2| 商品カスタム項目2 | 文字列 | | | custom3| 商品カスタム項目3 | 文字列 | |
####レスポンス、リクエストサンプル ``` { "products": [ { ~~~~~~~~~~~~ 一部省略 ~~~~~~~~~~~~ "tag" : "new,recommend,limited,spring_sale", "custom1": "基本カスタム1", "custom2": "基本カスタム2", "custom3": "基本カスタム3", "customs": [ { "field_id": 14, "value": "基本カスタム1" }, { "field_id": 15, "value": "基本カスタム2" }, { "field_id": 16, "value": "基本カスタム3" }, { "field_id": 20, "value": "基本カスタム4" } ] ~~~~~~~~~~~~ 一部省略 ~~~~~~~~~~~~ } ] } ```

###商品セット(product_sets)の変更点{#product_sets} 新しいキーで商品セットカスタム項目の取得(GET)、更新(PATCH)、追加(POST)が可能になります(4つ目以降の項目が扱えます)。
更新、追加の場合は取得時の配列形式でのリクエストが可能です。

また今回のアップデートでは既存のcustome1,2,3も引き続きお使いいただけますが、2022年2月末日をもって廃止予定となります。 カスタム項目をお使いいただく場合は、期限までにcustomsをお使いいただくようにご対応お願いいたします。
※ 更新、追加時にcustom1,2,3とcustomsが混在する場合、customsのデータ優先されます。

####2.3 追加される項目

キー名 項目名
customs 商品セットカスタム項目 配列
customs[field_id] 商品セットカスタム項目ID 整数
customs[value] 文字列

####3.3 廃止予定の項目(2022年2月末日) | キー名 | 項目名 | 型 | 値 | |:-----------|:-----------|:-----------|:-----------| | custom1| 商品セットカスタム項目1 | 文字列 | | | custom2| 商品セットカスタム項目2 | 文字列 | | | custom3| 商品セットカスタム項目3 | 文字列 | |
####レスポンス、リクエストサンプル ``` { "product_sets": [ { ~~~~~~~~~~~~ 一部省略 ~~~~~~~~~~~~ "custom1": "セットカスタム1", "custom2": "セットカスタム2", "custom3": "セットカスタム3", "customs": [ { "field_id": 17, "value": "セットカスタム1" }, { "field_id": 18, "value": "セットカスタム2" }, { "field_id": 19, "value": "セットカスタム3" }, { "field_id": 21, "value": "セットカスタム4" } ] ~~~~~~~~~~~~ 一部省略 ~~~~~~~~~~~~ } ] } ```

###受注商品(order_products)の変更点{#order_products} 新しいキーで商品カスタム項目と商品セットカスタム項目の取得(GET)、更新(PATCH)が可能になります(4つ目以降の項目が扱えます)。
更新の場合は取得時の配列形式でのリクエストが可能です。

また今回のアップデートでは既存のpro_custom1,2,3、set_custom1,2,3も引き続きお使いいただけますが、2022年2月末日をもって廃止予定となります。 カスタム項目をお使いいただく場合は、期限までにproduct_customs、product_set_customsをお使いいただくようにご対応お願いいたします。
※ 更新、追加時にpro_custom1,2,3、set_custom1,2,3とproduct_customs、product_set_customsが混在する場合、product_customs、product_set_customsのデータ優先されます。

####2.4 追加される項目

キー名 項目名
product_customs 商品カスタム項目 配列
product_customs[field_id] 商品カスタム項目ID 整数
product_customs[value] 文字列
product_set_customs 商品セットカスタム項目 配列
product_set_customs[field_id] 商品セットカスタム項目ID 整数
product_set_customs[value] 文字列

####3.4 廃止予定の項目(2022年2月末日) | キー名 | 項目名 | 型 | 値 | |:-----------|:-----------|:-----------|:-----------| | pro_custom1| 商品カスタム項目1 | 文字列 | | | pro_custom2| 商品カスタム項目2 | 文字列 | | | pro_custom3| 商品カスタム項目3 | 文字列 | | | set_custom1| 商品セットカスタム項目1 | 文字列 | | | set_custom2| 商品セットカスタム項目2 | 文字列 | | | set_custom3| 商品セットカスタム項目3 | 文字列 | |
####レスポンス、リクエストサンプル ``` { "order_products": [ { ~~~~~~~~~~~~ 一部省略 ~~~~~~~~~~~~ "pro_custom1": "基本カスタム1", "pro_custom2": "基本カスタム2", "pro_custom3": "基本カスタム3", "product_customs": [ { "field_id": 14, "value": "基本カスタム1" }, { "field_id": 15, "value": "基本カスタム2" }, { "field_id": 16, "value": "基本カスタム3" }, { "field_id": 20, "value": "基本カスタム4" } ], "set_custom1": "セットカスタム1", "set_custom2": "セットカスタム2", "set_custom3": "セットカスタム3", "product_set_customs": [ { "field_id": 17, "value": "セットカスタム1" }, { "field_id": 18, "value": "セットカスタム2" }, { "field_id": 19, "value": "セットカスタム3" }, { "field_id": 21, "value": "セットカスタム4" } ], "options": null } ] } ```

###受注(orders)の変更点{#orders} 新しいキーで注文者 カスタム項目の取得(GET)、更新(PATCH)が可能になります(4つ目以降の項目が扱えます)。
更新の場合は取得時の配列形式でのリクエストが可能です。
complete=1パラメータで取得する場合には、order_producsのカスタム項目にも新しいキーが追加となります。詳細は受注商品の変更点をご確認ください。

また今回のアップデートでは既存のcustomer_custom1,2,3も引き続きお使いいただけますが、2022年2月末日をもって廃止予定となります。 カスタム項目をお使いいただく場合は、期限までにcustomer_customsをお使いいただくようにご対応お願いいたします。
※ 更新、追加時にcustomer_custom1,2,3とcustomer_customsが混在する場合、customer_customsのデータ優先されます。

####2.5 追加される項目

キー名 項目名
customer_customs 会員カスタム項目 配列
customer_customs[field_id] 会員カスタム項目ID 整数
customer_customs[value] 文字列

####3.5 廃止予定の項目(2022年2月末日) | キー名 | 項目名 | 型 | 値 | |:-----------|:-----------|:-----------|:-----------| | customer_custom1 | 会員カスタム項目1 | 文字列 | | | customer_custom2 | 会員カスタム項目2 | 文字列 | | | customer_custom3 | 会員カスタム項目3 | 文字列 | |
####レスポンス、リクエストサンプル ``` { "orders": [ { ~~~~~~~~~~~~ 一部省略 ~~~~~~~~~~~~ "customer_custom1": "カスタム1", "customer_custom2": "カスタムオプション1", "customer_custom3": "なし", "customer_customs": [ { "field_id": 11, "value": "カスタム1" }, { "field_id": 12, "value": "カスタムオプション1" }, { "field_id": 13, "value": "なし" }, { "field_id": 22, "value": "カスタム4" } ] ~~~~~~~~~~~~ 一部省略 ~~~~~~~~~~~~ } ] } ```

###2.6 出荷(logistics)の変更点{#logistics} complete=1パラメータで取得する場合には、order_producsのカスタム項目にも新しいキーが追加となります。詳細は受注商品の変更点の変更点)をご確認ください。



###4.1 リクエスト上限、エラーレスポンス{#request-limit} 従来リクエスト上限の場合にはステータスコード : 500、エラーレスポンスボディ : { "errors": "Internal Server Error" }となっておりましたが、 他のエラーと混在する場合に判別がつかない状態となっていました。
その為、明確に判別できるようにステータスコード : 429、エラーレスポンスボディ { "errors": "Too Many Attempts" }に変更いたします。
またリクエスト上限の場合のみ、解除までの時間を取得できるように下記ヘッダーを追加して返却いたします。

####追加されるヘッダー

ヘッダー名 項目名
Retry-After 制限解除までの時間、単位(秒)