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

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.

Đường dẫn Endpoint

URL: https://partner.shopeemobile.com/api/v2/auth/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ả
codestringTrue5a5477794a55537954697169514f4653Mã trong URL chuyển hướng sau khi ủy quyền. Chỉ dùng được một lần, hết hạn sau 10 phút.
partner_idint64True1001141ID đố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.
shop_idint64FalseMã định danh duy nhất của Shopee cho một gian hàng.
main_account_idint64FalseThe main_account_id of the seller that authorized the developer.

Tham số Response

TênKiểuMẫuMô tả
errorstringMã lỗi cho yêu cầu API; luôn được trả về. Khi gọi API thành công, mã lỗi trả về là rỗng.
messagestringLuôn được trả về. Cung cấp thông tin lỗi chi tiết.
request_idstringID của yêu cầu API; luôn được trả về. Dùng để chẩn đoán vấn đề.
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_tokenstringTrả về khi gọi API thành công. Token động có thể dùng nhiều lần và hết hạn sau 4 giờ.
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.