ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

【代码开源】GreaterWMS 抖音SDK调用教程

2022-03-31 12:32:48  阅读:466  来源: 互联网

标签:code 抖音 PropertyName spec GreaterWMS diy type id SDK


应用介绍

GreaterWMS 抖音SDK调用教程

SDK具体功能:

  • 1,一仓多店,多仓多店
  • 2,库存同步,商品同步
  • 3,快递发货,物流轨迹
  • 4,订单拦截
  • 5,字节云仓
  • 6,精选联盟
  • 7,供应分销
  • 8,售后退款,账单

对应的API链接

创建抖店

  • 去抖音官方创建个商家应用
  • 抖店应用会给到3个Key,APPID,APP_SECRET,SHOP_ID
  • 在GreaterWMS电商店铺中,抖音页面添加一个店铺
  • 填入之前获得的3个Key和店铺名称
  • GreaterWMS会给这个店铺生成一个唯一值,用来实现一仓多店的唯一性

沙箱环境开启

{
  "t_code": "{ 你刚才在GreaterWMS会给这个店铺生成一个唯一值 }",
  "sandbox": "{ 将sandbox调整成开启还是关闭,开始是1,关闭是0 }"
}
  • 由此来控制店铺是否正式运营上线,默认是正式环境

代理IP开启

{
  "t_code": "{ 你刚才在GreaterWMS会给这个店铺生成一个唯一值 }",
  "proxy": "{ 将代理调整成开启还是关闭,开始是1,关闭是0 }",
  "proxy_ip": "{ 代理ip,是一个json数据 }"
}

 

安装

    pip install GreaterWMS_DouYin-1.0.0-py3-none-any.whl
  • 版本的更新,安装的插件名会不同,请自行调整版本
  • 注册app
INSTALLED_APPS = [
    '...',
    '...',
    'douyin'
]

API调用例子

# 在views.py
from douyin.views.ding_dan.order_searchList import OrderSearchList

class Test(OrderSearchList):
    def __init__(self):
        self.params = {}
        self.param.product_id = "3539925204033339668"
        self.param.out_product_id = "11111"
        self.param.show_draft = "true"

# urls.py
from django.urls import path
from .views import Test

urlpatterns = [
    path(r'test/', Test.as_view({"post": "create"}), name="test")
]
  • 接下来只要向这个接口POST一个之前提到的店铺唯一值,"t_code" 就可以获取数据
