Data & connections

Automate Shopee with n8n through the API, without applying for your own Shopee app

Create an API key on Quantri360 Partner, import the n8n workflow template for Shopee and enter the key in the Header Auth credential. n8n calls the Shopee API through 360 with no partner_id or signature. From there, continue on to Google Sheets, Telegram, a CRM or an AI agent.

The problem: why is n8n hard for sellers to use with Shopee?

It is hard because Shopee only grants API access to apps approved on Shopee Open Platform. Every call must be signed with partner_id, a secret key and the shop's token, and the token expires after a few hours and must be refreshed. A small or mid-sized shop rarely has anyone to handle this.

The result is that n8n gets used halfway. People download files by hand, push them to Drive, then let n8n read the files. The data still passes through human hands, is still a day late, and can still be edited.

Quantri360 already has an approved Shopee app. Partner lets you call those same APIs with one API key; 360 handles signing, attaching the token and refreshing it.

Thinking leads the way: what data do you need, and how do you read it correctly?

Each workflow should answer one specific management question, not "pull everything". Ask the question first, then choose the API.

Automated task Shopee API (called through 360) Note
Yesterday's order list get_order_list window of up to 15 days, loop on cursor
Product details in an order get_order_detail up to 50 order IDs per call
Failed delivery alerts get_package_detail read the package status, not order_status
Money received by order get_escrow_detail take the figure after adjustment
Tracking the wallet balance get_wallet_transaction_list ledger entries item by item

Three traps that have produced real errors:

  • A broken cursor still returns 200. In the income API, next_page is an object { cursor, page_size }. Pass the whole object as the parameter and Shopee returns the first page again, so the loop adds the same 100 records several times. Always take the cursor field itself and deduplicate by order_sn: stop when a new page adds no new IDs.
  • Parameter errors count against the app, not only you. Shopee scores the app's successful call rate (it requires 90% or higher). So 360 checks required parameters against the catalog and returns a 400 error before calling Shopee. Read the error message carefully instead of letting the workflow retry over and over.
  • A completed order is not necessarily delivered. Failed deliveries stay COMPLETED. An alert workflow must read the package status LOGISTICS_DELIVERY_FAILED.

AI speeds it up: how long does setup take, and what are the steps?

From having a key to the first running workflow takes about 20 minutes. The ready-made template does the hardest part: calculating the time window and pagination.

  1. Sign up at Quantri360 Partner, turn on two-factor authentication, and authorize your shop on the Shopee platform.
  2. Create an API key under API management. You can restrict the key to the IP or IP range of the n8n server and set an expiry. Creating a key means agreeing to the terms: the key is not shared, and the data is used only for your own shops.
  3. Under Docs, download the n8n workflow template for Shopee and import it into n8n. The template includes: a 06:00 schedule → calculating the "yesterday" window in Vietnam time → an HTTP Request calling get_order_list through 360, looping on the cursor until more = false → splitting out each order.
  4. Create a Header Auth credential: Name Authorization, Value Bearer <key>. A brand with many shops fills in platform_shop_id.
  5. Connect the last node to the job you need: Google Sheets, Postgres, Telegram, or a further call to get_order_detail.

The equivalent call in the HTTP Request node:

curl -s "https://partner.quantri360.com/v1/shopee/api/v2/order/get_order_detail?order_sn_list=2510190ABCDEF1,2510190ABCDEF2&response_optional_fields=item_list,total_amount" \
  -H "Authorization: Bearer $KEY"

360 returns Shopee's original response, along with an X-Q360-Request-Id header for tracing errors. 360's error codes: 400 reserved_param (you sent a token or signature), 403 endpoint_not_allowed (the API is not open), and for 429 or 503 wait according to Retry-After.

Add AI to the workflow. After the order-splitting node, add an AI node (OpenAI or Anthropic) with a fixed prompt:

"Below is the list of packages that failed delivery yesterday: order ID, province, carrier, value. Group by carrier and province. Write 3 lines for the warehouse lead: which group is abnormal compared with the average rate, and which customers to call back first."

Send the result by Telegram or email every morning. AI summarizes; the manager decides whom to call.

Measurable results

A good workflow must be able to show what it saves and what it catches. Record the four numbers below in the first month of running.

  • Staff hours: the time spent downloading files, filtering and sending reports each week, before and after having the workflow.
  • Alert latency: the gap between a package changing status and the message arriving; with a daily schedule it is under 24 hours, and running hourly it is under one hour.
  • Discrepancies caught: the number of orders duplicated by the cursor (count duplicate IDs before deduplicating) and the number of failed deliveries counted as completed.
  • Calls: the Partner Usage page records monthly requests by platform and data type, plus how many times 360 called the marketplace; a sudden spike is a sign of a workflow making unnecessary calls.

Not ready to set up n8n? You can send orders directly to Google Sheets on a schedule. If you need a data warehouse for Power BI to read, see loading marketplace orders into SQL. Calls are counted by plan: see the pricing.

Read more: business process automation, the overview article for this topic.

Quantri360
Written by Quantri360 · Management & data consulting team

Building Quantri360, a multichannel sales risk management platform; writing about managing with real data and applying AI to operations.

Updated
Message us on Messenger