Supplier API Documentation
Request Headers
Authenticate using <strong>one</strong> of: an active supplier <strong>browser session</strong> (same login as the supplier dashboard), request header <code>X-API-Key</code>, header <code>Authorization: Bearer <your_api_key></code>, or JSON/body fields <code>key</code> / <code>apikey</code> (avoid putting keys in URLs or shared logs). JSON endpoints use:
{
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
<strong>Note:</strong> Replace <code>YOUR_API_KEY</code> with your own key from your profile API key page. Do not embed real keys in client-side code or public repositories.
Test API
Choose an endpoint, enter path or body parameters, then click <strong>Send Request</strong>. If you are signed in with an API key, it is filled in below (masked). Browser session auth also works when you are logged into the supplier dashboard.
Response
Products
Upload Image
Description
Upload image file to the server.
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
image |
String | Image file | Yes |
Response Example
{
"success": true,
"image_path": "/media/product_images/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.webp",
"message": "Image uploaded successfully"
}
Create Product
Description
Create a new product with the provided information.
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
category_id |
String | Leaf category ID (subcategory when parent has children; else parent ID) | Yes |
title |
String | Title | Yes |
description |
String | Description (may be HTML from rich text) | Yes |
price |
String | Price | Yes |
supplier_name |
String | Supplier name | No |
stock |
Number | Stock | No |
min_quantity |
Number | Minimum purchase quantity | No |
images |
Array | Image paths list | No |
source_product_id |
String | Provider/upstream product ID (optional, max 200 characters) | No |
source_product_url |
String | Provider/upstream product page URL (optional, max 2000 characters) | No |
warranty_period_days |
Number | Warranty Period Days | No |
status |
String | Status | No |
accounts |
Array | Optional array of {username, password} objects for pre-uploaded auto-delivery pool | No |
accounts_text |
String | Optional newline-separated username:password or username|password lines (same pool as accounts) | No |
Response Example
{
"success": true,
"product_id": "product_id_string",
"business_id": 500,
"approval_status": "approved",
"message": "Product created successfully",
"accounts_imported": 0
}
List Products
Description
Get a list of products with optional filtering and pagination.
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
page |
Number | Page number | No |
page_size |
Number | Items per page | No |
search |
String | Search keyword | No |
category_id |
String | Leaf category ID (subcategory when parent has children; else parent ID) | No |
status |
String | Status | No |
sort |
String | Sort order | No |
min_price |
Number | Minimum price | No |
max_price |
Number | Maximum price | No |
Response Example
{
"product_id": "product_id_string",
"category_id": "category_id_string",
"title": "Product Title",
"description": "Product Description",
"price": "99.99",
"stock": 100,
"min_quantity": 1,
"sales_count": 50,
"rating": "4.50",
"status": "active",
"approval_status": "approved",
"images": [
"/media/product_images/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.webp"
],
"category_path": "Parent > Sub",
"parent_category_id": "parent_id_or_null",
"tags": [],
"created_at": "2024-03-01T12:00:00Z",
"updated_at": "2024-03-01T12:00:00Z"
}
Update Product
Description
Update an existing product with new information.
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
product_id |
String | Product ID | No |
category_id |
String | Leaf category ID (subcategory when parent has children; else parent ID) | No |
title |
String | Title | No |
description |
String | Description (may be HTML from rich text) | No |
price |
String | Price | No |
supplier_name |
String | Supplier name | No |
stock |
Number | Stock | No |
min_quantity |
Number | Minimum purchase quantity | No |
images |
Array | Image paths list | No |
source_product_id |
String | Provider/upstream product ID (optional, max 200 characters) | No |
source_product_url |
String | Provider/upstream product page URL (optional, max 2000 characters) | No |
warranty_period_days |
Number | Warranty Period Days | No |
status |
String | Status | No |
accounts |
Array | Optional array of {username, password} objects for pre-uploaded auto-delivery pool | No |
accounts_text |
String | Optional newline-separated username:password or username|password lines (same pool as accounts) | No |
Response Example
{
"success": true,
"product_id": "product_id_string",
"business_id": 500,
"message": "Product updated successfully",
"accounts_imported": 0
}
Append Product Accounts
Description
Append pre-uploaded accounts to the auto-delivery pool.
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
product_id |
String | Product ID | No |
accounts |
Array | Optional array of {username, password} objects for pre-uploaded auto-delivery pool | No |
accounts_text |
String | Optional newline-separated username:password or username|password lines (same pool as accounts) | No |
Response Example
{
"success": true,
"product_id": "product_id_string",
"accounts_imported": 5,
"delivery_tasks_queued": 2,
"message": "Accounts imported."
}
Delete Product
Description
Delete a product that has not been sold.
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
product_id |
String | Product ID | No |
Response Example
{
"success": true,
"message": "Product deleted successfully"
}
Orders
List Orders
Description
List orders for the authenticated supplier with pagination.
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
page |
Number | Page number | No |
page_size |
Number | Items per page | No |
status |
String | Status | No |
search |
String | Search keyword | No |
Response Example
{
"order_id": "order_id_string",
"order_no": "TK1772446511113",
"buyer_id": "buyer_id_string",
"product_id": "product_id_string",
"quantity": 1,
"original_price": "99.99",
"login_discount": "1.99",
"coupon_code": "DISCOUNT10",
"coupon_discount": "9.99",
"total_amount": "88.01",
"status": "pending_order",
"payment_status": "pending_payment",
"payment_method": "balance",
"created_at": "2024-03-01T12:00:00Z",
"updated_at": "2024-03-01T12:00:00Z",
"delivered_info": "Delivery content",
"account_id": null,
"delivered_account_ids": [],
"delivered_units": 0,
"remaining_to_deliver": 1,
"supplier_income_recorded": false,
"receipt_confirmed_at": null,
"product": {
"product_id": "product_id_string",
"business_id": 501,
"category_id": "category_id_string",
"category_path": "Parent > Sub",
"parent_category_id": "parent_id_or_null",
"title": "Product title",
"description": "…",
"price": "99.99",
"stock": 10,
"min_quantity": 1,
"sales_count": 0,
"rating": "0.00",
"status": "active",
"approval_status": "approved",
"images": [],
"source_product_id": null,
"source_product_url": null,
"warranty_period_days": "2",
"created_at": "2024-03-01T12:00:00Z",
"updated_at": "2024-03-01T12:00:00Z"
}
}
Refund Order
Description
Fully refund an order owned by the supplier.
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
order_id |
String | Order ID | No |
Response Example
{
"success": true,
"order_id": "order_id_string",
"refund_no": "REF1772446511113",
"message": "Refund processed successfully."
}
Update Delivered Info
Description
Update manual delivery content for an order owned by the supplier.
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
order_id |
String | Order ID | No |
delivered_info |
String | Manual delivery: plain text, or JSON array string (e.g. ["user:pass","row2"]). If append_delivered_info is true, must be a JSON array. | Yes |
append_delivered_info |
String | If true, merge delivered_info JSON array into existing manual rows (dedupe); response echoes whether append was used | No |
Response Example
{
"success": true,
"order_id": "order_id_string",
"message": "Delivered info updated.",
"delivered_units": 2,
"order_completed": false,
"append_delivered_info": false
}
Change Order Status
Description
Change the order status using the same allowed values as the supplier panel.
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
order_id |
String | Order ID | No |
order_status |
String | New order status (or send body field status instead). Allowed only: pending_order, running_order, completed_order, refunded_order. Not allowed: receipt_confirmed_order. | No |
status |
String | Status | No |
Response Example
{
"success": true,
"order_id": "order_id_string",
"status": "running_order",
"message": "Order status updated."
}
Get Order
Description
Get order status and details for an allowed buyer, supplier, or staff user.
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
order_id |
String | Order ID | No |
Response Example
{
"success": true,
"order": {
"order_id": "order_id_string",
"order_no": "TK1772446511113",
"buyer_id": "buyer_id_string",
"product_id": "product_id_string",
"quantity": 1,
"original_price": "99.99",
"login_discount": "1.99",
"coupon_code": "DISCOUNT10",
"coupon_discount": "9.99",
"total_amount": "88.01",
"status": "pending_order",
"payment_status": "pending_payment",
"payment_method": "balance",
"created_at": "2024-03-01T12:00:00Z",
"updated_at": "2024-03-01T12:00:00Z",
"delivered_info": null,
"account_id": null,
"delivered_account_ids": [],
"delivered_units": 0,
"remaining_to_deliver": 1,
"supplier_income_recorded": false,
"receipt_confirmed_at": null,
"product": {
"...": "same snapshot as supplier order list"
}
}
}
Tickets
List Tickets
Description
List support tickets for the authenticated supplier.
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
page |
Number | Page number | No |
page_size |
Number | Items per page | No |
status |
String | Status | No |
Response Example
{
"ticket_id": "ticket_id_string",
"ticket_no": "TKT1772446511113",
"order_id": "order_id_string",
"buyer_id": "buyer_id_string",
"supplier_id": "supplier_id_string",
"title": "Ticket Title",
"description": "Ticket Description",
"status": "open",
"admin_invited": false,
"created_at": "2024-03-01T12:00:00Z",
"updated_at": "2024-03-01T12:00:00Z"
}
Get Ticket
Description
Get one ticket that belongs to the authenticated supplier.
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
ticket_id |
String | Ticket ID | No |
Response Example
{
"success": true,
"ticket": {
"ticket_id": "ticket_id_string",
"ticket_no": "TKT1772446511113",
"order_id": "order_id_string",
"buyer_id": "buyer_id_string",
"supplier_id": "supplier_id_string",
"title": "Ticket Title",
"description": "Ticket Description",
"status": "open",
"admin_invited": false,
"created_at": "2024-03-01T12:00:00Z",
"updated_at": "2024-03-01T12:00:00Z"
}
}
Create Ticket
Description
Create a ticket as supplier for an order you supply.
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
order_id |
String | Order ID | Yes |
title |
String | Title | Yes |
description |
String | Description (may be HTML from rich text) | Yes |
Response Example
{
"success": true,
"ticket_id": "ticket_id_string",
"ticket_no": "TKT1772446511113",
"message": "Ticket created successfully."
}
Update Ticket
Description
Update a supplier ticket status or reply message.
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
ticket_id |
String | Ticket ID | No |
title |
String | Title | No |
description |
String | Description (may be HTML from rich text) | No |
status |
String | Status | No |
Response Example
{
"success": true,
"ticket": {
"ticket_id": "ticket_id_string",
"ticket_no": "TKT1772446511113",
"order_id": "order_id_string",
"buyer_id": "buyer_id_string",
"supplier_id": "supplier_id_string",
"title": "Updated Ticket Title",
"description": "Updated Description",
"status": "in_progress",
"admin_invited": false,
"created_at": "2024-03-01T12:00:00Z",
"updated_at": "2024-03-01T12:00:00Z"
}
}
Payments
List Payments
Description
List payment records for orders belonging to the authenticated supplier.
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
page |
Number | Page number | No |
page_size |
Number | Items per page | No |
Response Example
{
"payment_no": "PAY1772446511113",
"order_id": "order_id_string",
"amount": "99.99",
"payment_method": "balance",
"status": "completed_payment",
"paid_at": "2024-03-01T12:00:00Z",
"created_at": "2024-03-01T12:00:00Z"
}
Account
Get Balance
Description
Get account balances for the authenticated user.
Response Example
{
"success": true,
"balance": "100.00",
"user_balance": "100.00",
"supplier_balance": "0.00",
"current_role": "user",
"email": "[email protected]",
"user_id": "user_id_string"
}