Skip to main content

v2.public.get_access_token

POST /api/v2/auth/token/get

Use the code from the authorization step to call this API to obtain the authorized shop_id, merchant_id, supplier_id, or user_id, and its corresponding access_token and refresh_token.

Endpoint URL

URL: https://partner.shopeemobile.com/api/v2/auth/token/get

Common Request Parameters

NameTypeSampleDescription
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.
signstringe318d3e932719916a9f9ebb57e2011961bd47abfa54a36e040d050d8931596e2Signature generated by partner_id, api path, timestamp and partner_key via HMAC-SHA256 hashing algorithm. More details: https://open.shopee.com/documents?module=87&type=2&id=58&version=2

Request Parameters

NameTypeRequiredSampleDescription
codestringTrue5a5477794a55537954697169514f4653The code in redirect url after the authorization. Valid for one-time use, expires in 10 minutes
partner_idint64True1001141Partner ID is assigned upon registration is successful. Required for all requests.
shop_idint64FalseShopee's unique identifier for a shop.
main_account_idint64FalseThe main_account_id of the seller that authorized the developer.

Response Parameters

NameTypeSampleDescription
errorstringError codes for API requests; always returned.When the API call is successful, the error code returned is empty.
messagestringAlways returned. Provides detailed error information.
request_idstringID of API requests; always returned. Used to diagnose problems.
shop_id_listint64[]Returned all shop_ids authorized this time.
merchant_id_listint64[]Returned all merchant_ids authorized this time.
supplier_id_listint64[]Returned all supplier_ids authorized this time.
user_id_listint64[]Returned all user_ids authorized this time.
access_tokenstringReturned when the API call is successful. A dynamic token that can be used multiple times and expires after 4 hours.
refresh_tokenstringReturned when the API call is successful. Use refresh_token to get a new access_token. Valid for each shop_id, merchant_id, supplier_id, or user_id respectively, for 30 days.
expire_intimestampReturned when the API call is successful. The validity period of the access_token, in seconds.