🛒

客户 API 文档

🔌
总操作数
7
👤
用户类型
客户

API 端点与身份验证

所有客户 API 调用均使用一个 HTTP POST 端点。通过 keyapikey(来自您的个人资料 API 密钥页面)以及 action 进行身份验证以选择操作。路径位于 站点根目录,格式为 /api/v2 — 无语言前缀(例如,/api 前没有 /en/)。

POST
https://accplanet.com/api/v2

application/x-www-form-urlencoded(例如 curl -d)或 JSON 格式(设置 Content-Type: application/json)发送参数。

{
  "key": "YOUR_API_KEY",
  "action": "categories"
}

注意:YOUR_API_KEY 替换为您自己的密钥。切勿将 API 密钥放在 URL、客户端代码或公共存储库中。支持的 action 值:categoriesshopsservicesinventoryaddstatusbalance

每个 API 密钥的请求速率受限。超出限制时,API 返回 HTTP 429 并附带 Retry-After 标头。对大型服务列表使用分页(默认每页大小:50)。

测试 API

选择一个操作,输入任何必需的参数,然后点击 发送请求 以调用实时 API。如果您使用 API 密钥登录,它会在下方自动填入(已遮盖)。

客户 API v2

POST
https://accplanet.com/api/v2

获取分类

返回所有顶级类别及其子类别名称。使用这些确切名称通过 categorysubcategory 过滤 服务列表

请求参数
参数类型描述必需
key / apikey字符串您的 API 密钥
action字符串categories
示例请求
curl -X POST https://accplanet.com/api/v2 \
  -d "key=YOUR_API_KEY" \
  -d "action=categories"
响应示例
{
  "categories": [
    {
      "category": "Social",
      "subcategories": ["Premium", "Standard"]
    },
    {
      "category": "Digital goods",
      "subcategories": []
    }
  ]
}
POST
https://accplanet.com/api/v2

店铺列表

返回所有至少有一个活跃且已批准产品的公开供应商店铺。每个项目包含一个 shop 标识符(24 字符供应商 ObjectId)——将其作为 shop 参数传递给服务列表,以仅列出该店铺的产品。可选的 pagelimit 参数与服务列表相同(默认每页 50 条,最大 500 条)。

