Developer Documentation

OMS API Reference

Integrate your e-commerce operations with the Globe Fulfillment Order Management System. RESTful APIs for user authentication, shop management, product catalog, orders, tickets, and sourcing.

30+
Endpoints
REST
Architecture
JSON
Format
v1.0
Version

Overview

This document describes the open API interface of the OMS (Order Management System). All endpoints follow RESTful conventions and use JSON for data transmission. APIs are divided into public endpoints (no login required) and private endpoints (Bearer Token required).

Base Information

Item Description
API Base Path/api
Data Formatapplication/json; charset=utf-8
Character EncodingUTF-8
TimezoneAsia/Shanghai
Time FormatYYYY-MM-DD HH:mm:ss
CORSEnabled (Access-Control-Allow-Origin: *)

Authentication

Bearer Token Authentication

The OMS API uses Bearer Token authentication. After a successful login or registration, you receive a token. All private endpoints require this token in the request header:

Authorization: Bearer {token}
Note: If the Token is missing, invalid, or expired, a 401 error is returned. The default Token validity period is 7200 seconds (2 hours).

Response Format

All endpoints return a unified JSON structure:

Success Response

{ "code": 200, "msg": "success", "data": { /* business data */ }, "timestamp": 1720000000 }

Error Response

{ "code": 400, "msg": "Error message description", "data": [], "timestamp": 1720000000 }

Paginated Response (last_page structure)

{ "code": 200, "msg": "success", "data": { "list": [ /* data list */ ], "total": 100, "page": 1, "limit": 10, "last_page": 10 } }

Paginated Response (pagination structure, used by myList endpoint)

{ "code": 200, "msg": "success", "data": { "list": [ /* data list */ ], "pagination": { "page": 1, "pageSize": 20, "total": 100, "totalPages": 5, "hasMore": false } }, "timestamp": 1720000000 }

pagination field descriptions: page current page number, pageSize items per page, total total records, totalPages total pages (=ceil(total/pageSize)), hasMore whether there is a next page.

Error Codes

CodeDescription
200Success
400Bad request (missing or malformed parameters)
401Unauthorized (not logged in, invalid or expired Token)
403Forbidden (no permission to access)
404Not Found (resource does not exist)
500Internal Server Error

User Authorization

Endpoints for user login, registration, Token management, and profile maintenance.

POST /api/user/login Public
User Login
Login with username/email and password. Returns an access Token on success. After 5 consecutive failures, the account is locked for 15 minutes.

Request Parameters (Body)

ParameterTypeRequiredDescription
username*stringYesUsername or email address
password*stringYesPassword

Response Example

{ "code": 200, "msg": "Login successful", "data": { "token": "a1b2c3d4e5f6...", "expires_in": 7200, "user": { "id": 17, "username": "john", "email": "john@example.com", "real_name": "John Doe", "phone": "13800138000", "avatar": "/storage/avatar/xx.jpg" } } }
POST /api/user/register Public
User Registration
After successful registration, a login Token is automatically returned. Username, email, and phone must be unique within the same merchant account.

Request Parameters (Body)

ParameterTypeRequiredDescription
username*stringYesUsername
password*stringYesPassword (minimum 6 characters)
emailstringNoEmail (unique within merchant)
phonestringNoPhone number (unique within merchant)
real_namestringNoReal name
Response: Same structure as /api/user/login.
POST /api/user/checkToken Public
Validate Token
Validates the locally stored Token and retrieves the latest user information. Requires a Bearer Token in the Authorization header.

Request Headers

ParameterTypeDescription
AuthorizationstringBearer {token}

Response data Fields

FieldTypeDescription
tokenstringCurrent Token
user.idintUser ID
user.usernamestringUsername
user.emailstringEmail
user.real_namestringReal name
user.phonestringPhone number
user.avatarstringAvatar URL
user.customer_idstringCustomer ID
user.super_idintMerchant ID
GET /api/user/info Login Required
Get User Information

Response Fields

FieldTypeDescription
idintUser ID
usernamestringUsername
emailstringEmail
real_namestringReal name
phonestringPhone number
avatarstringAvatar URL
departmentstringDepartment
biostringPersonal bio
role_idstringRole ID (e.g., User)
customer_idstringCustomer ID
super_idintMerchant ID
consultant_idintSales consultant ID
consultantobjectConsultant info {id, username, email, real_name, phone, avatar, bio}
POST /api/user/update Login Required
Update User Information

Request Parameters (Body)

ParameterTypeRequiredDescription
usernamestringNoUsername
emailstringNoEmail
real_namestringNoReal name
phonestringNoPhone number
avatarstringNoAvatar URL
biostringNoPersonal bio
old_passwordstringNoOld password (required when changing password)
passwordstringNoNew password (required when changing password)
POST /api/user/uploadAvatar Login Required
Upload Avatar
Upload an avatar image using multipart/form-data. Automatically updates the user's avatar field.

