v2.public.refresh_access_token
POST /api/v2/auth/access_token/get
Use this API to refresh the access_token after it expires. Refresh_token can be used once only, this API will also return a new refresh_token. Please use the new refresh_token for the next RefreshAccessToken call
Endpoint URL
URL: https://partner.shopeemobile.com/api/v2/auth/access_token/get
Common Request Parameters
| Name | Type | Sample | Description |
|---|---|---|---|
| partner_id | int | 1 | Partner ID is assigned upon registration is successful. Required for all requests. |
| timestamp | timestamp | 1610000000 | This is to indicate the timestamp of the request. Required for all requests. Expires in 5 minutes. |
| sign | string | e318d3e932719916a9f9ebb57e2011961bd47abfa54a36e040d050d8931596e2 | Signature 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
| Name | Type | Required | Sample | Description |
|---|---|---|---|---|
| refresh_token | string | True | 4c7259534969484e71734d695a6e6d55 | Use refresh_token to get a new access_token. Each refresh_token is valid for 30 days, and can only be used once by either a shop_id or merchant_id or supplier_id or user_id. |
| partner_id | int64 | True | 2001887 | The partner_id obtained from the App. This partner_id is inserted into the body. |
| shop_id | int64 | False | 322300222 | The shop_id that granted authorization to your App. Only the shop_id or merchant_id or supplier_id or user_id can be selected as the input parameter, and they must be refreshed separately. |
| merchant_id | int64 | False | The merchant_id that granted authorization to your App. Only the shop_id or merchant_id or supplier_id or user_id can be selected as the input parameter, and they must be refreshed separately. | |
| supplier_id | int64 | False | The supplier_id that granted authorization to your App. Only the shop_id or merchant_id or supplier_id or user_id can be selected as the input parameter, and they must be refreshed separately. | |
| user_id | int64 | False | The user_id that granted authorization to your App. Only the shop_id or merchant_id or supplier_id or user_id can be selected as the input parameter, and they must be refreshed separately. |
Response Parameters
| Name | Type | Sample | Description |
|---|---|---|---|
| error | string | Indicate error type if hit error. Empty if no error happened. | |
| message | string | Indicate error details if hit error. Empty if no error happened. | |
| request_id | string | The identifier for an API request for error tracking. | |
| partner_id | int64 | Returned when the API call is successful. The partner_id you used for this refresh. | |
| shop_id | int64 | Returned when the API call is successful. The shop_id for this refresh. | |
| merchant_id | int64 | Returned when the API call is successful. The merchant_id for this refresh. | |
| supplier_id | int64 | Returned when the API call is successful. The supplier_id for this refresh. | |
| user_id | int64 | Returned when the API call is successful. The user_id for this refresh. | |
| access_token | string | Returned when the API call is successful. Each new access_token is a dynamic token that can be used multiple times. It expires after 4 hours. | |
| refresh_token | string | New refresh_tokenReturned when the API call is successful. Use a refresh_token to get a new access_token. Each refresh_token is valid for 30 days, and can only be used once by either a shop_id or merchant_id or supplier_id or user_id. | |
| expire_in | timestamp | Returned when the API call is successful. The validity period of the access_token, in seconds. |