请求参数
参数类型描述必需
key / apikey字符串您的 API 密钥
action字符串shops
page数字页码(默认 1),当 limit > 0 时No
limit数字每页项目数;0 = 返回全部(默认 0No
示例请求
curl -X POST https://accplanet.com/api/v2 \
  -d "key=YOUR_API_KEY" \
  -d "action=shops"
响应示例
{
  "shops": [
    {
      "shop": "507f1f77bcf86cd799439011",
      "name": "Example Shop",
      "description": "Shop description",
      "logo": "https://example.com/logo.webp",
      "banner": "https://example.com/banner.webp",
      "shopUrl": "example-shop",
      "productCount": 42,
      "featured": true
    }
  ],
  "total": 1,
  "page": 1,
  "limit": 50,
  "total_pages": 1
}
POST
https://accplanet.com/api/v2

服务列表

Returns sellable products (services) with stock, pricing, sales metrics, review stats, timestamps, and an available flag for whether each item can be ordered now (stock meets minimum purchase quantity). Each item includes sales_count, rating, review_count, created_at, and updated_at. Filter by category / subcategory names from Get Categories, by shop from Shops List, or pass service to fetch one item by its service ID (the service value from list responses). Use language to localize name, description, category, and subcategory (see table below). Optional entityType limits the product type; optional sort orders results before pagination. Set limit=0 to return all matching items in one response.

请求参数
参数类型描述必需
key / apikey字符串您的 API 密钥
action字符串services
page数字页码(默认 1),当 limit > 0 时No
limit数字每页项目数;0 = 返回全部(默认 0No
shop字符串来自店铺列表的店铺 ID(shop 字段——24 字符供应商 ObjectId)。别名:shop_id。省略以返回所有店铺的产品。No
category字符串父分类名称(来自获取分类)No
subcategory字符串子类别名称(来自获取类别)No
entityType字符串产品类型筛选:product(默认,标准目录商品)或 smm(社交增长服务)No
sort字符串排序方式:created_at(默认,最新优先)、price_ascprice_descsalesratingNo
service字符串按 ID 返回一个服务(与列表响应中相同的 service 值)No
language字符串响应语言 — 使用下方支持的语言代码(默认 enNo
支持的语言代码 (language)

传递以下值之一(不区分大小写)。如果省略或使用 en,文本字段将保持为 英文(目录中存储的源语言)。其他支持的代码在翻译可用时返回翻译后的 namedescriptioncategorysubcategory;否则使用英文。

代码语言本地名称
en English English
zh Chinese 中文
es Spanish Español
fr French Français
de German Deutsch
ja Japanese 日本語
ko Korean 한국어
pt Portuguese Português
pt-BR Portuguese (Brazil) Português (Brasil)
ru Russian Русский
ar Arabic العربية
hi Hindi हिन्दी
vi Vietnamese Tiếng Việt
ur Urdu اردو
th Thai ไทย
tr Turkish Türkçe
bn-BD Bengali (Bangladesh) বাংলা
也接受(别名)

这些字符串会被规范化为上述主代码(同一翻译桶):

您可以发送解析为
zh-hans zh
zh-cn zh
zh-sg zh
zh-hant zh
zh-tw zh
zh-hk zh
zh-mo zh
pt-br pt-BR
pt_br pt-BR
ptbr pt-BR
bn-bd bn-BD
bd bn-BD
en-us en
en-gb en

不支持: 任何其他 language 值将被视为英文(不进行翻译)。请使用此处列出的确切主代码或别名。

示例请求
curl -X POST https://accplanet.com/api/v2 \
  -d "key=YOUR_API_KEY" \
  -d "action=services"
curl -X POST https://accplanet.com/api/v2 \
  -d "key=YOUR_API_KEY" \
  -d "action=services" \
  -d "page=1" \
  -d "limit=50"
curl -X POST https://accplanet.com/api/v2 \
  -d "key=YOUR_API_KEY" \
  -d "action=services" \
  -d "entityType=product" \
  -d "sort=price_asc" \
  -d "page=1" \
  -d "limit=50"
curl -X POST https://accplanet.com/api/v2 \
  -d "key=YOUR_API_KEY" \
  -d "action=services" \
  -d "category=Instagram"
curl -X POST https://accplanet.com/api/v2 \
  -d "key=YOUR_API_KEY" \
  -d "action=services" \
  -d "shop=507f1f77bcf86cd799439011"
curl -X POST https://accplanet.com/api/v2 \
  -d "key=YOUR_API_KEY" \
  -d "action=services" \
  -d "service=10042" \
  -d "limit=1" \
  -d "language=zh"

Hot-sync single lookup: use action=services with service (business_id or product_id) and limit=1. Products that exist but are inactive, pending approval, or blacklisted return HTTP 200 with available=false and the actual stock; only missing IDs or deleted products return 404. rate is required; price is an optional alias with the same value.

响应示例

默认limit 省略或为 0):一次响应返回所有服务。

{
  "services": [
    {
      "service": 10042,
      "name": "Example product A",
      "description": "Product description (may be HTML)",
      "type": "Default",
      "category": "Social",
      "subcategory": "Instagram",
      "rate": "9.99",
      "min": 1,
      "max": 100,
      "refill": false,
      "cancel": false,
      "stock": 100,
      "available": true,
      "entityType": "product",
      "autoDelivery": true,
      "sales_count": 128,
      "rating": "4.50",
      "review_count": 23,
      "created_at": "2024-03-01T12:00:00",
      "updated_at": "2025-07-10T08:30:00"
    }
  ],
  "total": 2,
  "page": 1,
  "limit": 0,
  "total_pages": 1
}

service — the service identifier in each list item: a numeric catalog ID when assigned, otherwise a system-generated string. Use the same value for Check Inventory (comma-separated for multiple IDs) and Add Order. rate is the unit price you pay for that service (includes any supplier-specific buyer discount configured for your account; otherwise the list price). available — whether the service can be ordered now (sellable and stock meets the minimum purchase quantity). Same meaning as in Check Inventory; wallet balance and coupon codes are still validated when you call Add Order. category / subcategory match names from Get Categories (subcategory is empty when the product belongs to a top-level category only). description may contain rich text or HTML from the product listing. sales_count — total units sold (cumulative). rating — average score from visible reviews (0.00 when there are no reviews). review_count — number of visible reviews. created_at / updated_at — product creation and last update time (ISO 8601).

POST
https://accplanet.com/api/v2

检查库存

Returns current stock for one or more services. Pass a single service ID, or several IDs comma-separated (e.g. 10054,0665,13541). Use the same service values as in Services List. The available field uses the same rules as in Services List (sellable and stock meets minimum purchase quantity). A single ID returns one object; multiple IDs return an inventory array.

请求参数
参数类型描述必需
key / apikey字符串您的 API 密钥
action字符串inventory
service字符串一个或多个来自服务列表的服务 ID,用逗号分隔(例如 10054,0665,13541;每次请求最多 50 个)
示例请求
curl -X POST https://accplanet.com/api/v2 \
  -d "key=YOUR_API_KEY" \
  -d "action=inventory" \
  -d "service=10054,0665,13541"
响应示例

当提供单个 service ID 时,响应为一个对象(如果未找到则返回 HTTP 404):

{
  "service": 10042,
  "stock": 42,
  "available": true,
  "entityType": "product",
  "autoDelivery": true
}

当提供多个逗号分隔的 ID 时,响应将项目包装在 inventory 数组中(HTTP 200;缺失的服务包含 error 字段):

{
  "inventory": [
    {
      "service": 10054,
      "stock": 10,
      "available": true,
      "entityType": "product",
      "autoDelivery": true
    },
    {
      "service": 665,
      "stock": 0,
      "available": false,
      "entityType": "product",
      "autoDelivery": true
    },
    {
      "service": 13541,
      "error": "Service not found"
    }
  ]
}
POST
https://accplanet.com/api/v2

添加订单

创建订单并从您的 账户余额 扣款。需要有效的 service ID 和 quantity

请求参数
参数类型描述必需
key / apikey字符串您的 API 密钥
action字符串add
service字符串服务列表中的服务 ID(service 字段)
quantity数字数量(默认 1No
link字符串可选 URL 字段(为兼容性接受;不存储)No
coupon_code / coupon字符串Optional coupon code (alias: coupon)No
示例请求
curl -X POST https://accplanet.com/api/v2 \
  -d "key=YOUR_API_KEY" \
  -d "action=add" \
  -d "service=10042" \
  -d "quantity=1"
响应示例

HTTP 状态 201 Created

{
  "order": "000000000000000000000001",
  "charge": "9.99",
  "currency": "USD"
}

The order field is the unique order identifier (string). charge is the total amount debited from your wallet (after buyer discount, login discount, and coupon, when applicable). currency is always USD. Pass order to Order Status (action=status).

POST
https://accplanet.com/api/v2

订单状态

返回您所下订单的履行进度、交付状态和已交付凭证(如适用)。需要来自 添加订单order 标识符。

请求参数
参数类型描述必需
key / apikey字符串您的 API 密钥
action字符串status
order字符串add 返回的订单标识符
示例请求
curl -X POST https://accplanet.com/api/v2 \
  -d "key=YOUR_API_KEY" \
  -d "action=status" \
  -d "order=000000000000000000000001"
响应示例
{
  "status": "In progress",
  "charge": "75.00",
  "start_count": 3,
  "remains": 1,
  "delivered_units": 2,
  "currency": "USD",
  "autoDelivery": true,
  "entityType": "product"
}
{
  "status": "Completed",
  "charge": "50.00",
  "start_count": 2,
  "remains": 0,
  "delivered_units": 2,
  "currency": "USD",
  "autoDelivery": true,
  "entityType": "product",
  "accounts": ["example_user:redacted", "example_user_2:redacted"]
}
POST
https://accplanet.com/api/v2

平衡

返回您当前的客户钱包余额和货币。除身份验证外,无需额外参数。

请求参数
参数类型描述必需
key / apikey字符串您的 API 密钥
action字符串balance
示例请求
curl -X POST https://accplanet.com/api/v2 \
  -d "key=YOUR_API_KEY" \
  -d "action=balance"
响应示例
{
  "balance": "100.00",
  "currency": "USD"
}

返回您客户钱包中的可用余额(用于支付订单)。

POST
https://accplanet.com/api/v2

错误响应

错误使用单个 error 字符串。错误的或缺失的 API 凭据通常返回 HTTP 401,内容为 {"error": "Invalid API key"};验证问题通常返回 400

{"error": "Invalid API key"}
{"error": "Invalid action"}
{"error": "Service ID is required"}
{"error": "Service not found"}
{"error": "Shop not found"}
{"error": "Product not found."}
{"error": "This product is not available for purchase."}
{"error": "Invalid quantity."}
{"error": "Minimum quantity is 2."}
{"error": "Insufficient stock. Available: 10."}
{"error": "Insufficient balance. Please recharge your account."}
{"error": "Order not found"}
{"error": "Category not found"}
{"error": "Subcategory not found"}
{"error": "Subcategory not found in category"}
Telegram