Skip to content

Codes and constants ​

The keys and numbers used across the API. They also appear as enums in the API Reference.

Shipping types ​

shipping_type is one of the keys below. Combine it with is_cod:

  • is_cod: false (the default) uses the plain key, e.g. "ems".
  • is_cod: true switches to that courier's cash-on-delivery key, e.g. "ems" becomes ems_cod. Sending the _cod key directly works too — but then is_cod must be true, and a plain key with is_cod: true is a 400 when the courier has no COD form.

Responses use these same keys, plus is_cod — an order booked as ems_cod comes back as "shipping_type": "ems_cod" with "is_cod": true. An order the store later switched, in the app, to a courier not on this list reads back under that courier's key; you just cannot ask for one.

The list is everything this API will book. XSelly itself carries a few more couriers, mostly small or retired ones; asking for one of those returns a 400.

shipping_typecouriername in the XSelly appis_cod available
bestBEST ExpressBEST Expressyes
best_pickupBEST Express [นัดรับ]BEST Express [นัดรับ]
buyer_pickupผู้ซื้อรับด้วยตัวเองผู้ซื้อรับด้วยตนเอง
dhlDHL ExpressDHL Expressyes
dhl_bulkyDHL BulkyDHL Bulkyyes
dhl_pickupDHL [นัดรับ]DHL Express [นัดรับ]
ecopostปณ eCo-Postไปรษณีย์ eCo-Postyes
emsEMSไปรษณีย์ด่วนพิเศษ (EMS)yes
ems_worldEMS WorldEMS World (ระหว่างประเทศ)
fast_instant_delivery_pack_2_hrsส่งทันที (แพ็ค 2 ชั่วโมง)ส่งทันที (แพ็ค 2 ชั่วโมง)
fast_instant_delivery_pack_30_minsส่งทันที (แพ็ค 30 นาที)ส่งทันที (แพ็ค 30 นาที)
fedexFedExFedEx
flashFLASH ExpressFlash Expressyes
flash_bulkyFlash BulkyFlash Bulkyyes
flash_pickupFlash Express [นัดรับ]Flash Express [นัดรับ]
fuzeFUZEFUZEyes
grabGrabGrab
interInter Express LogisticsInter Express Logistics
ittransportIT TransportIT Transport
jtJ&T ExpressJ&T Expressyes
jt_cod_pickupJ&T Express [COD นัดรับ]J&T Express [COD นัดรับ]
jt_pickupJ&T Express [นัดรับ]J&T Express [นัดรับ]
kexKEX ExpressKerry Expressyes
kex_dropoffKEX Express [Drop-Off]Kerry Express [Drop-Off]
kex_pickupKEX Express [นัดรับ]Kerry Express [นัดรับ]
lalamoveLalamoveLalamove
lexLazada ExpressLazada Expressyes
linemanLinemanLineman
makesendMAKESENDMAKESENDyes
nimNiM ExpressNiM Expressyes
normalปณ ธรรมดาไปรษณีย์ธรรมดา
otherส่งแบบอื่นๆอื่นๆ
registerปณ ลงทะเบียนไปรษณีย์ลงทะเบียนyes
scgSCG EXPRESSSCG Expressyes
shopee_std_deliveryShopee Standard DeliverySPX Standard Delivery
shopee_std_delivery_bulkyShopee Standard Delivery BulkySPX Standard Delivery Bulky
shopee_xpressShopee XpressSPX Expressyes
shopee_xpress_bulkyShopee Express BulkySPX Bulky
skootarSkootarSkootar
slow_instant_deliveryส่งด่วนส่งด่วน
speeddSPEED-DSPEED-Dyes
spx_dropoffSPX Express [Dropoff]SPX Express [Dropoff]yes
spx_pickupSPX Express [Pickup]SPX Express [Pickup]yes
store_frontส่งมอบหน้าร้านขายหน้าร้าน
tpTP LogisticsTP Logisticsyes
trueTrue e-LogisticsTrue e-Logisticsyes
undefinedไม่ระบุไม่ระบุ
upsupsups (United Parcel Service)
ztoZTO ExpressZTO Expressyes

One key exists only in its COD form, so send it directly with is_cod: true:

shipping_typecouriername in the XSelly app
spx_express_bulky_codSPX Bulky [COD]SPX Bulky [COD]

Not every courier here can be booked automatically — XShipping issues tracking numbers for the major ones (ems, ecopost, kex, flash, jt, spx_pickup, spx_dropoff), and for the rest the order is created with that shipping type and you supply the tracking number yourself. store_front, buyer_pickup and other are not couriers at all; they record that the customer collects the parcel.

Sales channels ​

Optional. channel tags the order with where the sale came from — it is the ช่องทางการขาย shown in the app and used in the sales reports.

keyshown askeyshown as
ai_chatAI Chatline_shoppingLINE SHOPPING
branchสาขาmarketingMarketing
claimเคลมothersอื่นๆ
consignmentฝากขายrepurchaseRepurchase
dealerDealerresellers_not_yet_use_appตัวแทนที่ไม่ได้ใช้ XSelly
distributorDistributorrobinhoodRobinhood
eleven_street11stsales_pageSales Page
eventEventshopหน้าร้าน
facebookFacebookshopeeShopee
facebook_pageFacebook Pageshopee_foodShopeeFood
foodpandafoodpandashopifyShopify
friendเพื่อนtelesalesTelesales
grabGrabtiktokTikTok Shop
influencerInfluencertwitterTwitter
instagramInstagramvrichV Rich
japanesepartnerJapanese PartnerwebsiteWebsite
lazadaLazada
lineLINE
line_addLINE @
line_manLINE MAN

legal_entity_type says what the customer is, and with it what legal_entity_id holds. Both are only needed for a tax invoice.

An individual (legal_entity_id is a national id, เลขประจำตัวประชาชน):

valuemeaning
1บุคคลธรรมดา — a person
3ห้างหุ้นส่วนสามัญ — ordinary partnership
4ร้านค้า — a shop
5คณะบุคคล — group of persons

A juristic person (legal_entity_id is a tax id, เลขประจำตัวผู้เสียภาษี):

valuemeaning
11บริษัทจำกัด — limited company (the common one)
12บริษัทมหาชนจำกัด — public limited company
13ห้างหุ้นส่วนจำกัด — limited partnership
14มูลนิธิ — foundation
15สมาคม — association
16กิจการร่วมค้า — joint venture
19อื่นๆ — other
2นิติบุคคล — a legacy catch-all, still stored on older addresses

branch_type goes with these: "h" for a head office (สำนักงานใหญ่), or "b" plus a branch_number for a branch.

Order state ​

order_state is where the order sits in its own lifecycle.

valuemeaning
101Waiting to be confirmed.
102Confirmed by the buyer, waiting on the seller (reseller chains).
103Confirmed by the seller, waiting on the buyer (reseller chains).
109Confirmed. An order created through this API starts here.
181Cancelled by the seller.
182Cancelled by the buyer.
183Cancelled by the system.
184Cancelled — expired unpaid.

Any value from 181 up means cancelled; cancel_time is then set.

Payment state ​

valuemeaning
111Awaiting payment. A new order starts here.
112Overpaid — more was received than the order is worth.
113Both a payment and a refund are open.
114A payment is recorded and waiting to be confirmed.
115A refund is waiting to be confirmed.
119Paid in full. payment_complete_time is set.

Shipping state ​

valuemeaning
121Nothing shipped yet. A new order starts here.
122Only lines sourced from a supplier are left to ship.
129Everything shipped. shipping_complete_time is set.

XSelly Open Platform API v1 · Webhooks v2