Request Parameters (multipart/form-data)

ParameterTypeRequiredDescription
avatar*fileYesAvatar image file

Response data

{ "avatar": "/storage/avatar/u_17_20260810.jpg" }
POST /api/user/logout Login Required
User Logout
Destroys the current Token and logs out the user.

Shops

Manage e-commerce platform shops bound to the user. Supports Shopify, Amazon, eBay, Global, and more. Data is isolated by customer_id — users can only see their own shops.

GET /api/shop/list Login Required
Shop List

Request Parameters (Query)

ParameterTypeRequiredDefaultDescription
pageintNo1Page number
limitintNo10Items per page (10/20/50)
shop_namestringNo-Fuzzy search by shop name
platform_typestringNoallPlatform: SHOPIFY/AMAZON/EBAY/GLOBAL/all
statusstringNoallStatus: active/inactive/all

Response list item fields

FieldTypeDescription
idintShop ID
shop_namestringShop name
shop_idstringPlatform shop domain (e.g., xxx.myshopify.com)
platform_typestringPlatform type: SHOPIFY/AMAZON/EBAY/GLOBAL
platform_textstringPlatform display text
statusstringStatus: active/inactive
status_textstringStatus display text
shop_urlstringShop URL
countrystringCountry
currencystringCurrency
created_atstringCreation time
GET /api/shop/detail Login Required
Shop Detail

Request Parameters (Query)

ParameterTypeRequiredDescription
id*intYesShop ID
Response: Same as list item fields, plus api_key, access_token (encrypted), timezone, contact_email, contact_phone, remark, etc.
GET /api/shop/platform-options Login Required
Platform Options
[ { "value": "all", "label": "All" }, { "value": "SHOPIFY", "label": "Shopify" }, { "value": "AMAZON", "label": "Amazon" }, { "value": "EBAY", "label": "eBay" }, { "value": "GLOBAL", "label": "Global" } ]
GET /api/shop/status-options Login Required
Shop Status Options
[ { "value": "all", "label": "All" }, { "value": "active", "label": "Active" }, { "value": "inactive", "label": "Inactive" } ]

Products

Product catalog query, detail, and inventory endpoints. Products are filtered by published status (product_status=1) by default. Prices are automatically converted to USD for display.

GET /api/product/list Login Required
Product List

Request Parameters (Query)

ParameterTypeRequiredDefaultDescription
pageintNo1Page number
limitintNo12Items per page (12/24/48)
product_namestringNo-Fuzzy search by product name
category_namestringNo-Fuzzy search by category name
min_pricefloatNo-Minimum price (original, not USD)
max_pricefloatNo-Maximum price
product_statusstringNo10=unpublished, 1=published (default returns only published)

Response list item fields

FieldTypeDescription
product_idstringProduct ID/SKU
product_namestringProduct name
category_namestringCategory name
imagestringMain image URL (normalized, local image preferred)
price_displaystringPrice display (USD, e.g., $19.99 or $10.00-29.99)
price_rangestringOriginal price range
min_pricefloatOriginal minimum price
max_pricefloatOriginal maximum price
stock_quantityintStock quantity
product_statusint0=unpublished, 1=published
GET /api/product/detail Login Required
Product Detail

Request Parameters (Query)

ParameterTypeRequiredDescription
product_id*stringYesProduct ID/SKU
Response: In addition to list item fields, includes product_name_en, product_description, main_image_url, main_image_url_local, sku_count, weight, length, width, height, source_url, supplier_name, tags, images array, etc.
GET /api/product/inventory Login Required
Inventory Query
Single product inventory query for external systems like WooCommerce plugins. At least one of product_id or sku must be provided.

Request Parameters (Query)

ParameterTypeRequiredDescription
product_idstringOne of twoProduct ID (exact match)
skustringOne of twoSKU number (fuzzy match)
shop_idstringNoShop ID filter

Response Fields

FieldTypeDescription
product_idstringProduct ID
product_namestringProduct name
skustringSKU number (same as product_id)
stock_quantityintTotal stock
available_quantityintAvailable stock (total - reserved, min 0)
min_pricefloatOriginal minimum price
max_pricefloatOriginal maximum price
currencystringCurrency (fixed USD)
last_updatedstringLast update time (prefers last_sync_time)
POST /api/product/inventory/batch Login Required
Batch Inventory Query

Request Parameters (Body, JSON)

ParameterTypeRequiredDescription
product_idsarrayOne of twoProduct ID array, e.g., ["SKU001","SKU002"]
skusarrayOne of twoSKU array
shop_idstringNoShop ID filter

