---
title: "POST /oauth/token"
method: POST
path: "/oauth/token"
tags: ["Oauth"]
---

# POST /oauth/token

`POST /oauth/token`

Change grant token into access token or refresh access token

## Request body

- object
  - `grant_type` string — OAuth token grant type. Use `refresh_token` to refresh access token. Use `authorization_code` to exchange grant into access token
  - `client_id` string — Application client ID in Moka app dashboard
  - `client_secret` string — Application client secret in Moka app dashboard
  - `code` string — Moka merchant's authorization code
  - `redirect_uri` string — Redirect URL of your application in Moka app dashboard
  - `refresh_token` string — Refresh token that can be used to obtain a new access token when access token is expired. Note: To obtain a new access token with refresh token, make sure the `grant_type` is set to `refresh_token`

## Response `200`

Exchange token response

- object
  - `access_token` string — Access token that can be used to access Moka's APIs
  - `token_type` string — Token type used by Moka's APIs (always returns `bearer`)
  - `expires_in` integer — Time of token expiration in Epoch format
  - `refresh_token` string — Refresh token that can be used to obtain a new access token when access token is expired. Note: To obtain a new access token with refresh token, make sure the `grant_type` is set to `refresh_token`
  - `scope` string — Scopes provided to the access token. This is configured when creating the application in the Moka developer platform
  - `created_at` string — Time of token creation or token refresh in Epoch format

## Other responses

- `401` — Exchange token failed

---

[API](https://skmtc.dev/mokapos/apis/moka-api.md) · [All operations](https://skmtc.dev/mokapos/apis/moka-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mokapos/moka-api/revisions/eea24d9b5965/schema)
