有赞新零售社区

发帖
API使用问题»发布网店商品API报错 计量属性,数据不匹配,不是无规格商品

[API调用-商品/交易] 发布网店商品API报错 计量属性,数据不匹配,不是无规格商品

唐亿万 2023-02-06 590 浏览 3 评论 | 只看楼主 [打印]  关闭
发布发布网店商品API youzan.retail.open.online.spu.release.3.0.0 报错121002010 ,提示 "计量属性,数据不匹配,不是无规格商品"
返回结果:
  1. array(4) {
  2.   ["trace_id"]=>
  3.   string(33) "yz7-0ae85be1-1675657863476-254050"
  4.   ["code"]=>
  5.   int(121002010)
  6.   ["success"]=>
  7.   bool(false)
  8.   ["message"]=>
  9.   string(50) "计量属性,数据不匹配,不是无规格商品"
  10. }
复制代码

请求参数如下:

  1. array(19) {
  2.   ["picture"]=>
  3.   string(143) "[{"url":"https:\/\/img01.yzcdn.cn\/upload_files\/2023\/02\/03\/Fsz5wjq904MmuSnQ8L4KKMASO9Dn.png","height":"500","id":5964745559,"width":"500"}]"
  4.   ["spu_code"]=>
  5.   string(14) "BM287147576452"
  6.   ["components_extra_id"]=>
  7.   int(117922704)
  8.   ["sold_time"]=>
  9.   int(0)
  10.   ["title"]=>
  11.   string(21) "测试创建商品1-1"
  12.   ["is_virtual"]=>
  13.   int(0)
  14.   ["is_display"]=>
  15.   int(0)
  16.   ["pre_sale"]=>
  17.   bool(false)
  18.   ["tag_ids"]=>
  19.   array(0) {
  20.   }
  21.   ["price"]=>
  22.   string(5) "99999"
  23.   ["purchase_right"]=>
  24.   bool(false)
  25.   ["hide_stock"]=>
  26.   int(1)
  27.   ["item_weight"]=>
  28.   int(1200)
  29.   ["sku_image"]=>
  30.   array(4) {
  31.     ["img_urls"]=>
  32.     array(2) {
  33.       [0]=>
  34.       array(2) {
  35.         ["id"]=>
  36.         int(11)
  37.         ["img_url"]=>
  38.         string(79) "https://img01.yzcdn.cn/upload_files/2023/02/03/Fsz5wjq904MmuSnQ8L4KKMASO9Dn.png"
  39.       }
  40.       [1]=>
  41.       array(2) {
  42.         ["id"]=>
  43.         int(12)
  44.         ["img_url"]=>
  45.         string(79) "https://img01.yzcdn.cn/upload_files/2023/02/03/Fsz5wjq904MmuSnQ8L4KKMASO9Dn.png"
  46.       }
  47.     }
  48.     ["dict_id"]=>
  49.     int(11)
  50.     ["dict_value"]=>
  51.     string(7) "1瓶装"
  52.     ["is_show"]=>
  53.     bool(true)
  54.   }
  55.   ["stocks"]=>
  56.   array(2) {
  57.     [0]=>
  58.     array(5) {
  59.       ["skus"]=>
  60.       array(1) {
  61.         [0]=>
  62.         array(4) {
  63.           ["k"]=>
  64.           string(6) "数量"
  65.           ["kid"]=>
  66.           int(1)
  67.           ["v"]=>
  68.           string(7) "1瓶装"
  69.           ["vid"]=>
  70.           int(11)
  71.         }
  72.       }
  73.       ["related_spu_code"]=>
  74.       string(14) "BM287147576452"
  75.       ["price"]=>
  76.       string(5) "99999"
  77.       ["sell_stock_count"]=>
  78.       string(2) "10"
  79.       ["related_sku_code"]=>
  80.       string(14) "BM287147576452"
  81.     }
  82.     [1]=>
  83.     array(5) {
  84.       ["skus"]=>
  85.       array(1) {
  86.         [0]=>
  87.         array(4) {
  88.           ["k"]=>
  89.           string(6) "数量"
  90.           ["kid"]=>
  91.           int(1)
  92.           ["v"]=>
  93.           string(7) "2瓶装"
  94.           ["vid"]=>
  95.           int(12)
  96.         }
  97.       }
  98.       ["related_spu_code"]=>
  99.       string(14) "BM287147576452"
  100.       ["price"]=>
  101.       string(5) "99999"
  102.       ["sell_stock_count"]=>
  103.       string(2) "20"
  104.       ["related_sku_code"]=>
  105.       string(14) "BM287147576452"
  106.     }
  107.   }
  108.   ["origin"]=>
  109.   string(3) "399"
  110.   ["content"]=>
  111.   string(203) "<p><img src="https://img.alicdn.com/imgextra/i2/883075047/O1CN010fZfgH1n9ZWmqkcHP_!!883075047.jpg"/></p><p><img src="https://img01.yzcdn.cn/upload_files/2022/12/05/Fvrfo15WZuA85HPT8ESULW-N9IsJ.jpg"/></p>"
  112.   ["sell_point"]=>
  113.   string(15) "好用,好用"
  114.   ["total_stock"]=>
  115.   string(2) "50"
  116. }