Response Example

{ "code": 200, "data": { "list": [ { "product_id": "SKU001", "product_name": "Product A", "sku": "SKU001", "stock_quantity": 100, "available_quantity": 95, "min_price": 10.5, "max_price": 25.0, "currency": "USD", "last_updated": "2026-08-10 15:30:00" } ], "total": 2 } }

Orders

Order list, detail, and status enum endpoints. Data is isolated by customer_id — users can only see their own orders.

GET /api/order/list Login Required
Order List

Request Parameters (Query)

ParameterTypeRequiredDefaultDescription
pageintNo1Page number
limitintNo10Items per page (10/20/50)
order_nostringNo-Fuzzy search by order number
statusstringNoallOrder status (see status options)
start_timestringNo-Order start date (YYYY-MM-DD)
end_timestringNo-Order end date (YYYY-MM-DD)

Response list item fields

FieldTypeDescription
idintInternal order ID
order_nostringOrder number
order_statusstringOrder status enum string
status_textstringStatus display text
total_amountfloatTotal order amount (raw value)
total_amount_formattedstringFormatted amount (e.g., $199.00)
currencystringCurrency
shipping_namestringRecipient name
shipping_countrystringShipping country
tracking_numberstringTracking number
created_atstringCreation time
GET /api/order/detail Login Required
Order Detail

Request Parameters (Query)

ParameterTypeRequiredDescription
id*intYesInternal order ID

Additional Response Fields

FieldTypeDescription
itemsarrayOrder items: {order_id, order_no, product_id, product_name, sku, image, price, quantity, subtotal, created_at}
logisticsobjectLatest logistics record (last entry in order_logistics table)
GET /api/order/status-options Login Required
Order Status Options
[ { "value": "all", "label": "All" }, { "value": "pending", "label": "Pending" }, { "value": "processing", "label": "Processing" }, { "value": "shipped", "label": "Shipped" }, { "value": "completed", "label": "Completed" }, { "value": "cancelled", "label": "Cancelled" }, { "value": "refunded", "label": "Refunded" } ]

Tickets

Customer ticket system supporting ticket creation, viewing, and replies. Data is isolated by customer_id.

GET /api/ticket/list Login Required
Ticket List

Request Parameters (Query)

ParameterTypeRequiredDefaultDescription
pageintNo1Page number
limitintNo10Items per page (10/20/50)
statusstringNoallTicket status (see status options)
typestringNoallTicket type (see type options)
start_timestringNo-Start date (YYYY-MM-DD)
end_timestringNo-End date (YYYY-MM-DD)

Additional list item fields

FieldTypeDescription
status_textstringStatus display text
type_textstringType display text
GET /api/ticket/detail Login Required
Ticket Detail

Request Parameters (Query)

ParameterTypeRequiredDescription
id*intYesTicket ID

Additional Response Fields

FieldTypeDescription
repliesarrayReply list (ascending by creation time): {ticket_id, user_id, user_type (customer/admin), content, created_at}
POST /api/ticket/create Login Required
Create Ticket

Request Parameters (Body, JSON)

ParameterTypeRequiredDescription
type*stringYesTicket type: question/complaint/suggestion/bug/other
title*stringYesTicket title (trimmed)
content*stringYesTicket content (trimmed)
Response data: { "id": 123 }. New ticket status is automatically set to pending.
POST /api/ticket/reply Login Required
Reply to Ticket

Request Parameters (Body, JSON)

ParameterTypeRequiredDescription
ticket_id*intYesTicket ID (must belong to current user)
content*stringYesReply content
After a successful reply, the ticket status is automatically updated to replied. The replier's user_type is fixed as customer.
Response data: { "id": 456 } (ID of the new reply record).
GET /api/ticket/status-options Login Required
Ticket Status Options
[ { "value": "all", "label": "All" }, { "value": "pending", "label": "Pending" }, { "value": "processing", "label": "Processing" }, { "value": "replied", "label": "Replied" }, { "value": "resolved", "label": "Resolved" }, { "value": "closed", "label": "Closed" } ]
GET /api/ticket/type-options Login Required
Ticket Type Options
[ { "value": "all", "label": "All" }, { "value": "question", "label": "Question" }, { "value": "complaint", "label": "Complaint" }, { "value": "suggestion", "label": "Suggestion" }, { "value": "bug", "label": "Bug Report" }, { "value": "other", "label": "Other" } ]

Sourcing

Customers submit sourcing requests, view quotes, and communicate with consultants via messages. Data is isolated by user_id + super_id.

POST /api/sourcing/submit Login Required
Submit Sourcing Request

Request Parameters (Body, JSON)

