快工助手跨境电商知识与商机助手

v2.merchant.get_merchant_warehouse_list

Shopee 官方资料 · Shopee Open Platform 接口参考 · 适合开发者

stable本次发布有变化全部展示

来自 Shopee 官方资料快照 ·

打开官方原文 ↗
  1. 当前资料结构化阅读页
  2. 固定快照已留存,可追溯
  3. 官方原文可核对
查看技术与溯源信息
平台 / profile
Shopee / profile.shopee.api_reference
语言
en-US
发布版本
cn-20260909-2
标签
zhuge/sourceplatform/shopeeaudience/developercategory/api_doctopic/apitopic/developer

资料正文

§1 v2.merchant.get_merchant_warehouse_list

Get merchant warehouse with page

#

§2 Overview

Overview

FieldValue
ModuleMerchant
API typeMerchant
HTTP methodPOST
Path/api/v2/merchant/get_merchant_warehouse_list
Production URLhttps://partner.shopeemobile.com/api/v2/merchant/get_merchant_warehouse_list
Sandbox URLhttps://partner.test-stable.shopeemobile.com/api/v2/merchant/get_merchant_warehouse_list
PermissionERP System; Seller In House System; Product Management; Swam ERP
#

§3 Request parameters

Request parameters

NameTypeRequiredSampleDescription
cursorobjectYes// how to use DoubleSidedCursor; // Get data for the first page: Please pass next_id = 0 or nil, page_size = {your page size}.; // Get data for the next page: Please pass the Cursor from the previous response, and set prev_id=nil;; // Get data for the prev page: Please pass the Cursor from the previous response, and set next_id=nil;; // Stop fetching next data: The Cursor.next_id in the previous response is nil.; // Stop fetching prev data: The Cursor.prev_id in the previous response is nil.
cursor.next_idintNo
cursor.prev_idintNo
cursor.page_sizeintYesThe size of one page. Limit is [1,30].
warehouse_typeintYes1 means pickup warehouse; 2 means return warehouse
#

§4 Response parameters

Response parameters

NameTypeRequiredSampleDescription
request_idstringThe identifier of the API request for error tracking.
errorstringIndicate error type if hit error. Empty if no error happened.
messagestringIndicate error details if hit error. Empty if no error happened.
responseobject
response.total_countintTotal count of all warehouses.
response.warehouse_listobject[]
response.warehouse_list.warehouse_idintWarehouse address identifier.
response.warehouse_list.warehouse_namestringThe warehouse name filled in when creating the warehouse.
response.warehouse_list.warehouse_typeint1 means pickup warehouse; 2 means return warehouse
response.warehouse_list.warehouse_regionstringRegion of your warehouse.
response.warehouse_list.location_idstringLocation identifier for stocks. Different location_ids represent that your addresses are in different item stocks.
response.warehouse_list.addressobject
response.warehouse_list.address.address_namestringThe address name filled in when creating the warehouse.
response.warehouse_list.address.regionstringRegion of your warehouse address.
response.warehouse_list.address.addressstringDetail address of your warehouse address.
response.warehouse_list.address.citystringCity of your warehouse address.
response.warehouse_list.address.districtstringDistinct of your warehouse address.
response.warehouse_list.address.statestringState of your warehouse address.
response.warehouse_list.address.townstringTown of your warehouse address.
response.warehouse_list.address.zip_codestringZipcode of your warehouse address.
response.warehouse_list.enterprise_infoobject
response.warehouse_list.enterprise_info.company_namestring
response.warehouse_list.enterprise_info.cnpjstring
response.warehouse_list.enterprise_info.state_registration_numberstring
response.warehouse_list.enterprise_info.is_freight_payerboolean
response.cursorobject
response.cursor.next_idint
response.cursor.prev_idint
response.cursor.page_sizeint
#

§5 Common parameters

Common parameters

