跳到主要内容
开发者
把店铺的商品、库存和订单与自己的系统同步,并通过 webhook 及时获知新订单。
在卖家中心创建密钥,选择所需权限,然后放在 Authorization 请求头中发送。每个请求都以店主身份执行,规则与卖家中心相同。
示例
curl -H "Authorization: Bearer odx_..." https://demo-api.odinmax.com/v1/public/listings调用限制
每个密钥每分钟 120 次,每个店铺每分钟 600 次,超出返回 429 RATE_LIMITED。金额
以最小单位(萨当或美分)的字符串表示,例如 "35500" 即 355.00 泰铢。错误
错误返回代码,例如 LISTING_NOT_FOUND,而不是句子。请在你的系统中按代码处理。Listings get /v1/public/listings权限 listings.read
List your listings
响应示例 200
[
{
"shortId": "string",
"status": "DRAFT",
"title": {
"en": "Genshin Impact AR 58",
"th": "ไอดี Genshin AR 58"
},
"type": "TOPUP",
"deliveryMode": "AUTO",
"priceTh": {
"amount": "35500",
"currency": "THB"
},
"priceIntl": {
"amount": "35500",
"currency": "THB"
},
"price": "string",
"priceThCustom": false,
"quantityAvailable": 1,
"imageUrl": "string",
"salesCount": 1,
"moderationNote": "string",
"updatedAt": "2026-10-01T12:00:00.000Z"
}
]200 All listings of the shop401 Missing or unknown key403 Key lacks the scope, or the shop is restricted (SHOP_RESTRICTED) or paused for writes (SHOP_PAUSED)429 Rate limited: 120 requests/minute per key, 600 per shop, 300 per IP
patch /v1/public/listings/{shortId}权限 listings.write
Change price, quantity or pause a listing
参数
shortIdpath · 必填 ^[A-Za-z0-9]{4,12}$ 请求示例
{
"price": {
"currency": "THB",
"amount": "string"
},
"priceTh": "string",
"priceIntl": "string",
"quantity": 0,
"paused": false
}响应示例 200
{
"shortId": "string",
"status": "string",
"quantityAvailable": 1
}200 Updated400 Invalid body (VALIDATION_FAILED)401 Missing or unknown key Key lacks the scope, or the shop is restricted (SHOP_RESTRICTED) or paused for writes (SHOP_PAUSED)
Stock post /v1/public/listings/{shortId}/stock权限 stock.write
Add delivery codes to an automatic-delivery listing
参数
shortIdpath · 必填 ^[A-Za-z0-9]{4,12}$ 请求示例
{
"codes": [
"string"
]
}201 Codes added (duplicates in the request are counted once)400 Invalid body (VALIDATION_FAILED)401 Missing or unknown key Key lacks the scope, or the shop is restricted (SHOP_RESTRICTED) or paused for writes (SHOP_PAUSED)
Orders get /v1/public/orders权限 orders.read
List orders, newest first
参数
statusquery PAID | DELIVERED | COMPLETED | DISPUTED | REFUNDED limitquery 1-100 (50) 响应示例 200
[
{
"code": "string",
"status": "string",
"subtotal": {
"amount": "35500",
"currency": "THB"
},
"commission": {
"amount": "35500",
"currency": "THB"
},
"createdAt": "2026-10-01T12:00:00.000Z",
"paidAt": "2026-10-01T12:00:00.000Z",
"deliveredAt": "2026-10-01T12:00:00.000Z",
"completedAt": "2026-10-01T12:00:00.000Z",
"autoConfirmAt": "2026-10-01T12:00:00.000Z",
"items": [
{
"shortId": "string",
"title": {
"en": "Genshin Impact AR 58",
"th": "ไอดี Genshin AR 58"
},
"quantity": 1,
"unitPrice": {
"amount": "35500",
"currency": "THB"
}
}
]
}
]200 Orders401 Missing or unknown key
Webhook在卖家中心设置 URL 并选择事件。每个请求都在 X-Odinmax-Signature 中签名,请先验证再信任,并用 X-Odinmax-Delivery 避免重复处理。请在 10 秒内返回 2xx,失败会在一天内重试 8 次。
order.paidorder.completedorder.refundeddispute.openedping
推送数据示例
{
"id": "string",
"type": "order.paid",
"createdAt": "2026-10-01T12:00:00.000Z",
"data": {
"order": {
"code": "string",
"status": "string",
"subtotal": {
"amount": "35500",
"currency": "THB"
},
"items": [
{}
]
}
}
}验证签名 (Node.js)
import crypto from 'node:crypto';
// header = request.headers['x-odinmax-signature'], rawBody = the body exactly as received
const [t, v1] = header.split(',').map((p) => p.split('=')[1]);
const expected = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
const fresh = Math.abs(Date.now() / 1000 - Number(t)) < 300;
const ok = fresh && crypto.timingSafeEqual(Buffer.from(v1, 'hex'), Buffer.from(expected, 'hex'));
© 2026 ODINMAX · 服务条款 · 隐私政策
VISA Mastercard JCB PromptPay PayPal TrueMoney 403
404 Not your listing (LISTING_NOT_FOUND)
429 Rate limited: 120 requests/minute per key, 600 per shop, 300 per IP
403
404 Not your listing (LISTING_NOT_FOUND)
409 Not an automatic-delivery listing (STOCK_NOT_AUTO)
429 Rate limited: 120 requests/minute per key, 600 per shop, 300 per IP
403 Key lacks the scope, or the shop is restricted (SHOP_RESTRICTED) or paused for writes (SHOP_PAUSED)
429 Rate limited: 120 requests/minute per key, 600 per shop, 300 per IP
get /v1/public/orders/{code}权限 orders.read
One order
参数
codepath · 必填 ^[A-Z0-9-]{4,24}$ 响应示例 200
{
"code": "string",
"status": "string",
"subtotal": {
"amount": "35500",
"currency": "THB"
},
"commission": {
"amount": "35500",
"currency": "THB"
},
"createdAt": "2026-10-01T12:00:00.000Z",
"paidAt": "2026-10-01T12:00:00.000Z",
"deliveredAt": "2026-10-01T12:00:00.000Z",
"completedAt": "2026-10-01T12:00:00.000Z",
"autoConfirmAt": "2026-10-01T12:00:00.000Z",
"items": [
{
"shortId": "string",
"title": {
"en": "Genshin Impact AR 58",
"th": "ไอดี Genshin AR 58"
},
"quantity": 1,
"unitPrice": {
"amount": "35500",
"currency": "THB"
}
}
]
}200 The order401 Missing or unknown key403 Key lacks the scope, or the shop is restricted (SHOP_RESTRICTED) or paused for writes (SHOP_PAUSED)404 Not an order of your shop (ORDER_NOT_FOUND)429 Rate limited: 120 requests/minute per key, 600 per shop, 300 per IP