Chuyển tới nội dung chính

v2.public.refresh_access_token

POST /api/v2/auth/access_token/get

Dùng API này để làm mới access_token sau khi hết hạn. Refresh_token chỉ có thể dùng một lần, API này cũng sẽ trả về refresh_token mới. Hãy dùng refresh_token mới cho lần gọi RefreshAccessToken tiếp theo.

Đường dẫn Endpoint

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

Tham số chung

TênKiểuMẫuMô tả
partner_idint1ID đối tác được cấp sau khi đăng ký thành công. Bắt buộc cho tất cả các yêu cầu.
timestamptimestamp1610000000Dùng để xác định thời điểm của yêu cầu. Bắt buộc cho tất cả các yêu cầu. Hết hạn sau 5 phút.
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

Tham số Request

TênKiểuBắt buộcMẫuMô tả
refresh_tokenstringTrue4c7259534969484e71734d695a6e6d55Use 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_idint64True2001887The partner_id obtained from the App. This partner_id is inserted into the body.
shop_idint64False322300222The 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_idint64FalseThe 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_idint64FalseThe 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_idint64FalseThe 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.

Tham số Response

TênKiểuMẫuMô tả
errorstringCho biết loại lỗi nếu xảy ra lỗi. Rỗng nếu không có lỗi.
messagestringCho biết chi tiết lỗi nếu xảy ra lỗi. Rỗng nếu không có lỗi.
request_idstringMã định danh cho yêu cầu API, dùng để theo dõi lỗi.
partner_idint64Returned when the API call is successful. The partner_id you used for this refresh.
shop_idint64Returned when the API call is successful. The shop_id for this refresh.
merchant_idint64Returned when the API call is successful. The merchant_id for this refresh.
supplier_idint64Returned when the API call is successful. The supplier_id for this refresh.
user_idint64Returned when the API call is successful. The user_id for this refresh.
access_tokenstringReturned 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_tokenstringNew 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_intimestampReturned when the API call is successful. The validity period of the access_token, in seconds.