🛒

Tài liệu API khách hàng

🔌
Tổng số hành động
7
👤
Loại Người Dùng
Khách hàng

Điểm cuối API & Xác thực

Tất cả các lệnh gọi API của khách hàng đều sử dụng một điểm cuối HTTP POST duy nhất. Xác thực bằng key hoặc apikey (từ trang khóa API trong hồ sơ của bạn) cùng với action để chọn thao tác. Đường dẫn nằm ở gốc trang web dưới dạng /api/v2 — không có tiền tố ngôn ngữ (ví dụ: không có /en/ trước /api).

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

Gửi tham số dưới dạng application/x-www-form-urlencoded (ví dụ: curl -d) hoặc dưới dạng JSON với Content-Type: application/json.

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

Lưu ý: Thay thế YOUR_API_KEY bằng khóa của riêng bạn. Không bao giờ đặt khóa API trong URL, mã phía máy khách hoặc kho lưu trữ công khai. Các giá trị action được hỗ trợ: categories, shops, services, inventory, add, status, balance.

Yêu cầu bị giới hạn tốc độ theo từng API key. Khi vượt quá, API trả về HTTP 429 kèm header Retry-After. Sử dụng phân trang cho danh sách dịch vụ lớn (kích thước trang mặc định: 50).

API Kiểm thử

Chọn một hành động, nhập các tham số bắt buộc, sau đó nhấp vào Gửi yêu cầu để gọi API trực tiếp. Nếu bạn đã đăng nhập bằng khóa API, nó sẽ được điền bên dưới (ẩn).

Customer API v2

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

Lấy Danh mục

Trả về tất cả danh mục cấp cao nhất và tên danh mục con của chúng. Sử dụng các tên chính xác này để lọc Services List theo categorysubcategory.

Tham số Yêu cầu
Tham sốKiểuMô tảBắt buộc
key / apikeyChuỗiKhóa API của bạn
actionChuỗicategories
Ví dụ yêu cầu
curl -X POST https://accplanet.com/api/v2 \
  -d "key=YOUR_API_KEY" \
  -d "action=categories"
Ví dụ phản hồi
{
  "categories": [
    {
      "category": "Social",
      "subcategories": ["Premium", "Standard"]
    },
    {
      "category": "Digital goods",
      "subcategories": []
    }
  ]
}
POST
https://accplanet.com/api/v2

Danh sách Cửa hàng

Trả về tất cả các cửa hàng nhà cung cấp công khai có ít nhất một sản phẩm đang hoạt động, đã được phê duyệt. Mỗi mục bao gồm một mã định danh shop (ObjectId của nhà cung cấp gồm 24 ký tự) — chuyển mã này đến Danh sách Dịch vụ dưới dạng shop để liệt kê các sản phẩm chỉ từ cửa hàng đó. pagelimit tùy chọn hoạt động giống như Danh sách Dịch vụ (kích thước trang mặc định là 50, tối đa 500).

Tham số Yêu cầu
Tham sốKiểuMô tảBắt buộc
key / apikeyChuỗiKhóa API của bạn
actionChuỗishops
pageSốSố trang (mặc định 1) khi limit > 0No
limitSốSố mục trên mỗi trang; 0 = trả về tất cả (mặc định 0)No
Ví dụ yêu cầu
curl -X POST https://accplanet.com/api/v2 \
  -d "key=YOUR_API_KEY" \
  -d "action=shops"
Ví dụ phản hồi
{
  "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

Danh sách Dịch vụ

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.

Tham số Yêu cầu
Tham sốKiểuMô tảBắt buộc
key / apikeyChuỗiKhóa API của bạn
actionChuỗiservices
pageSốSố trang (mặc định 1) khi limit > 0No
limitSốSố mục trên mỗi trang; 0 = trả về tất cả (mặc định 0)No
shopChuỗiID Cửa hàng từ Danh sách Cửa hàng (trường shop — ObjectId của nhà cung cấp gồm 24 ký tự). Bí danh: shop_id. Bỏ qua để trả về sản phẩm từ tất cả các cửa hàng.No
categoryChuỗiTên danh mục cha (từ Lấy Danh mục)No
subcategoryChuỗiTên danh mục con (từ Lấy danh mục)No
entityTypeChuỗiBộ lọc loại sản phẩm: product (mặc định, các mặt hàng danh mục tiêu chuẩn) hoặc smm (dịch vụ tăng trưởng mạng xã hội)No
sortChuỗiThứ tự sắp xếp: created_at (mặc định, mới nhất trước), price_asc, price_desc, sales, ratingNo
serviceChuỗiTrả về một dịch vụ theo ID (cùng giá trị service như trong phản hồi danh sách)No
languageChuỗiNgôn ngữ phản hồi — sử dụng mã từ danh sách Mã ngôn ngữ được hỗ trợ bên dưới (mặc định en)No
Mã ngôn ngữ được hỗ trợ (language)

Truyền một trong các giá trị này (không phân biệt chữ hoa chữ thường). Nếu bỏ qua hoặc là en, các trường văn bản vẫn ở Tiếng Anh (ngôn ngữ nguồn được lưu trong danh mục). Các mã được hỗ trợ khác trả về name, description, categorysubcategory đã dịch khi có bản dịch; nếu không thì tiếng Anh được sử dụng.

Ngôn ngữTên bản địa
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) বাংলা
Cũng được chấp nhận (bí danh)

