Skip to content

Get Access Token

Request

Requests new access token for accessing Keeta API resources.
If you have completed the development in full compliance with the Open Delivery native protocol's grant_type=client_credentials, please contact Keeta.
If you have already completed development using grant_type=client_credentials and have passed SIT certification or are already in production, you can continue to use grant_type=client_credentials without any impact.

IMPORTANT: The Software Service must obtain the merchant’s authorization before accessing their data.

APP Level Token mode
  1. Application-level access_token: The access_token can be used to access all stores authorized
  2. grant_type = app_level_token: Generate and refresh access_token
Shop Level Authorization Code mode
  1. Store-level access_token: The access_token can be used to access one store authorized
  2. grant_type = shop_level_authorization_code: Use authorization_code to generate access_token, and return refresh_token for subsequent refresh
  3. grant_type = refresh_token: Use this parameter to refresh a new access_token and refresh_token, before the old access_token expires.

HOST: Keeta

DIRECTION:

Bodyapplication/jsonrequired
client_idstringrequired

Client identifier provided by Keeta.

grant_typestringrequired

The OAuth grant type.

Value:"app_level_token"
Discriminator
client_secretstringrequired

Client Secret provided by Keeta.(When grant_type = app_level_token, this field needs to be filled in)

curl -i -X POST \
  https://open.mykeeta.com/api/open/opendelivery/oauth/token \
  -H 'Content-Type: application/json' \
  -d '{
    "client_id": "string",
    "grant_type": "app_level_token",
    "client_secret": "string"
  }'

Responses

Successful returns token request.

Bodyapplication/json
grant_typestring
Discriminator
access_tokenstringrequired

A code representing the access token.

token_typestringrequired

The token type. Currently, the only supported type is bearer.

Example:"bearer"
expires_ininteger

The token expiration time in seconds

refresh_tokenstringrequired

A code representing the refresh token.
Condition: This field will be returned when the grant_type is shop_level_authorization_code or refresh_token. When the grant_type is set to app_level_token, the response does not contain this field.

Response
{ "access_token": "string", "token_type": "bearer", "expires_in": 0, "refresh_token": "string", "grant_type": "refresh_token" }