回调的示例
{
  "data": {
    "account_template_id": "1",
    "after_sale_service": "{\"supply_7day_return\":\"2\"}",
    "appoint_delivery_day": "2",
    "brand_id": "12344",
    "car_vin_code": "VIN11111111111111",
    "category_detail": {
      "first_cid": "23264",
      "first_cname": "教育培训",
      "fourth_cid": "0",
      "fourth_cname": "-",
      "second_cid": "0",
      "second_cname": "学习卡",
      "third_cid": "0",
      "third_cname": "-"
    },
    "cdf_category": "1",
    "check_status": "1",
    "create_time": "2021-03-29 15:52:52",
    "delivery_delay_day": "2",
    "delivery_method": "7",
    "description": "<img src=\\\"https://tosv.boe.byted.org/obj/temai/54cbf542128eff94a3549284817c0af5bf5c2960www800-800\\\" style=\\\"width:100%;\\\">",
    "discount_price": "12000",
    "draft_status": "2",
    "extra": "-",
    "img": "https://xxxx.byted.org/obj/temai/54cbf542128eff94a3549284817c0af5bf5c2960www800-800",
    "is_create": "1",
    "is_sub_product": "true",
    "limit_per_buyer": "5",
    "logistics_info": {
      "brand_country_id": "123",
      "customs_clear_type": "1",
      "net_weight_qty": "100",
      "origin_country_id": "123",
      "source_country_id": "123",
      "tax_payer": "0"
    },
    "market_price": "12000",
    "maximum_per_order": "5",
    "minimum_per_order": "1",
    "mobile": "15677775555",
    "name": "xxx爽肤水",
    "need_recharge_mode": "false",
    "open_user_id": "1",
    "out_product_id": "11111",
    "outer_product_id": "11111",
    "pay_type": "1",
    "pic": "[\"https://sf6-ttcdn-tos.pstatp.com/obj/temai/0c71ce6acb4e3b508e0d30042b1a94262818ab41www800-800\"]",
    "poi_resource": {
      "coupon_return_methods": "[1]"
    },
    "presell_config_level": "2",
    "presell_delay": "4",
    "presell_type": "1",
    "price_has_tax": "0",
    "product_format": "{\"货号\":\"8888\"}",
    "product_format_new": "{\"1088\":[{\"Value\":0,\"Name\":\"小33学二年级\",\"PropertyId\":1088,\"PropertyName\":\"适用学龄段\",\"diy_type\":1}],\"1319\":[{\"Value\":0,\"Name\":\"1\",\"PropertyId\":1319,\"PropertyName\":\"适用地区\",\"diy_type\":0}],\"1618\":[{\"Value\":0,\"Name\":\"9787218122861\",\"PropertyId\":1618,\"PropertyName\":\"ISBN编号\",\"diy_type\":0}],\"1831\":[{\"Value\":0,\"Name\":\"小学英语看图说话写话二年级\",\"PropertyId\":1831,\"PropertyName\":\"书名\",\"diy_type\":0}],\"2000\":[{\"Value\":34762,\"Name\":\"无\",\"PropertyId\":2000,\"PropertyName\":\"作者地区\",\"diy_type\":0}],\"2229\":[{\"Value\":0,\"Name\":\"1\",\"PropertyId\":2229,\"PropertyName\":\"编者\",\"diy_type\":0}],\"3271\":[{\"Value\":0,\"Name\":\"1\",\"PropertyId\":3271,\"PropertyName\":\"出版时间\",\"diy_type\":0}],\"449\":[{\"Value\":0,\"Name\":\"1\",\"PropertyId\":449,\"PropertyName\":\"作者\",\"diy_type\":0}],\"501\":[{\"Value\":7310,\"Name\":\"否\",\"PropertyId\":501,\"PropertyName\":\"是否是套装\",\"diy_type\":0}],\"855\":[{\"Value\":0,\"Name\":\"陕西人民教育出版社\",\"PropertyId\":855,\"PropertyName\":\"出版社名称\",\"diy_type\":0}]}",
    "product_id": "3539925204033339668",
    "product_id_str": "3539925204033339668",
    "quality_list": [
      {
        "quality_attachments": [
          {
            "media_type": "1",
            "url": "http://www.byted***.com/YYYY"
          }
        ],
        "quality_key": "3457***9470978",
        "quality_name": "进货凭证"
      }
    ],
    "recommend_remark": "真的很好啊",
    "spec_id": "1",
    "spec_pics": [
      {
        "pic": "temai/b637513c50b994f4c89de56a17886caca5d6569awww800-800",
        "spec_detail_id": "1695459998447656"
      }
    ],
    "spec_prices": [
      {
        "code": "aaa",
        "customs_report_info": {
          "bar_code": "-",
          "first_measure_qty": "1",
          "first_measure_unit": "-",
          "g_model": "-",
          "hs_code": "1564564",
          "report_brand_name": "-",
          "report_name": "-",
          "second_measure_qty": "1",
          "second_measure_unit": "-",
          "unit": "-",
          "usage": "-"
        },
        "lock_step_stock_num": "1",
        "lock_stock_num": "1",
        "out_sku_id": "0",
        "outer_sku_id": "0",
        "presell_delay": "5",
        "price": "102",
        "prom_step_stock_num": "0",
        "prom_stock_num": "0",
        "promotion_step_stock_num": "0",
        "promotion_stock_num": "0",
        "sku_id": "1695459998495774",
        "sku_type": "0",
        "spec_detail_id1": "1695459998494734",
        "spec_detail_id2": "1695459998494734",
        "spec_detail_id3": "0",
        "spec_detail_ids": "[1695459998494734, 1695459998494766]",
        "step_stock_num": "0",
        "stock_num": "13",
        "stock_num_map": {},
        "supplier_id": "123",
        "tax_exemption_sku_info": {
          "is_suit": "1",
          "suit_num": "10",
          "volume": "100"
        }
      }
    ],
    "specs": [
      {
        "id": "1713023986705415",
        "is_leaf": "0",
        "name": "颜色",
        "pid": "1713023986705415",
        "spec_id": "1713023983665214",
        "values": [
          {
            "id": "1695459998447656",
            "is_leaf": "1",
            "name": "红色",
            "pid": "1695459998447640",
            "spec_id": "1713023983665214",
            "status": "1"
          }
        ]
      }
    ],
    "standard_brand_id": "121354",
    "status": "1",
    "update_time": "2021-03-29T15:52:52+08:00"
  },
  "err_no": 0,
  "message": "success",
  "code": 10000,
  "msg": "success",
  "sub_code": "",
  "sub_msg": ""
}
  • 一定要POST店铺唯一值,这样系统才会判断是哪个店铺发起的请求

 

消息推送

# 在views.py
from douyin.views.notify import NotifyAPI

class Notify(NotifyAPI):
    def __init__(self):
        self.params = {}

# urls.py
from django.urls import path
from .views import Notify

urlpatterns = [
    path(r'notify/', Notify.as_view({"post": "create"}), name="notify")
]
  • 接下来只要向这个接口POST一个之前提到的店铺唯一值,"t_code" 就可以获取数据
  • 一定要POST店铺唯一值,这样系统才会判断是哪个店铺发起的请求
功能

下载地址
https://community.56yhz.com/plugMarket/118.html


技术交流群
 

 




标签:code,抖音,PropertyName,spec,GreaterWMS,diy,type,id,SDK
来源: https://www.cnblogs.com/elaineZ/p/16081170.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有