NameTypeRequiredSampleDescription
partner_idint1Partner ID is assigned upon registration is successful. Required for all requests.
timestamptimestamp1610000000This is to indicate the timestamp of the request. Required for all requests. Expires in 5 minutes.
access_tokenstringc09222e3fc40ffb25fc947f738b1abf1The token for API access, using to identify your permission to the api. Valid for multiple use and expires in 4 hours.
merchant_idint1Shopee’s unique identifier for a merchant. Required for all merchant level requests(CB CNSC user calling global product related APIs).
signstringe318d3e932719916a9f9ebb57e2011961bd47abfa54a36e040d050d8931596e2Signature generated by partner_id, api path, timestamp, access_token, merchant_id and partner_key via HMAC-SHA256 hashing algorithm. More details: https://open.shopee.com/documents?module=87&type=2&id=58&version=2
#

§6 Request samples

Request samples

#

§7 Payload

Payload

{
    "warehouse_type": 1,
    "cursor": {
        "next_id": 0,
        "page_size": 30
    }
}
#

§8 Java

Java

Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://open.admin.shopee.io/api/v2/merchant/get_merchant_warehouse_list?access_token=access_token&merchant_id=merchant_id&partner_id=partner_id&sign=sign&timestamp=timestamp")
.header("Content-Type","application/json")
.body("{
   \"cursor\": {
      \"next_id\": 100,
      \"page_size\": 30,
      \"prev_id\": 100
   }
}")
.asString();
#

§9 PHP

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://open.admin.shopee.io/api/v2/merchant/get_merchant_warehouse_list?access_token=access_token&merchant_id=merchant_id&partner_id=partner_id&sign=sign&timestamp=timestamp',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
    "cursor": {
        "next_id": 100,
        "page_size": 30,
        "prev_id": 100
    }
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
#

§10 cURL

cURL

curl --location --request POST 'https://open.admin.shopee.io/api/v2/merchant/get_merchant_warehouse_list?access_token=access_token&merchant_id=merchant_id&partner_id=partner_id&sign=sign&timestamp=timestamp' \
--header 'Content-Type: application/json' \
--data-raw '{
   "cursor": {
      "next_id": 100,
      "page_size": 30,
      "prev_id": 100
   }
}'
#

§11 Python

Python

import requests
import json

url = "https://open.admin.shopee.io/api/v2/merchant/get_merchant_warehouse_list?access_token=access_token&merchant_id=merchant_id&partner_id=partner_id&sign=sign&timestamp=timestamp"

payload=json.dumps({
  "cursor": {
    "next_id": 100,
    "page_size": 30,
    "prev_id": 100
  }
})
headers = {
  'Content-Type': 'application/json'
}
response = requests.RPCRequest("POST",url,headers=headers, data=payload, allow_redirects=False)

print(response.text)
#

§12 Response sample

Response sample

#

§13 JSON

JSON

