In order to use the API, you will need Fulfillment Service ID (App ID), Client ID and Client Secret. You must request access by emailing Tokopedia using your business email. Then we will then grant you access to a
fs_id used as a unique identifier to your account, while
client_secret used to acquire an access token. An access token grants limited access to a fulfillment service's account. The
client_secret should be treated as a password and stored securely. There are two ways to generate the access token, using HTTP request or using Postman.
Using HTTP Request to Obtain Access Token
You need to encode your
client_secret to base64 and make a POST request to
https://accounts.tokopedia.com/token. Here are the complete steps:
- Visit base64encode.org
- Insert your Client ID and Client Secret with the following format:
- Encode to a base64 string. The encoded string will be like this:
- Make a POST request to
https://accounts.tokopedia.com/tokenand use the encoded string as the Basic Authorization Token. Example request:
curl -X POST \
-H 'Authorization: Basic Y2xpZW50X2lkOmNsaWVudF9zZWNyZXQK' \
-H 'Content-Length: 0' \
-H 'User-Agent: PostmanRuntime/7.17.1'
- If successful, you will receive an
access_tokenresponse. When an access token expires, you should request a new token. Example response:
- You can use the
access_tokento make HTTP request, for example:
curl -X GET \
-H 'Authorization: Bearer LSPr7x7sRGaewzwZE6IcuA'
Postman is an application that lets you send HTTP requests to Tokopedia API endpoints. You can use Postman to obtain
access_token without doing base64 encoding manually. Here are the complete steps:
- Open Postman. Visit Get Postman to download.
- Click the Authorization tab under the request URL and select OAuth 2.0 as the Type
- Click on the Get New Access Token
- Select Client Credentials as the Grant Type
https://accounts.tokopedia.com/tokento the Access Token URL field
- Enter your Client ID and Client Secret
- Finally, click on the Request Token button.