|
通过托管OAuth认证访问Zoho Inventory API。支持对商品、销售订单、发票、采购订单、账单、联系人、发货单和商品组进行完整的增删改查操作。
bash
https://gateway.maton.ai/zoho-inventory/inventory/v1/{endpoint}
网关会将请求代理到 www.zohoapis.com/inventory/v1,并自动注入您的OAuth令牌。
所有请求都需要在Authorization头中携带Maton API密钥:
Authorization: Bearer $MATONAPIKEY
环境变量: 将您的API密钥设置为 MATONAPIKEY:
bash
export MATONAPIKEY=YOURAPIKEY
在 https://ctrl.maton.ai 管理您的Zoho Inventory OAuth连接。
bash
python <
req = urllib.request.Request(https://ctrl.maton.ai/connections?app=zoho-inventory&status=ACTIVE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
python <
data = json.dumps({app: zoho-inventory}).encode()
req = urllib.request.Request(https://ctrl.maton.ai/connections, data=data, method=POST)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Content-Type, application/json)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
python <
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id})
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
响应:
json
{
connection: {
connection_id: 21fd90f9-5935-43cd-b6c8-bde9d915ca80,
status: ACTIVE,
creation_time: 2025-12-08T07:20:53.488460Z,
lastupdatedtime: 2026-01-31T20:03:32.593153Z,
url: https://connect.maton.ai/?session_token=...,
app: zoho-inventory,
metadata: {}
}
}
在浏览器中打开返回的 url 以完成OAuth授权。
bash
python <
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id}, method=DELETE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
如果您有多个Zoho Inventory连接,请使用 Maton-Connection 头指定要使用的连接:
bash
python <
req = urllib.request.Request(https://gateway.maton.ai/zoho-inventory/inventory/v1/items)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Maton-Connection, 21fd90f9-5935-43cd-b6c8-bde9d915ca80)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
如果省略,网关将使用默认(最早创建的)活动连接。
| 模块 | 端点 | 描述 |
|---|---|---|
| 商品 | /items | 产品和服务 |
| 商品组 |
bash
GET /zoho-inventory/inventory/v1/items
示例:
bash
python <
req = urllib.request.Request(https://gateway.maton.ai/zoho-inventory/inventory/v1/items)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
响应:
json
{
code: 0,
message: success,
items: [
{
item_id: 1234567890000,
name: Widget,
status: active,
sku: WDG-001,
rate: 25.00,
purchase_rate: 10.00,
is_taxable: true
}
],
page_context: {
page: 1,
per_page: 200,
hasmorepage: false
}
}
bash
GET /zoho-inventory/inventory/v1/items/{item_id}
bash
POST /zoho-inventory/inventory/v1/items
Content-Type: application/json
{
name: Widget,
rate: 25.00,
purchase_rate: 10.00,
sku: WDG-001,
item_type: inventory,
product_type: goods,
unit: pcs,
is_taxable: true
}
必填字段:
可选字段:
示例:
bash
python <
data = json.dumps({
name: Widget,
rate: 25.00,
purchase_rate: 10.00,
sku: WDG-001,
item_type: inventory,
product_type: goods,
unit: pcs
}).encode()
req = urllib.request.Request(https://gateway.maton.ai/zoho-inventory/inventory/v1/items, data=data, method=POST)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Content-Type, application/json)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
响应:
json
{
code: 0,
message: The item has been added.,
item: {
item_id: 1234567890000,
name: Widget,
status: active,
rate: 25.00,
purchase_rate: 10.00,
sku: WDG-001
}
}
bash
PUT /zoho-inventory/inventory/v1/items/{item_id}
Content-Type: application/json
{
name: Updated Widget,
rate: 30.00
}
bash
DELETE
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 zoho-inventory-1775886848 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 zoho-inventory-1775886848 技能
skillhub install zoho-inventory-1775886848
文件大小: 6.44 KB | 发布时间: 2026-4-12 12:05