Shopee
Shop info, products, stock and price, orders and shipping, seller chat
Experimental v0.1.0 Node.js 15 actions ToS risk low
About
A Graphrt plugin for a seller's shop on the Shopee Open Platform v2 (partner.shopeemobile.com/api/v2). It covers the shop, products, stock and prices, orders, shipping and seller chat. Every request is signed with your app's partner key, as Shopee requires.
What it can do
- Shop: get_shop_info
- Products: - get_item_list (offset paging) and get_item_base_info (up to 50 items). - update_stock and update_price (node only, up to 50 models per call). The result shows Shopee's failure_list, so you can see which models were rejected. A model (or model and location) may appear only once per call.
- Orders: get_order_list (a window of at most 15 days, checked before the call) and get_order_detail (up to 50 orders)
- Shipping: get_shipping_parameter, ship_order (node only, pickup, drop-off or non-integrated) and get_tracking_number
- Seller chat: sellerchat_get_conversation_list, sellerchat_get_message and sellerchat_send_message (text, image URL, item card, order card)
- Token refresh (node only): refresh_access_token returns the new access token and the new refresh token
- api_request: any other v2 endpoint, signed. Use api_type: shop (the default) or api_type: public for partner-level APIs.
- Errors: Shopee's error envelope (error, message, request_id) is mapped to stable kinds, also when it arrives in an HTTP 200 body. A 2xx body without the envelope is an api_error. The partner key and tokens never appear in errors or in api_request results.
Actions
Each action is a step you can add to a workflow. Agents can also use most of them as tools.
- Get Shopee shop info
shopee-api.get_shop_info - List Shopee items
shopee-api.get_item_list - Get Shopee item details
shopee-api.get_item_base_info - Update Shopee stock
shopee-api.update_stock - Update Shopee price
shopee-api.update_price - List Shopee orders
shopee-api.get_order_list - Get Shopee order details
shopee-api.get_order_detail - Get Shopee shipping parameters
shopee-api.get_shipping_parameter - Ship a Shopee order
shopee-api.ship_order - Get Shopee tracking number
shopee-api.get_tracking_number
Show all 15 actions
- List Shopee chat conversations
shopee-api.sellerchat_get_conversation_list - Get Shopee chat messages
shopee-api.sellerchat_get_message - Send a Shopee chat message
shopee-api.sellerchat_send_message - Refresh Shopee access token
shopee-api.refresh_access_token - Shopee Open Platform v2 request
shopee-api.api_request
Settings
Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.
-
SHOPEE_PARTNER_IDRequiredApp partner id (a number). Test and live apps have different ids -
SHOPEE_PARTNER_KEYRequiredApp partner key, used to sign every request. Never an argument -
SHOPEE_SHOP_IDRequiredThe authorized shop's id -
SHOPEE_ACCESS_TOKENFor shop operationsShop access token. It is valid for 4 hours -
SHOPEE_REFRESH_TOKENFor refresh_access_tokenRefresh token. It is valid for 30 days and can be used once -
SHOPEE_ENVOptionallive (default, partner.shopeemobile.com) or test (sandbox, openplatform.sandbox.test-stable.shopee.sg)
How to use it
In Graphrt Desktop
- Open Plugins and search for Shopee.
- Click Install and approve it.
- Follow the setup steps on the plugin's page, then paste the settings it needs.
- Describe a job that needs it, and the builder adds the steps.
With the CLI
terminal
$ graphrt plugin install shopee-api --yes workflow.yaml
- id: orders
type: shopee-api.get_order_list
time_from: 1763424000 # Unix seconds
time_to: 1764633600 # at most 15 days later
order_status: READY_TO_SHIP
- id: stock
type: shopee-api.update_stock
item_id: 800123
stock_list: [{ model_id: 0, stock: 25 }]
- id: reply
type: shopee-api.sellerchat_send_message
to_id: "556677"
text: "Terima kasih, pesanan sudah dikirim!"