简介
Zoho Inventory托管OAuth集成方案,支持商品、订单、发票、采购单等8大核心模块的CRUD操作,适合中小企业库存管理自动化。
原始描述
Zoho Inventory API integration with managed OAuth. Manage items, sales orders, invoices, purchase orders, bills, contacts, and shipments. Use this skill when...
通过你的 Agent 添加
安装目录:zohoinventory/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
Zoho Inventory Skill 是一个纯文档型 API 集成工具,通过 Maton Gateway 代理访问 Zoho Inventory 云端服务。用户需先在 maton.ai 获取 API Key 并完成 OAuth 授权,即可通过 RESTful API 对库存数据进行完整的 CRUD 操作。
认证流程:设置 MATON_API_KEY 环境变量 → 创建连接获取 connection_id → 浏览器完成 OAuth 授权 → 调用 gateway.maton.ai 代理端点。
主要功能模块:
- Items(商品):SKU 管理、定价、库存类型设置、税率配置
- Contacts(联系人):客户与供应商信息、地址簿、付款条款
- Sales Orders(销售订单):订单创建、状态流转(draft → confirmed → void)
- Invoices(发票):开票、邮件发送、付款记录、贷项管理
- Purchase Orders(采购单):向供应商下单、收货跟踪
- Bills(账单):应付账款管理、到期日控制
- Shipment Orders(发货单):物流跟踪、承运商对接
- Item Groups(商品组):多规格变体商品管理
典型调用模式:
curl -H "Authorization: Bearer $MATON_API_KEY" \
-H "Maton-Connection: {uuid}" \
https://gateway.maton.ai/zoho-inventory/inventory/v1/items
分页采用 page/per_page 机制,响应包含 has_more_page 指示器。
显著优点
- 零代码基础设施:无需自建 OAuth 服务或处理 token 刷新,Maton 托管层自动管理凭证生命周期
- 完整业务覆盖:8 大核心模块支撑从采购到销售的全链路库存管理,满足制造业、批发零售、电商等多场景
- 标准化接口:严格遵循 Zoho Inventory v1 API 规范,字段命名、数据类型、错误码与官方文档 1:1 对应
- 多连接支持:通过
Maton-Connection 头部可切换不同 Zoho 组织账号,适合代运营、多店铺管理场景
- 速率透明:明确标注各套餐日调用限额(Free 1K 至 Enterprise 10K),便于容量规划
潜在缺点与局限性
- 依赖第三方网关:所有流量经 Maton 代理,若网关故障或服务条款变更将直接影响可用性
- 功能边界受限:仅覆盖 Zoho Inventory 核心模块,未包含 Warehouse Transfer、Composite Items、Inventory Adjustments 等进阶功能
- 无实时推送机制:纯轮询式 REST API,不支持 Webhook,需自行实现增量同步逻辑
- 地域合规风险:数据经 Maton 中转,虽域名启用 TLS 1.2+,但未明确说明数据驻留区域(Zoho 本身支持 EU/US/IN/AU 数据中心,代理层可能打破此隔离)
- 错误处理粒度:网关层将 4xx/5xx 透传,但 400/401 可能混淆"连接缺失"与"参数错误",调试时需额外排查
适合人群
- 中小型企业主:已使用或计划采用 Zoho Inventory 作为 ERP,需快速对接自建系统
- 电商技术团队:需要自动化库存同步、订单履约流程的 Shopify/WooCommerce 定制开发者
- 财务自动化工程师:希望通过 API 批量生成发票、匹配收付款的财务系统整合场景
- 代运营服务商:管理多个客户 Zoho 账号,利用多连接功能实现统一控制台
常规风险
- OAuth 授权中断:Zoho 授权有效期有限,长期无人干预可能失效,需监控连接状态并设置提醒
- 速率超限:业务高峰期易触发 429 错误,建议实施指数退避重试与本地缓存
- 数据一致性:并发更新同一资源时可能产生竞态条件,关键业务需加锁或串行化处理
- API Key 泄露:环境变量方式虽安全,但在 CI/CD 日志、共享终端中仍有暴露风险,建议配合密钥管理服务
Maton-Connection 头部可切换不同 Zoho 组织账号,适合代运营、多店铺管理场景- 依赖第三方网关:所有流量经 Maton 代理,若网关故障或服务条款变更将直接影响可用性
- 功能边界受限:仅覆盖 Zoho Inventory 核心模块,未包含 Warehouse Transfer、Composite Items、Inventory Adjustments 等进阶功能
- 无实时推送机制:纯轮询式 REST API,不支持 Webhook,需自行实现增量同步逻辑
- 地域合规风险:数据经 Maton 中转,虽域名启用 TLS 1.2+,但未明确说明数据驻留区域(Zoho 本身支持 EU/US/IN/AU 数据中心,代理层可能打破此隔离)
- 错误处理粒度:网关层将 4xx/5xx 透传,但 400/401 可能混淆"连接缺失"与"参数错误",调试时需额外排查
适合人群
- 中小型企业主:已使用或计划采用 Zoho Inventory 作为 ERP,需快速对接自建系统
- 电商技术团队:需要自动化库存同步、订单履约流程的 Shopify/WooCommerce 定制开发者
- 财务自动化工程师:希望通过 API 批量生成发票、匹配收付款的财务系统整合场景
- 代运营服务商:管理多个客户 Zoho 账号,利用多连接功能实现统一控制台
常规风险
- OAuth 授权中断:Zoho 授权有效期有限,长期无人干预可能失效,需监控连接状态并设置提醒
- 速率超限:业务高峰期易触发 429 错误,建议实施指数退避重试与本地缓存
- 数据一致性:并发更新同一资源时可能产生竞态条件,关键业务需加锁或串行化处理
- API Key 泄露:环境变量方式虽安全,但在 CI/CD 日志、共享终端中仍有暴露风险,建议配合密钥管理服务
- OAuth 授权中断:Zoho 授权有效期有限,长期无人干预可能失效,需监控连接状态并设置提醒
- 速率超限:业务高峰期易触发 429 错误,建议实施指数退避重试与本地缓存
- 数据一致性:并发更新同一资源时可能产生竞态条件,关键业务需加锁或串行化处理
- API Key 泄露:环境变量方式虽安全,但在 CI/CD 日志、共享终端中仍有暴露风险,建议配合密钥管理服务
技能正文
name: zohoinventory
description: |
Zoho Inventory API integration with managed OAuth. Manage items, sales orders, invoices, purchase orders, bills, contacts, and shipments.
Use this skill when users want to read, create, update, or delete inventory items, sales orders, invoices, purchase orders, bills, or other inventory records in Zoho Inventory.
For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).
Requires network access and valid Maton API key.
metadata:
author: maton
version: "1.0"
Zoho Inventory
Access the Zoho Inventory API with managed OAuth authentication. Manage items, sales orders, invoices, purchase orders, bills, contacts, shipment orders, and item groups with full CRUD operations.
Quick Start
# List items
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/zoho-inventory/inventory/v1/items')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Base URL
https://gateway.maton.ai/zoho-inventory/inventory/v1/{endpoint}
# List items
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/zoho-inventory/inventory/v1/items')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
https://gateway.maton.ai/zoho-inventory/inventory/v1/{endpoint}
The gateway proxies requests to www.zohoapis.com/inventory/v1 and automatically injects your OAuth token.
Authentication
All requests require the Maton API key in the Authorization header:
Authorization: Bearer $MATON_API_KEY
Environment Variable: Set your API key as MATON_API_KEY:
export MATON_API_KEY="YOUR_API_KEY"
Getting Your API Key
- Sign in or create an account at maton.ai
- Go to maton.ai/settings
- Copy your API key
Connection Management
Manage your Zoho Inventory OAuth connections at https://ctrl.maton.ai.
List Connections
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=zoho-inventory&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Create Connection
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'zoho-inventory'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Get Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=zoho-inventory&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'zoho-inventory'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Get Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Response:
{
"connection": {
"connection_id": "21fd90f9-5935-43cd-b6c8-bde9d915ca80",
"status": "ACTIVE",
"creation_time": "2025-12-08T07:20:53.488460Z",
"last_updated_time": "2026-01-31T20:03:32.593153Z",
"url": "https://connect.maton.ai/?session_token=...",
"app": "zoho-inventory",
"metadata": {}
}
}
Open the returned url in a browser to complete OAuth authorization.
Delete Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Specifying Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
If you have multiple Zoho Inventory connections, specify which one to use with the Maton-Connection header:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/zoho-inventory/inventory/v1/items')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Maton-Connection', '21fd90f9-5935-43cd-b6c8-bde9d915ca80')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
If omitted, the gateway uses the default (oldest) active connection.
API Reference
Available Modules
| Module | Endpoint | Description |
|---|---|---|
| Items | /items |
Products and services |
| Item Groups | /itemgroups |
Grouped product variants |
| Contacts | /contacts |
Customers and vendors |
| Sales Orders | /salesorders |
Sales orders |
| Invoices | /invoices |
Sales invoices |
| Purchase Orders | /purchaseorders |
Purchase orders |
| Bills | /bills |
Vendor bills |
| Shipment Orders | /shipmentorders |
Shipment tracking |
Items
List Items
GET /zoho-inventory/inventory/v1/items
Example:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/zoho-inventory/inventory/v1/items')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Response:
{
"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,
"has_more_page": false
}
}
Get Item
GET /zoho-inventory/inventory/v1/items/{item_id}
Create Item
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
}
GET /zoho-inventory/inventory/v1/items/{item_id}
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
}
Required Fields:
name- Item name
Optional Fields:
rate- Sales pricepurchase_rate- Purchase costsku- Stock keeping unit (unique)item_type-inventory,sales,purchases, orsales_and_purchasesproduct_type-goodsorserviceunit- Unit of measurementis_taxable- Tax applicabilitytax_id- Tax identifierdescription- Item descriptionreorder_level- Reorder pointvendor_id- Preferred vendor
Example:
python <<'EOF'
import urllib.request, os, json
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.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Response:
{
"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"
}
}
Update Item
PUT /zoho-inventory/inventory/v1/items/{item_id}
Content-Type: application/json
{
"name": "Updated Widget",
"rate": 30.00
}
Delete Item
DELETE /zoho-inventory/inventory/v1/items/{item_id}
Item Status Actions
# Mark as active
POST /zoho-inventory/inventory/v1/items/{item_id}/active
# Mark as inactive
POST /zoho-inventory/inventory/v1/items/{item_id}/inactive
Contacts
List Contacts
GET /zoho-inventory/inventory/v1/contacts
PUT /zoho-inventory/inventory/v1/items/{item_id}
Content-Type: application/json
{
"name": "Updated Widget",
"rate": 30.00
}
DELETE /zoho-inventory/inventory/v1/items/{item_id}
Item Status Actions
# Mark as active
POST /zoho-inventory/inventory/v1/items/{item_id}/active
# Mark as inactive
POST /zoho-inventory/inventory/v1/items/{item_id}/inactive
Contacts
List Contacts
GET /zoho-inventory/inventory/v1/contacts
# Mark as active
POST /zoho-inventory/inventory/v1/items/{item_id}/active
# Mark as inactive
POST /zoho-inventory/inventory/v1/items/{item_id}/inactive
List Contacts
GET /zoho-inventory/inventory/v1/contacts
Query Parameters:
filter_by-Status.All,Status.Active,Status.Inactive,Status.Duplicate,Status.Crmsearch_text- Search across contact fieldssort_column-contact_name,first_name,last_name,email,created_time,last_modified_timecontact_name,company_name,email,phone- Field-specific filters
Example:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/zoho-inventory/inventory/v1/contacts')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Get Contact
GET /zoho-inventory/inventory/v1/contacts/{contact_id}
Create Contact
POST /zoho-inventory/inventory/v1/contacts
Content-Type: application/json
{
"contact_name": "Acme Corporation",
"contact_type": "customer",
"company_name": "Acme Corp",
"email": "billing@acme.com",
"phone": "+1-555-1234"
}
GET /zoho-inventory/inventory/v1/contacts/{contact_id}
POST /zoho-inventory/inventory/v1/contacts
Content-Type: application/json
{
"contact_name": "Acme Corporation",
"contact_type": "customer",
"company_name": "Acme Corp",
"email": "billing@acme.com",
"phone": "+1-555-1234"
}
Required Fields:
contact_name- Display name
Optional Fields:
contact_type-customerorvendorcompany_name- Legal entity nameemail- Email addressphone- Phone numberbilling_address- Address objectshipping_address- Address objectpayment_terms- Days for paymentcurrency_id- Currency identifierwebsite- Website URL
Update Contact
PUT /zoho-inventory/inventory/v1/contacts/{contact_id}
Delete Contact
DELETE /zoho-inventory/inventory/v1/contacts/{contact_id}
Contact Status Actions
# Mark as active
POST /zoho-inventory/inventory/v1/contacts/{contact_id}/active
# Mark as inactive
POST /zoho-inventory/inventory/v1/contacts/{contact_id}/inactive
Sales Orders
List Sales Orders
GET /zoho-inventory/inventory/v1/salesorders
PUT /zoho-inventory/inventory/v1/contacts/{contact_id}
DELETE /zoho-inventory/inventory/v1/contacts/{contact_id}
Contact Status Actions
# Mark as active
POST /zoho-inventory/inventory/v1/contacts/{contact_id}/active
# Mark as inactive
POST /zoho-inventory/inventory/v1/contacts/{contact_id}/inactive
Sales Orders
List Sales Orders
GET /zoho-inventory/inventory/v1/salesorders
# Mark as active
POST /zoho-inventory/inventory/v1/contacts/{contact_id}/active
# Mark as inactive
POST /zoho-inventory/inventory/v1/contacts/{contact_id}/inactive
List Sales Orders
GET /zoho-inventory/inventory/v1/salesorders
Example:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/zoho-inventory/inventory/v1/salesorders')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Get Sales Order
GET /zoho-inventory/inventory/v1/salesorders/{salesorder_id}
Create Sales Order
POST /zoho-inventory/inventory/v1/salesorders
Content-Type: application/json
{
"customer_id": "1234567890000",
"date": "2026-02-06",
"line_items": [
{
"item_id": "1234567890001",
"quantity": 5,
"rate": 25.00
}
]
}
GET /zoho-inventory/inventory/v1/salesorders/{salesorder_id}
POST /zoho-inventory/inventory/v1/salesorders
Content-Type: application/json
{
"customer_id": "1234567890000",
"date": "2026-02-06",
"line_items": [
{
"item_id": "1234567890001",
"quantity": 5,
"rate": 25.00
}
]
}
Required Fields:
customer_id- Customer identifierline_items- Array of items withitem_id,quantity,rate
Optional Fields:
salesorder_number- Auto-generated if not specified (do not specify if auto-generation is enabled)date- Order date (yyyy-mm-dd)shipment_date- Expected shipment datereference_number- External referencenotes- Internal notesterms- Terms and conditionsdiscount- Discount percentage or amountshipping_charge- Shipping costadjustment- Price adjustment
Update Sales Order
PUT /zoho-inventory/inventory/v1/salesorders/{salesorder_id}
Delete Sales Order
DELETE /zoho-inventory/inventory/v1/salesorders/{salesorder_id}
Sales Order Status Actions
# Mark as confirmed
POST /zoho-inventory/inventory/v1/salesorders/{salesorder_id}/status/confirmed
# Mark as void
POST /zoho-inventory/inventory/v1/salesorders/{salesorder_id}/status/void
Invoices
List Invoices
GET /zoho-inventory/inventory/v1/invoices
PUT /zoho-inventory/inventory/v1/salesorders/{salesorder_id}
DELETE /zoho-inventory/inventory/v1/salesorders/{salesorder_id}
Sales Order Status Actions
# Mark as confirmed
POST /zoho-inventory/inventory/v1/salesorders/{salesorder_id}/status/confirmed
# Mark as void
POST /zoho-inventory/inventory/v1/salesorders/{salesorder_id}/status/void
Invoices
List Invoices
GET /zoho-inventory/inventory/v1/invoices
# Mark as confirmed
POST /zoho-inventory/inventory/v1/salesorders/{salesorder_id}/status/confirmed
# Mark as void
POST /zoho-inventory/inventory/v1/salesorders/{salesorder_id}/status/void
List Invoices
GET /zoho-inventory/inventory/v1/invoices
Example:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/zoho-inventory/inventory/v1/invoices')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Get Invoice
GET /zoho-inventory/inventory/v1/invoices/{invoice_id}
Create Invoice
POST /zoho-inventory/inventory/v1/invoices
Content-Type: application/json
{
"customer_id": "1234567890000",
"line_items": [
{
"item_id": "1234567890001",
"quantity": 5,
"rate": 25.00
}
]
}
GET /zoho-inventory/inventory/v1/invoices/{invoice_id}
POST /zoho-inventory/inventory/v1/invoices
Content-Type: application/json
{
"customer_id": "1234567890000",
"line_items": [
{
"item_id": "1234567890001",
"quantity": 5,
"rate": 25.00
}
]
}
Required Fields:
customer_id- Customer identifierline_items- Array of items
Optional Fields:
invoice_number- Auto-generated if not specifieddate- Invoice date (yyyy-mm-dd)due_date- Payment due datepayment_terms- Days until duediscount- Discount percentage or amountshipping_charge- Shipping costnotes- Internal notesterms- Terms and conditions
Update Invoice
PUT /zoho-inventory/inventory/v1/invoices/{invoice_id}
Delete Invoice
DELETE /zoho-inventory/inventory/v1/invoices/{invoice_id}
Invoice Status Actions
# Mark as sent
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/status/sent
# Mark as draft
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/status/draft
# Void invoice
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/status/void
Invoice Email
# Email invoice to customer
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/email
# Get email content template
GET /zoho-inventory/inventory/v1/invoices/{invoice_id}/email
Invoice Payments
# List payments applied
GET /zoho-inventory/inventory/v1/invoices/{invoice_id}/payments
# Delete a payment
DELETE /zoho-inventory/inventory/v1/invoices/{invoice_id}/payments/{invoice_payment_id}
Invoice Credits
# List credits applied
GET /zoho-inventory/inventory/v1/invoices/{invoice_id}/creditsapplied
# Apply credits
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/credits
# Delete applied credit
DELETE /zoho-inventory/inventory/v1/invoices/{invoice_id}/creditsapplied/{creditnotes_invoice_id}
Invoice Comments
# List comments
GET /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments
# Add comment
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments
# Update comment
PUT /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments/{comment_id}
# Delete comment
DELETE /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments/{comment_id}
Purchase Orders
List Purchase Orders
GET /zoho-inventory/inventory/v1/purchaseorders
PUT /zoho-inventory/inventory/v1/invoices/{invoice_id}
DELETE /zoho-inventory/inventory/v1/invoices/{invoice_id}
Invoice Status Actions
# Mark as sent
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/status/sent
# Mark as draft
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/status/draft
# Void invoice
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/status/void
Invoice Email
# Email invoice to customer
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/email
# Get email content template
GET /zoho-inventory/inventory/v1/invoices/{invoice_id}/email
Invoice Payments
# List payments applied
GET /zoho-inventory/inventory/v1/invoices/{invoice_id}/payments
# Delete a payment
DELETE /zoho-inventory/inventory/v1/invoices/{invoice_id}/payments/{invoice_payment_id}
Invoice Credits
# List credits applied
GET /zoho-inventory/inventory/v1/invoices/{invoice_id}/creditsapplied
# Apply credits
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/credits
# Delete applied credit
DELETE /zoho-inventory/inventory/v1/invoices/{invoice_id}/creditsapplied/{creditnotes_invoice_id}
Invoice Comments
# List comments
GET /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments
# Add comment
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments
# Update comment
PUT /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments/{comment_id}
# Delete comment
DELETE /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments/{comment_id}
Purchase Orders
List Purchase Orders
GET /zoho-inventory/inventory/v1/purchaseorders
# Mark as sent
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/status/sent
# Mark as draft
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/status/draft
# Void invoice
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/status/void
# Email invoice to customer
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/email
# Get email content template
GET /zoho-inventory/inventory/v1/invoices/{invoice_id}/email
Invoice Payments
# List payments applied
GET /zoho-inventory/inventory/v1/invoices/{invoice_id}/payments
# Delete a payment
DELETE /zoho-inventory/inventory/v1/invoices/{invoice_id}/payments/{invoice_payment_id}
Invoice Credits
# List credits applied
GET /zoho-inventory/inventory/v1/invoices/{invoice_id}/creditsapplied
# Apply credits
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/credits
# Delete applied credit
DELETE /zoho-inventory/inventory/v1/invoices/{invoice_id}/creditsapplied/{creditnotes_invoice_id}
Invoice Comments
# List comments
GET /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments
# Add comment
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments
# Update comment
PUT /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments/{comment_id}
# Delete comment
DELETE /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments/{comment_id}
Purchase Orders
List Purchase Orders
GET /zoho-inventory/inventory/v1/purchaseorders
# List payments applied
GET /zoho-inventory/inventory/v1/invoices/{invoice_id}/payments
# Delete a payment
DELETE /zoho-inventory/inventory/v1/invoices/{invoice_id}/payments/{invoice_payment_id}
# List credits applied
GET /zoho-inventory/inventory/v1/invoices/{invoice_id}/creditsapplied
# Apply credits
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/credits
# Delete applied credit
DELETE /zoho-inventory/inventory/v1/invoices/{invoice_id}/creditsapplied/{creditnotes_invoice_id}
Invoice Comments
# List comments
GET /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments
# Add comment
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments
# Update comment
PUT /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments/{comment_id}
# Delete comment
DELETE /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments/{comment_id}
Purchase Orders
List Purchase Orders
GET /zoho-inventory/inventory/v1/purchaseorders
# List comments
GET /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments
# Add comment
POST /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments
# Update comment
PUT /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments/{comment_id}
# Delete comment
DELETE /zoho-inventory/inventory/v1/invoices/{invoice_id}/comments/{comment_id}
List Purchase Orders
GET /zoho-inventory/inventory/v1/purchaseorders
Example:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/zoho-inventory/inventory/v1/purchaseorders')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Get Purchase Order
GET /zoho-inventory/inventory/v1/purchaseorders/{purchaseorder_id}
Create Purchase Order
POST /zoho-inventory/inventory/v1/purchaseorders
Content-Type: application/json
{
"vendor_id": "1234567890000",
"line_items": [
{
"item_id": "1234567890001",
"quantity": 100,
"rate": 10.00
}
]
}
GET /zoho-inventory/inventory/v1/purchaseorders/{purchaseorder_id}
POST /zoho-inventory/inventory/v1/purchaseorders
Content-Type: application/json
{
"vendor_id": "1234567890000",
"line_items": [
{
"item_id": "1234567890001",
"quantity": 100,
"rate": 10.00
}
]
}
Required Fields:
vendor_id- Vendor identifierline_items- Array of items
Optional Fields:
purchaseorder_number- Auto-generated if not specified (do not specify if auto-generation is enabled)date- Order date (yyyy-mm-dd)delivery_date- Expected delivery datereference_number- External referenceship_via- Shipping methodnotes- Internal notesterms- Terms and conditions
Update Purchase Order
PUT /zoho-inventory/inventory/v1/purchaseorders/{purchaseorder_id}
Delete Purchase Order
DELETE /zoho-inventory/inventory/v1/purchaseorders/{purchaseorder_id}
Purchase Order Status Actions
# Mark as issued
POST /zoho-inventory/inventory/v1/purchaseorders/{purchaseorder_id}/status/issued
# Mark as cancelled
POST /zoho-inventory/inventory/v1/purchaseorders/{purchaseorder_id}/status/cancelled
Bills
List Bills
GET /zoho-inventory/inventory/v1/bills
PUT /zoho-inventory/inventory/v1/purchaseorders/{purchaseorder_id}
DELETE /zoho-inventory/inventory/v1/purchaseorders/{purchaseorder_id}
Purchase Order Status Actions
# Mark as issued
POST /zoho-inventory/inventory/v1/purchaseorders/{purchaseorder_id}/status/issued
# Mark as cancelled
POST /zoho-inventory/inventory/v1/purchaseorders/{purchaseorder_id}/status/cancelled
Bills
List Bills
GET /zoho-inventory/inventory/v1/bills
# Mark as issued
POST /zoho-inventory/inventory/v1/purchaseorders/{purchaseorder_id}/status/issued
# Mark as cancelled
POST /zoho-inventory/inventory/v1/purchaseorders/{purchaseorder_id}/status/cancelled
List Bills
GET /zoho-inventory/inventory/v1/bills
Example:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/zoho-inventory/inventory/v1/bills')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Get Bill
GET /zoho-inventory/inventory/v1/bills/{bill_id}
Create Bill
POST /zoho-inventory/inventory/v1/bills
Content-Type: application/json
{
"vendor_id": "1234567890000",
"bill_number": "BILL-001",
"date": "2026-02-06",
"due_date": "2026-03-06",
"line_items": [
{
"item_id": "1234567890001",
"quantity": 100,
"rate": 10.00
}
]
}
GET /zoho-inventory/inventory/v1/bills/{bill_id}
POST /zoho-inventory/inventory/v1/bills
Content-Type: application/json
{
"vendor_id": "1234567890000",
"bill_number": "BILL-001",
"date": "2026-02-06",
"due_date": "2026-03-06",
"line_items": [
{
"item_id": "1234567890001",
"quantity": 100,
"rate": 10.00
}
]
}
Required Fields:
vendor_id- Vendor identifierbill_number- Unique bill number (required, not auto-generated)date- Bill date (yyyy-mm-dd)due_date- Payment due dateline_items- Array of items
Optional Fields:
reference_number- External referencenotes- Internal notesterms- Terms and conditionscurrency_id- Currency identifierexchange_rate- Exchange rate for foreign currency
Update Bill
PUT /zoho-inventory/inventory/v1/bills/{bill_id}
Delete Bill
DELETE /zoho-inventory/inventory/v1/bills/{bill_id}
Bill Status Actions
# Mark as open
POST /zoho-inventory/inventory/v1/bills/{bill_id}/status/open
# Mark as void
POST /zoho-inventory/inventory/v1/bills/{bill_id}/status/void
Shipment Orders
Create Shipment Order
POST /zoho-inventory/inventory/v1/shipmentorders
Content-Type: application/json
{
"shipment_number": "SHP-001",
"date": "2026-02-06",
"delivery_method": "FedEx",
"tracking_number": "1234567890"
}
PUT /zoho-inventory/inventory/v1/bills/{bill_id}
DELETE /zoho-inventory/inventory/v1/bills/{bill_id}
Bill Status Actions
# Mark as open
POST /zoho-inventory/inventory/v1/bills/{bill_id}/status/open
# Mark as void
POST /zoho-inventory/inventory/v1/bills/{bill_id}/status/void
Shipment Orders
Create Shipment Order
POST /zoho-inventory/inventory/v1/shipmentorders
Content-Type: application/json
{
"shipment_number": "SHP-001",
"date": "2026-02-06",
"delivery_method": "FedEx",
"tracking_number": "1234567890"
}
# Mark as open
POST /zoho-inventory/inventory/v1/bills/{bill_id}/status/open
# Mark as void
POST /zoho-inventory/inventory/v1/bills/{bill_id}/status/void
Create Shipment Order
POST /zoho-inventory/inventory/v1/shipmentorders
Content-Type: application/json
{
"shipment_number": "SHP-001",
"date": "2026-02-06",
"delivery_method": "FedEx",
"tracking_number": "1234567890"
}
Required Fields:
shipment_number- Unique shipment numberdate- Shipment datedelivery_method- Carrier/delivery method
Optional Fields:
tracking_number- Carrier tracking numbershipping_charge- Shipping costnotes- Internal notesreference_number- External reference
Get Shipment Order
GET /zoho-inventory/inventory/v1/shipmentorders/{shipmentorder_id}
Update Shipment Order
PUT /zoho-inventory/inventory/v1/shipmentorders/{shipmentorder_id}
Delete Shipment Order
DELETE /zoho-inventory/inventory/v1/shipmentorders/{shipmentorder_id}
Mark as Delivered
POST /zoho-inventory/inventory/v1/shipmentorders/{shipmentorder_id}/status/delivered
Item Groups
List Item Groups
GET /zoho-inventory/inventory/v1/itemgroups
Get Item Group
GET /zoho-inventory/inventory/v1/itemgroups/{itemgroup_id}
Create Item Group
POST /zoho-inventory/inventory/v1/itemgroups
Content-Type: application/json
{
"group_name": "T-Shirts",
"unit": "pcs",
"items": [
{
"name": "T-Shirt - Small",
"rate": 20.00,
"purchase_rate": 8.00,
"sku": "TS-S"
},
{
"name": "T-Shirt - Medium",
"rate": 20.00,
"purchase_rate": 8.00,
"sku": "TS-M"
}
]
}
GET /zoho-inventory/inventory/v1/shipmentorders/{shipmentorder_id}
PUT /zoho-inventory/inventory/v1/shipmentorders/{shipmentorder_id}
Delete Shipment Order
DELETE /zoho-inventory/inventory/v1/shipmentorders/{shipmentorder_id}
Mark as Delivered
POST /zoho-inventory/inventory/v1/shipmentorders/{shipmentorder_id}/status/delivered
Item Groups
List Item Groups
GET /zoho-inventory/inventory/v1/itemgroups
Get Item Group
GET /zoho-inventory/inventory/v1/itemgroups/{itemgroup_id}
Create Item Group
POST /zoho-inventory/inventory/v1/itemgroups
Content-Type: application/json
{
"group_name": "T-Shirts",
"unit": "pcs",
"items": [
{
"name": "T-Shirt - Small",
"rate": 20.00,
"purchase_rate": 8.00,
"sku": "TS-S"
},
{
"name": "T-Shirt - Medium",
"rate": 20.00,
"purchase_rate": 8.00,
"sku": "TS-M"
}
]
}
DELETE /zoho-inventory/inventory/v1/shipmentorders/{shipmentorder_id}
POST /zoho-inventory/inventory/v1/shipmentorders/{shipmentorder_id}/status/delivered
Item Groups
List Item Groups
GET /zoho-inventory/inventory/v1/itemgroups
Get Item Group
GET /zoho-inventory/inventory/v1/itemgroups/{itemgroup_id}
Create Item Group
POST /zoho-inventory/inventory/v1/itemgroups
Content-Type: application/json
{
"group_name": "T-Shirts",
"unit": "pcs",
"items": [
{
"name": "T-Shirt - Small",
"rate": 20.00,
"purchase_rate": 8.00,
"sku": "TS-S"
},
{
"name": "T-Shirt - Medium",
"rate": 20.00,
"purchase_rate": 8.00,
"sku": "TS-M"
}
]
}
GET /zoho-inventory/inventory/v1/itemgroups/{itemgroup_id}
POST /zoho-inventory/inventory/v1/itemgroups
Content-Type: application/json
{
"group_name": "T-Shirts",
"unit": "pcs",
"items": [
{
"name": "T-Shirt - Small",
"rate": 20.00,
"purchase_rate": 8.00,
"sku": "TS-S"
},
{
"name": "T-Shirt - Medium",
"rate": 20.00,
"purchase_rate": 8.00,
"sku": "TS-M"
}
]
}
Required Fields:
group_name- Group nameunit- Unit of measurement
Update Item Group
PUT /zoho-inventory/inventory/v1/itemgroups/{itemgroup_id}
Delete Item Group
DELETE /zoho-inventory/inventory/v1/itemgroups/{itemgroup_id}
Item Group Status Actions
# Mark as active
POST /zoho-inventory/inventory/v1/itemgroups/{itemgroup_id}/active
# Mark as inactive
POST /zoho-inventory/inventory/v1/itemgroups/{itemgroup_id}/inactive
Pagination
PUT /zoho-inventory/inventory/v1/itemgroups/{itemgroup_id}
DELETE /zoho-inventory/inventory/v1/itemgroups/{itemgroup_id}
Item Group Status Actions
# Mark as active
POST /zoho-inventory/inventory/v1/itemgroups/{itemgroup_id}/active
# Mark as inactive
POST /zoho-inventory/inventory/v1/itemgroups/{itemgroup_id}/inactive
Pagination
# Mark as active
POST /zoho-inventory/inventory/v1/itemgroups/{itemgroup_id}/active
# Mark as inactive
POST /zoho-inventory/inventory/v1/itemgroups/{itemgroup_id}/inactive
Zoho Inventory uses page-based pagination:
GET /zoho-inventory/inventory/v1/items?page=1&per_page=50
Response includes pagination info in page_context:
{
"code": 0,
"message": "success",
"items": [...],
"page_context": {
"page": 1,
"per_page": 50,
"has_more_page": true,
"sort_column": "name",
"sort_order": "A"
}
}
Continue fetching while has_more_page is true, incrementing page each time.
Code Examples
JavaScript
const response = await fetch(
'https://gateway.maton.ai/zoho-inventory/inventory/v1/items',
{
headers: {
'Authorization': `Bearer ${process.env.MATON_API_KEY}`
}
}
);
const data = await response.json();
Python
import os
import requests
response = requests.get(
'https://gateway.maton.ai/zoho-inventory/inventory/v1/items',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'}
)
data = response.json()
Notes
- All successful responses have
code: 0 and a message field
- Dates should be in
yyyy-mm-dd format
- Contact types are
customer or vendor
- Item types:
inventory, sales, purchases, sales_and_purchases
- Product types:
goods or service
- The
organization_id parameter is automatically handled by the gateway - you do not need to specify it
- Sales order and purchase order numbers are auto-generated by default - do not specify
salesorder_number or purchaseorder_number unless auto-generation is disabled in settings
- Status action endpoints use POST method (e.g.,
/status/confirmed, /status/void)
- Rate limits: 100 requests/minute per organization
- Daily limits vary by plan: Free (1,000), Standard (2,500), Professional (5,000), Premium (7,500), Enterprise (10,000)
- IMPORTANT: When using curl commands, use
curl -g when URLs contain brackets to disable glob parsing
- IMPORTANT: When piping curl output to
jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments
Error Handling
Status
Meaning
400
Missing Zoho Inventory connection or invalid request
401
Invalid or missing Maton API key, or OAuth scope mismatch
404
Resource not found
429
Rate limited
4xx/5xx
Passthrough error from Zoho Inventory API
Common Error Codes
Code
Description
0
Success
1
Invalid value
2
Mandatory field missing
3
Resource does not exist
5
Invalid URL
Troubleshooting: Invalid API Key
import os
import requests
response = requests.get(
'https://gateway.maton.ai/zoho-inventory/inventory/v1/items',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'}
)
data = response.json()
- All successful responses have
code: 0and amessagefield - Dates should be in
yyyy-mm-ddformat - Contact types are
customerorvendor - Item types:
inventory,sales,purchases,sales_and_purchases - Product types:
goodsorservice - The
organization_idparameter is automatically handled by the gateway - you do not need to specify it - Sales order and purchase order numbers are auto-generated by default - do not specify
salesorder_numberorpurchaseorder_numberunless auto-generation is disabled in settings - Status action endpoints use POST method (e.g.,
/status/confirmed,/status/void) - Rate limits: 100 requests/minute per organization
- Daily limits vary by plan: Free (1,000), Standard (2,500), Professional (5,000), Premium (7,500), Enterprise (10,000)
- IMPORTANT: When using curl commands, use
curl -gwhen URLs contain brackets to disable glob parsing - IMPORTANT: When piping curl output to
jqor other commands, environment variables like$MATON_API_KEYmay not expand correctly in some shell environments
Error Handling
Status
Meaning
400
Missing Zoho Inventory connection or invalid request
401
Invalid or missing Maton API key, or OAuth scope mismatch
404
Resource not found
429
Rate limited
4xx/5xx
Passthrough error from Zoho Inventory API
Common Error Codes
| Status | Meaning |
|---|---|
| 400 | Missing Zoho Inventory connection or invalid request |
| 401 | Invalid or missing Maton API key, or OAuth scope mismatch |
| 404 | Resource not found |
| 429 | Rate limited |
| 4xx/5xx | Passthrough error from Zoho Inventory API |
| Code | Description |
|---|---|
| 0 | Success |
| 1 | Invalid value |
| 2 | Mandatory field missing |
| 3 | Resource does not exist |
| 5 | Invalid URL |
Troubleshooting: Invalid API Key
When you receive a "Invalid API key" error, ALWAYS follow these steps before concluding there is an issue:
- Check that the
MATON_API_KEYenvironment variable is set:
echo $MATON_API_KEY
- Verify the API key is valid by listing connections:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Resources
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。