官方SDK的下载
Downloading SDK
Before you can download SDK, you need to have registered as a developer and able to login to Lazada Open Platform. The downloaded SDK is associated with the application.
Take the following steps to download SDK for your application:
- Login Lazada Open Platform and open the APP Console page.
- Click Manage in the App list to open the App Overview page.
- In the App Management navigation panel, click SDK Download.
- Click the Download button to download the SDK for the specific programming language.
Downloading SDK
Lazada开放平台
Lazada卖家中心
SDK简单测试
使用import lazop
导入官方SDK
简单测试返回目录列表示例
# -*- coding: utf-8 -*-
import lazop
# params 1 : gateway url
# params 2 : appkey
# params 3 : appSecret
client = lazop.LazopClient(url, appkey, appSecret)
# create a api request set GET mehotd
# default http method is POST
request = lazop.LazopRequest('/category/tree/get','GET')
# simple type params ,Number ,String
request.add_api_param('api_id','1')
response = client.execute(request)
#response = client.execute(request,access_token)
# response type nil,ISP,ISV,SYSTEM
# nil :no error
# ISP : API Service Provider Error
# ISV : API Request Client Error
# SYSTEM : Lazop platform Error
print(response.type)
# response code, 0 is no error
print(response.code)
# response error message
print(response.message)
# response unique id
print(response.request_id)
# full response
print(response.body)
对于马来站params 1
参数设置为'https://api.lazada.com.my/rest'
appkey
是int变量,appSecret
是string变量,去后台App Console
查看。response.body
最后返回的是json
格式数据
变量添加
通过request.add_api_param('api_id','1')
以键值对的方式添加需要的变量
需要添加的变量在API说明页面的Request Parameters
添加商品
获取类目ID
1.可以使用GetCategoryTree获取目录树
文档
client = lazop.LazopClient(url, appkey ,appSecret)
request = lazop.LazopRequest('/category/tree/get','GET')
response = client.execute(request)
print(response.type)
print(response.body)
2.也可以在卖家后台Batch上传里面下载Excel文件
常用ID
Men's Shoes and Clothing > Men Clothing > T-Shirts & Tanks > T-Shirts --- 4195
CreateProduct API
CreateProduct payload and parameter description
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。