复制代码






本帖最后由 唐亿万 于 2023-2-6 12:33 编辑
用手机打开
收藏 ··· 回复
    唐亿万 青铜   2023-02-06 | 只看该作者
    sku 相关的信息,那些字段需要大概是这种规格项




    唐亿万 青铜   2023-02-06 | 只看该作者
    请求参数:
    1. $params = [
    2.             'picture' => json_encode([
    3.                 [
    4.                     "url" => "https://img01.yzcdn.cn/upload_files/2023/02/03/Fsz5wjq904MmuSnQ8L4KKMASO9Dn.png",
    5.                     "height" => "500",
    6.                     "id" => 5964745559,
    7.                     "width" => "500"
    8.                 ]]),
    9.             'spu_code' => 'BM287147576452',
    10.             'components_extra_id' => 117922704,//商品页模版Id
    11.             'sold_time' => 0,
    12.             'title' => '测试创建商品1-发布有规格商品1',
    13.             'is_virtual' => 0,
    14.             'is_display' => 0,
    15.             'pre_sale' => false,
    16.             'tag_ids' => [],
    17.             'price' => "99999",
    18.             'purchase_right' => false,
    19.             'hide_stock' => 1,
    20.             'item_weight' => 500,
    21.             'sku_image' => [
    22.                 'img_urls' => [
    23.                     [
    24.                         'id' => 11,
    25.                         'img_url' => 'https://img01.yzcdn.cn/upload_files/2023/02/03/Fsz5wjq904MmuSnQ8L4KKMASO9Dn.png',
    26.                     ],
    27.                     [
    28.                         'id' => 12,
    29.                         'img_url' => 'https://img01.yzcdn.cn/upload_files/2023/02/03/Fsz5wjq904MmuSnQ8L4KKMASO9Dn.png',
    30.                     ]
    31.                 ],
    32.                 'dict_id' => 11,
    33.                 'dict_value' => '1瓶装',
    34.                 'is_show' => true,
    35.             ],
    36.             'stocks' => [
    37.                 [
    38.                     'skus' => [
    39.                         [
    40.                             'k' => '数量',
    41.                             'kid' => 1,
    42.                             'v' => '1瓶装',
    43.                             'vid' => 11,
    44.                         ]
    45.                     ],
    46.                     'related_spu_code' => 'BM287147576452',
    47.                     'price' => '99999',
    48.                     'max_retail_price' => '99999',
    49.                     'sell_stock_count' => '10',
    50.                     'related_sku_code' => 'BM287147576452',
    51.                 ],
    52.                 [
    53.                     'skus' => [
    54.                         [
    55.                             'k' => '数量',
    56.                             'kid' => 1,
    57.                             'v' => '2瓶装',
    58.                             'vid' => 12,
    59.                         ]
    60.                     ],
    61.                     'related_spu_code' => 'BM287147576452',
    62.                     'price' => '99999',
    63.                     'max_retail_price' => '99999',
    64.                     'sell_stock_count' => '20',
    65.                     'related_sku_code' => 'BM287147576452',
    66.                 ]
    67.             ],
    68.             'item_sku_meas_props' => [
    69.                 [
    70.                     'sku_code' => 'BM287147576452',
    71.                     's1' => 11,
    72.                     'weight' => 500,
    73.                 ],
    74.                 [
    75.                     'sku_code' => 'BM287147576452',
    76.                     's1' => 12,
    77.                     'weight' => 500,
    78.                 ]
    79.             ],
    80.             'origin' => '399',
    81.             'content' => '<p><img src="https://img01.yzcdn.cn/upload_files/2023/02/03/Fsz5wjq904MmuSnQ8L4KKMASO9Dn.png"/></p><p><img src="https://img01.yzcdn.cn/upload_files/2022/12/05/Fvrfo15WZuA85HPT8ESULW-N9IsJ.jpg"/></p><p><img src="https://img.alicdn.com/imgextra/i2/883075047/O1CN010fZfgH1n9ZWmqkcHP_!!883075047.jpg"/></p>',
    82.             'sell_point' => '好用,好用',//商品卖点
    83.             'total_stock' => "30",
    84.         ];
    复制代码

      您好,多规格商品只传item_sku_meas_props.weight即可,无规格商品只传item_weight即可。
      加载更多

      1跳至
      您需要登录后才可以回帖 登录 | 立即注册

      本版积分规则

      复制链接
      新浪微博
      QQ空间
      微信扫码
      • 回复

      • 评分

      客服工作时间是9:00-18:00,客服妹子当前不在线,若不能及时回复请谅解。试试右上角的搜索吧,论坛有丰富的经验贴、公告贴,相信一定能够帮到您~

      复制成功