Các chuỗi này được chuẩn hóa về mã chính ở trên (cùng nhóm dịch):

Bạn có thể gửiGiải quyết thành
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

Không được hỗ trợ: bất kỳ giá trị language nào khác đều được coi như tiếng Anh (không dịch). Chỉ sử dụng các mã chính xác hoặc bí danh được liệt kê ở đây.

Ví dụ yêu cầu
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.

Ví dụ phản hồi

Mặc định (limit bị bỏ qua hoặc 0): tất cả dịch vụ trong một phản hồi.

{
  "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

Kiểm tra Tồn kho

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.

Tham số Yêu cầu
Tham sốKiểuMô tảBắt buộc
key / apikeyChuỗiKhóa API của bạn
actionChuỗiinventory
serviceChuỗiMột hoặc nhiều ID dịch vụ từ danh sách dịch vụ, phân cách bằng dấu phẩy (ví dụ: 10054,0665,13541; tối đa 50 mỗi yêu cầu)
Ví dụ yêu cầu
curl -X POST https://accplanet.com/api/v2 \
  -d "key=YOUR_API_KEY" \
  -d "action=inventory" \
  -d "service=10054,0665,13541"
Ví dụ phản hồi

Khi một ID service duy nhất được cung cấp, phản hồi là một đối tượng (HTTP 404 nếu không tìm thấy):

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

Khi nhiều ID phân cách bằng dấu phẩy được cung cấp, phản hồi bao gồm các mục trong một mảng inventory (HTTP 200; các dịch vụ bị thiếu bao gồm trường 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

Thêm Đơn hàng

Tạo một đơn hàng và tính phí từ số dư tài khoản của bạn. Yêu cầu ID service hợp lệ và quantity.

Tham số Yêu cầu
Tham sốKiểuMô tảBắt buộc
key / apikeyChuỗiKhóa API của bạn
actionChuỗiadd
serviceChuỗiID dịch vụ từ danh sách dịch vụ (trường service)
quantitySốSố lượng (mặc định 1)No
linkChuỗiTrường URL tùy chọn (được chấp nhận để tương thích; không được lưu trữ)No
coupon_code / couponChuỗiOptional coupon code (alias: coupon)No
Ví dụ yêu cầu
curl -X POST https://accplanet.com/api/v2 \
  -d "key=YOUR_API_KEY" \
  -d "action=add" \
  -d "service=10042" \
  -d "quantity=1"
Ví dụ phản hồi

Trạng thái 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

Trạng thái đơn hàng

Trả về tiến độ xử lý, trạng thái giao hàng và thông tin đăng nhập đã giao (nếu có) cho một đơn hàng bạn đã đặt. Yêu cầu mã định danh order từ Add Order.

Tham số Yêu cầu
Tham sốKiểuMô tảBắt buộc
key / apikeyChuỗiKhóa API của bạn
actionChuỗistatus
orderChuỗiMã định danh đơn hàng được trả về bởi add
Ví dụ yêu cầu
curl -X POST https://accplanet.com/api/v2 \
  -d "key=YOUR_API_KEY" \
  -d "action=status" \
  -d "order=000000000000000000000001"
Ví dụ phản hồi
{
  "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

Số dư

Trả về số dư ví khách hàng hiện tại và loại tiền tệ của bạn. Không yêu cầu tham số bổ sung ngoài xác thực.

Tham số Yêu cầu
Tham sốKiểuMô tảBắt buộc
key / apikeyChuỗiKhóa API của bạn
actionChuỗibalance
Ví dụ yêu cầu
curl -X POST https://accplanet.com/api/v2 \
  -d "key=YOUR_API_KEY" \
  -d "action=balance"
Ví dụ phản hồi
{
  "balance": "100.00",
  "currency": "USD"
}

Trả về số dư khả dụng trong ví khách hàng của bạn (dùng để thanh toán đơn hàng).

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

Phản hồi Lỗi

Lỗi sử dụng một chuỗi error duy nhất. Thông tin xác thực API sai hoặc thiếu thường trả về HTTP 401 với {"error": "Invalid API key"}; các vấn đề xác thực thường trả về 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