{
    "error": null,
    "message": null,
    "request_id": "9b73908eb0237c86670147a8883b7210",
    "response": {
        "cursor": {
            "next_id": null,
            "page_size": 30,
            "prev_id": null
        },
        "total_count": 12,
        "warehouse_list": [
            {
                "address": {
                    "address": "Calle Becal, MZ28 LT23, test",
                    "address_name": "mx tester",
                    "city": "Tlalpan",
                    "district": "Ciudad de México",
                    "region": "MX",
                    "state": "Ciudad de México",
                    "town": "Lomas de Padierna",
                    "zip_code": "14240"
                },
                "enterprise_info": null,
                "location_id": "MX1004MQZ",
                "warehouse_id": 10001027,
                "warehouse_name": "MX Warehouse 1",
                "warehouse_region": "MX",
                "warehouse_type": 1
            },
            {
                "address": {
                    "address": "Rodovia Raposo Tavares, 001",
                    "address_name": "xinjian chen",
                    "city": "Sorocaba",
                    "district": "Parque Reserva Fazenda Imperial",
                    "region": "BR",
                    "state": "São Paulo",
                    "town": "",
                    "zip_code": "18052775"
                },
                "enterprise_info": {
                    "cnpj": "52069476000182",
                    "company_name": "J.filho Comercio Atacado e Var",
                    "is_freight_payer": true,
                    "state_registration_number": "798873714116"
                },
                "location_id": "BR1004MQZ",
                "warehouse_id": 10001024,
                "warehouse_name": "BR Warehouse 1",
                "warehouse_region": "BR",
                "warehouse_type": 1
            },
            {
                "address": {
                    "address": "南山街道",
                    "address_name": "yuangx",
                    "city": "深圳市",
                    "district": "南山区",
                    "region": "CN",
                    "state": "广东省",
                    "town": "",
                    "zip_code": "518000"
                },
                "enterprise_info": null,
                "location_id": "CNZ",
                "warehouse_id": 10001022,
                "warehouse_name": "CN Warehouse",
                "warehouse_region": "CN",
                "warehouse_type": 1
            },
            {
                "address": {
                    "address": "新北市樹林區味王街197號",
                    "address_name": "Jwadi",
                    "city": "樹林區",
                    "district": "",
                    "region": "TW",
                    "state": "新北市",
                    "town": "",
                    "zip_code": "238"
                },
                "enterprise_info": null,
                "location_id": "TW1003UYZ",
                "warehouse_id": 10001021,
                "warehouse_name": "TW Warehouse 2",
                "warehouse_region": "TW",
                "warehouse_type": 1
            },
            {
                "address": {
                    "address": "18 Mosque St,Singapore 059498, #2",
                    "address_name": "Grabovich",
                    "city": "",
                    "district": "",
                    "region": "SG",
                    "state": "",
                    "town": "",
                    "zip_code": "059498"
                },
                "enterprise_info": null,
                "location_id": "SG1006Y4Z",
                "warehouse_id": 10001020,
                "warehouse_name": "SG Warehouse 2",
                "warehouse_region": "SG",
                "warehouse_type": 1
            },
            {
                "address": {
                    "address": "11",
                    "address_name": "insed",
                    "city": "KAB. BADUNG",
                    "district": "ABIANSEMAL",
                    "region": "ID",
                    "state": "BALI",
                    "town": "",
                    "zip_code": "80352"
                },
                "enterprise_info": null,
                "location_id": "ID1003VGZ",
                "warehouse_id": 10001018,
                "warehouse_name": "ID Warehouse 1",
                "warehouse_region": "ID",
                "warehouse_type": 1
            },
            {
                "address": {
                    "address": "11",
                    "address_name": "Jerick Tolsky",
                    "city": "Batu Pahat",
                    "district": "",
                    "region": "MY",
                    "state": "Johor",
                    "town": "",
                    "zip_code": "16434"
                },
                "enterprise_info": null,
                "location_id": "MY1004MSZ",
                "warehouse_id": 10001017,
                "warehouse_name": "MY Warehouse 1",
                "warehouse_region": "MY",
                "warehouse_type": 1
            },
            {
                "address": {
                    "address": "12",
                    "address_name": "J Wa Neil",
                    "city": "อำเภอคลองท่อม",
                    "district": "ตำบลคลองท่อมใต้",
                    "region": "TH",
                    "state": "จังหวัดกระบี่",
                    "town": "",
                    "zip_code": "81120"
                },
                "enterprise_info": null,
                "location_id": "TH1004MQZ",
                "warehouse_id": 10001016,
                "warehouse_name": "TH Warehouse 1",
                "warehouse_region": "TH",
                "warehouse_type": 1
            },
            {
                "address": {
                    "address": "11",
                    "address_name": "Alchomyaceae",
                    "city": "Metro Manila",
                    "district": "Santa Cruz",
                    "region": "PH",
                    "state": "Metro Manila",
                    "town": "Barangay 297",
                    "zip_code": "1003"
                },
                "enterprise_info": null,
                "location_id": "PH1003UYZ",
                "warehouse_id": 10001015,
                "warehouse_name": "PH Warehouse 1",
                "warehouse_region": "PH",
                "warehouse_type": 1
            },
            {
                "address": {
                    "address": "11",
                    "address_name": "Dũng Nguyễn",
                    "city": "Thành Phố Thủ Đức",
                    "district": "Phường An Khánh",
                    "region": "VN",
                    "state": "TP. Hồ Chí Minh",
                    "town": "",
                    "zip_code": ""
                },
                "enterprise_info": null,
                "location_id": "VN1002BGZ",
                "warehouse_id": 10001014,
                "warehouse_name": "VN Warehouse 1",
                "warehouse_region": "VN",
                "warehouse_type": 1
            },
            {
                "address": {
                    "address": "台北市大同區民生西路63號",
                    "address_name": "Sal Tori",
                    "city": "大同區",
                    "district": "",
                    "region": "TW",
                    "state": "臺北市",
                    "town": "",
                    "zip_code": "103"
                },
                "enterprise_info": null,
                "location_id": "TW10066AZ",
                "warehouse_id": 10001013,
                "warehouse_name": "TW Warehouse 1",
                "warehouse_region": "TW",
                "warehouse_type": 1
            },
            {
                "address": {
                    "address": "32 Tras St, CLUB HIROSHIMA, Singapore 078972, #1",
                    "address_name": "Alois Ospelt",
                    "city": "",
                    "district": "",
                    "region": "SG",
                    "state": "",
                    "town": "",
                    "zip_code": "078972"
                },
                "enterprise_info": null,
                "location_id": "SG10066CZ",
                "warehouse_id": 10001012,
                "warehouse_name": "SG Warehouse 1",
                "warehouse_region": "SG",
                "warehouse_type": 1
            }
        ]
    }
}
#

