来自 Shopee 官方资料快照 ·
- 当前资料结构化阅读页
- 固定快照已留存,可追溯
- 官方原文可核对
查看技术与溯源信息
- 平台 / profile
- Shopee / profile.shopee.faq
- 语言
- en
- 发布版本
cn-20260909-2- 标签
- zhuge/sourceplatform/shopeeaudience/developercategory/help_centertopic/apitopic/developertopic/faqtopic/live-authorization-issuetopic/seller-authorization
资料正文
§1 "access_token" and "refresh_token" related error meanings and use cases
"access_token" and "refresh_token" related error meanings and use cases
Q1: What does the error, "your access to shop has expired.", mean?
A1: The shop authorization expires, and the seller needs to re-authorize your system. After the shop authorization is successful, the validation duration period will normally last one year (given that the seller authorizes one year access permission and doesn't cancel the authorization or the platform's automatic unbinding rule is not triggered within the period). After one year, the seller needs to re-authorize your system.
There are two ways to know whether the shop authorization is about to expire.
- Call the "v2.shop.get_shop_info" API to get the "expire_time" field.
- Call the "v2.push.set_app_push_config" API to turn on the authorization expiry notification service which will push the list of shops expiring in 7 days.
Q2: What does the error, "Invalid access_token.", mean?
A2: The "access_token" is incorrect, which may be due to the following reasons:
- The "access_token" becomes invalid 4 hours after it is generated. To receive the most recent "access_token", you must call the "v2.public.refresh_access_token" API on a frequent basis.
- The "access_token" is wrong. For example, you may enter another shop's "access_token". Please ensure that you are using the correct shop's "access_token".
- There's no access_token in the request body.
Q3: What does the error, "Your refresh_token expired." mean?
A3: The "refresh_token" has expired. After the "refresh_token" is generated, it will expire in 30 days. When this error occurs, either the seller re-authorizes the developer to access the shop or the developer calls the "v2.public.get_token_by_resend_code" API to get the "refresh_token", and pays attention to the subsequent timely call for the "refresh_access_token" API.
Q4: What does the error, "Invalid refresh_token" mean?
A4: The requested "refresh_token" is incorrect, which may be due to the following two reasons:
- The "refresh_token" has been refreshed, and you are using the old "refresh_token".
There are two situations in which "refresh_token" is triggered: the seller re-operates the shop authorization or you use the "v2.public.refresh_access_token" API to operate the refresh. If you cannot retrieve the "refresh_token", please contact the seller to re-authorize.
- The "refresh_token" is wrong; for example, you may use another shop's "refresh_token". If you cannot retrieve the "refresh_token", please contact the seller to re-authorize.
Q5: Why does it return the error, "There is no partner_id in query", when I call the "v2.public.get_access_token" API?
A5: Please follow the example below and note that "partner_id" is required in both the request URL and request body.
Q6: When calling the "v2.public.get_access_token" API, I don't know when I should input "main_account_id" and when for "shop_id".
A6: When you are a CNSC seller and use the Main Account for authorization, you should enter the "main_account_id". When you are a non-CNSC seller, you should enter the "shop_id". CNSC sellers are currently only for cross-border sellers
Q7: How to obtain the "refresh_token" and the "access_token" of SIP(Shopee International Platform) Affiliated Shop?
A7: Whether you are a CNSC seller or a normal seller, after the SIP Parent Shop is successfully authorized, the "access_token" and the "refresh_token" obtained by calling the "v2.public.get_access_token" API can be used for SIP Parent Shop and all Affiliated Shops that are currently authorized. However, for the subsequent refresh of the "access_token", it need to be refreshed for SIP Parent Shop and Affiliated Shops separately, which means that the "v2.public.refresh_access_token" API needs to be called with the "shop_id" of the Parent Shop and the Affiliated Shops respectively, and the "access_token" and the "refresh_token" of each shop should be saved separately.
Q7-1: How to get the "shop_id" of the Affiliated Shops?
A7-1: CNSC sellers can obtain SIP Affiliate Shops' "shop_id" by calling the "v2.merchant.get_shop_list_by_merchant" API.
Non-CNSC sellers can get SIP affiliate Shops' "shop_id" by calling the "v2.shop.get_shop_info" API.
Q8: Can "refresh_token" and "access_token" under the same Main Account be shared?
A8: If you are a CNSC seller, after shop authorization, the "v2.public.get_access_token" API will return a pair of "access_token" and "refresh_token" that can be shared by multiple merchants and shops. When one of the merchants or shops calls the "v2.public.refresh_access_token" API (with the "merchant_id" or the "shop_id"), the pair of "access_token" and "refresh_token" is no longer shared among the other merchants and shops. After the call, you can consider that the pair of "refresh_token" and "access_token" for each merchant and shop are seperate.
Q9: The expiration time of "access_token" is too short. Can it be extended? Does it mean that I need to authorize frequently?
A9: Whenever you call the "v2.public.refresh_access_token" API, a new "refresh_token" and "access_token" will be returned. This means that if the "v2.public.refresh_access_token" API is called on a frequent basis prior to the shop authorization expiration, there's no need to obtain shop authorization from the seller. You can access the data through all APIs normally. If it is more than 4 hours after obtaining the "access_token", you can still obtain a new "access_token" with the latest "refresh_token"; if the "access_token" is not refreshed for 30 days, the "refresh_token" will also expire and the seller will need to re-authorize.
Q10: What does the error, "This shop account has been banned. Permissions for shop authorization and API calls have been suspended until the shop account is restored." mean?
A10: The shop's "status" is Banned. Please check the status field through the "v2.shop.get_shop_info" API to verify, and inform the seller that the banned shop cannot be authorized.
Q11: What does the error, "Partner and shop has no linked." mean?
A11: The seller has not operated the authorization or the authorization has expired. Generally speaking, seller authorization expires in one year.
Q12: What does the error, "Permissions for App authorization and API calls have been suspended. All existing App authorizations will be frozen. You will not be able to authorize your Apps to access new shops/merchants. You'll be unable to make an API call until permissions are restored." mean?
A12: You have violated the relevant regulations of the platform, and your access to calling the API has been restricted. Please contact the OpenAPI support team for more details.
Q13: What does the error, "Permissions for App authorization and API calls have been suspended. All existing App authorizations will be deleted. You will not be able to authorize your Apps to access new shops/merchants. You'll be unable to make an API call until permissions are restored." mean?
A12: You have violated the relevant regulations of the platform, and your access to calling the API has been restricted. Please contact the OpenAPI support team for more details.