ParameterTypeRequiredDescription
product_imagestringOne of twoProduct image URL (product_image or product_url must be non-empty)
product_urlstringOne of twoProduct link URL
product_namestringNoProduct name
product_nostringNoProduct number
quote_pricefloatNoReference quote (default 0.00, USD)
country_idintNoTarget country ID (default 0)
accept_similar_productsboolNoAccept similar products (default false, stored as 1 when true)
additional_infostringNoAdditional information
communication_infostringNoContact notes

Response Example

{ "code": 200, "msg": "Submit successful", "data": { "id": 123, "status": 1, "status_text": "Pending Quote", "created_at": "2026-08-10 10:00:00" } }
GET /api/sourcing/list Login Required
Sourcing List

Request Parameters (Query)

ParameterTypeRequiredDefaultDescription
pageintNo1Page number
limitintNo20Items per page (10/20/50)
statusintNo-Numeric status filter 1~5 (no filter if empty/non-numeric)
product_namestringNo-Fuzzy match by product name
product_nostringNo-Exact match by product number
start_timestringNo-Creation start time (YYYY-MM-DD or YYYY-MM-DDTHH:mm)
end_timestringNo-Creation end time

Response list item fields

FieldTypeDescription
idintSourcing record ID
product_namestringProduct name
product_nostringProduct number
product_imagestringProduct image
statusintStatus number (1-5)
status_textstringStatus display text
quote_pricefloatQuote price
accept_similar_productsintAccept similar products 0/1
accept_similar_textstringYes/No text
linked_productobject|nullMatched product {sku, product_name, image, price_range}, null if not matched
GET /api/sourcing/detail Login Required
Sourcing Detail

Request Parameters (Query)

ParameterTypeRequiredDescription
id*intYesSourcing record ID

Additional Response Fields

FieldTypeDescription
quotesarrayQuote records (descending by create_time)
communicationsarrayCommunication records (descending by create_time)
GET /api/sourcing/history Login Required
Sourcing History
Returns only completed records: status 4 (quote failed) or 5 (quote successful). Pagination and search parameters are the same as the list endpoint. Sorted by update_time descending.
GET /api/sourcing/stats Login Required
Sourcing Statistics
{ "code": 200, "data": { "total": 100, "pending_quote": 20, "quoting": 15, "pending_confirmation": 10, "quotation_failure": 25, "quote_success": 30 } }
GET /api/sourcing/myList Login Required
My Sourcing (Simplified)
Simplified sourcing list endpoint. Uses pagination structure (not last_page).

Request Parameters (Query)

ParameterTypeRequiredDefaultDescription
pageintNo1Page number
pageSizeintNo20Items per page (note: parameter name is pageSize, not limit)
statusstringNo-Empty = all; otherwise converted to int for filtering
Additional list item fields: product_images (JSON array), currency, update_time.
GET /api/sourcing/myDetail Login Required
My Sourcing Detail (with messages)

Request Parameters (Query)

ParameterTypeRequiredDescription
id*intYesSourcing record ID

Additional Response Fields (vs list)

FieldTypeDescription
product_skustringMatched product SKU
product_imagesarrayProduct images array (JSON decoded)
messagesarrayMessage list (ascending by create_time): {id, sender_type (user/admin), sender_id, content, image_urls, msg_type (text/image), create_time}
POST /api/sourcing/sendMessage Login Required
Send Text Message

Request Parameters (Body, JSON)

ParameterTypeRequiredDescription
sourcing_id*intYesSourcing record ID (must belong to current user)
content*stringYesMessage text content
Sender sender_type is fixed as user, sender_id is the current logged-in user ID, msg_type is fixed as text.

Response data

{ "id": 789, "sourcing_id": 123, "content": "Message text content", "create_time": "2026-08-10 15:30:00" }
POST /api/sourcing/uploadImage Login Required
Upload Sourcing Image
Two upload modes are available:

Mode 1: Upload product image only (multipart/form-data)

PathFieldDescriptionResponse
/api/sourcing/uploadImageimage (file)Upload image only, no message sent{ image_url: "/storage/sourcing/..." }

Mode 2: Upload image and auto-send as message (multipart/form-data)

PathFieldDescription
/api/sourcing/uploadMessageImagesourcing_id + image (file)Uploads image and automatically creates a msg_type=image message record with content [Image]
Response fields: message_id, image_url, create_time.
GET /api/sourcing/status-options Login Required
Sourcing Status Options
[ { "value": 1, "label": "Pending Quote" }, { "value": 2, "label": "Quoting" }, { "value": 3, "label": "Pending Confirmation" }, { "value": 4, "label": "Quote Failed" }, { "value": 5, "label": "Quote Successful" } ]

Subscribed Successfully

Thank you for subscribing to our Newsletter. We will send you the latest updates regularly.