§14 Error example

Error example

#

§15 JSON

JSON

{
    "error": "error_param",
    "message": "warehouse_type: warehouse_type must be one of the following: 1, 2",
    "request_id": "7f56a3913bb0f7d9a8a666de836ca6ca",
    "response": null
}
#

§16 Errors

Errors

ErrorDescriptionSolution
error_dataparse data failed
error_datadata not exist
error_paramparameter invalid
error_paramThe information you queried is not found.
error_paramWrong parameters, detail: {msg}.
error_serverSomething wrong. Please try later.
error_paramrequest not from gateway
#

§17 Common errors

Common errors

ErrorDescriptionSolution
error_authpartner_id is invalid
error_authThe App is deleted, and you'll be unable to make any API call.
error_authApp developer’s permissions for authorizations have been restricted. If you’re a seller, contact the developer for more information. If you’re the developer, refer to the Open Platform Console for details.
error_paramThere is no partner_id in query.
error_paramInvalid partner_id.
error_paramno timestamp
error_paramInvalid timestamp
error_paramThere is no sign in query.
error_signWrong sign.
invalid_partner_idInvalid partner_id, please have a check.
error_authNo permission to current api.
error_api_call_restrictedThe App permission for api call have been restricted. If you’re a seller, contact the developer for more information. If you’re the developer, refer to the Open Platform Console for details.
api_suspendedThe API is offline. Please call v2 API instead.
error_limitThe total API call number made by your APP has reached the daily API call limit, please try again after 00: 00 (UTC+08:00)
error_rate_limitToo many requests. You have reached the rate limit. Please try again later.
source_ip_undeclaredRequest Source IP ({ip}) is undeclared. Please declare all your IP addresses in the Shopee Open Platform Console > App list > IP Address Whitelist
error_paramPermission denied. This API is currently offline or the request path is incorrect.
error_paramPartner_id is invalid, should be an integer between 0 and 4294967295.
error_paramno timestamp.
error_paramTimestamp is invalid, should be an integer between 0 and 4294967295.
error_paramTimestamp is expired.
error_partner_key_expiredYour API partner key has expired, please reset the Live API Partner Key in Console to get a new valid partner key to call open api.
error_api_permissionThis app type has no permission to this API.
error_paramThere is no access_token in query.
error_authInvalid access_token.
merchant_no_linkedPartner and merchant has no linked.
invalid_acceess_tokenInvalid access_token, please have a check.
partner_frozenThe Partner has been frozen. Permissions for merchant authorization and API calls have been suspended until permissions are restored.
error_paramThere is no merchant_id in query.
error_parammerchant_id is invalid, should be an integer between 0 and 4294967295.
#

§18 Update log

Update log

DateChange
2023-12-14New API
#