---
title: "Create an Access Token"
method: POST
path: "/oauth2/token"
tags: ["Authorization"]
---

# Create an Access Token

`POST /oauth2/token`

## Request

- Base URL: `https://api.easyship.com`
- URL: `https://api.easyship.com/oauth2/token`
- Auth: none declared

Retrieve an OAuth 2 Access Token.

The endpoint is part of [OAuth 2.0 Authorization Code](https://developers.easyship.com/docs/how-to-authorize-easyship-user) flow.

Refresh tokens are for one-time use only. A new refresh token is always issued with a new access token.

## Request body

- union
  - OAuth2ClientCredentialsRequest: OAuth 2 Client Credentials Request
    - `grant_type` 'client_credentials', required: OAuth 2 Grant Type
    - `client_id` string, required: OAuth 2 Client ID
    - `client_secret` string, required: OAuth 2 Client Secret
    - `scope` string, required: OAuth 2 Scopes separated by space. All Public API scopes are supported, but they must be allowed on the Partner Application on the Dashboard. > 🚧 Warning > > With the release of Public API 2024-09, we introduced new [enhanced scopes](https://developers.easyship.com/reference/scopes). > We support only 1 type of API scopes per OAuth 2 application. It is impossible to mix old and new scopes on a single application. |Scope|Description| |---|---| |address|Addresses API (2023-01 and older)| |address_validation|Address Validations API (2023-01 and older)| |analytics|Analytics API (2023-01 and older)| |asset|Assets API (2023-01 and older)| |batch|Batches API (2023-01 and older)| |billing_document|Billing Documents API (2023-01 and older)| |box|Boxes API (2023-01 and older)| |courier|Couriers API (2023-01 and older)| |courier_account|Courier Accounts API (2023-01 and older)| |credit|Credits API (2023-01 and older)| |custom_markup_rate|Custom Markup Rates API (2023-01 and older)| |efulfillment|E-Fulfillment API (2023-01 and older)| |hs_code|Hs Codes API (2023-01 and older)| |label|Labels API (2023-01 and older)| |location|Locations API (2023-01 and older)| |manifest|Manifests API (2023-01 and older)| |payment|Payments API (2023-01 and older)| |payment_source|Payment Sources API (2023-01 and older)| |pickup|Pickups API (2023-01 and older)| |product|Products API (2023-01 and older)| |rate|Rates API (2023-01 and older)| |reference|References API (2023-01 and older)| |settings|Settings API (2023-01 and older)| |shipment|Shipments API (2023-01 and older)| |shipment_document|Shipment Documents API (2023-01 and older)| |shipping_rule|Shipping Rules API (2023-01 and older)| |store|Stores API (2023-01 and older)| |tag|Tags API (2023-01 and older)| |tax_and_duty|Tax And Duties API (2023-01 and older)| |track|Tracks API (2023-01 and older)| |track_3p|Track 3ps API (2023-01 and older)| |transaction_record|Transaction Records API (2023-01 and older)| |webhook|Webhooks API (2023-01 and older)| |public.address:read|Addresses (read only) Public API (2024-09 and newer)| |public.address:write|Addresses (write only) Public API (2024-09 and newer)| |public.address_validation:write|Address Validations (write only) Public API (2024-09 and newer)| |public.analytics:read|Analytics (read only) Public API (2024-09 and newer)| |public.app_access:write|App Accesses (write only) Public API (2024-09 and newer)| |public.asset:read|Assets (read only) Public API (2024-09 and newer)| |public.asset:write|Assets (write only) Public API (2024-09 and newer)| |public.batch:read|Batches (read only) Public API (2024-09 and newer)| |public.batch:write|Batches (write only) Public API (2024-09 and newer)| |public.billing_document:read|Billing Documents (read only) Public API (2024-09 and newer)| |public.billing_document:write|Billing Documents (write only) Public API (2024-09 and newer)| |public.box:read|Boxes (read only) Public API (2024-09 and newer)| |public.box:write|Boxes (write only) Public API (2024-09 and newer)| |public.courier:read|Couriers (read only) Public API (2024-09 and newer)| |public.courier:write|Couriers (write only) Public API (2024-09 and newer)| |public.courier_service:read|Courier Services (read only) Public API (2024-09 and newer)| |public.credit:read|Credits (read only) Public API (2024-09 and newer)| |public.efulfillment:write|E-Fulfillment (write only) Public API (2024-09 and newer)| |public.hs_code:read|Hs Codes (read only) Public API (2024-09 and newer)| |public.label:write|Labels (write only) Public API (2024-09 and newer)| |public.location:read|Locations (read only) Public API (2024-09 and newer)| |public.manifest:read|Manifests (read only) Public API (2024-09 and newer)| |public.manifest:write|Manifests (write only) Public API (2024-09 and newer)| |public.payment:write|Payments (write only) Public API (2024-09 and newer)| |public.payment_source:read|Payment Sources (read only) Public API (2024-09 and newer)| |public.payment_source:write|Payment Sources (write only) Public API (2024-09 and newer)| |public.pickup:read|Pickups (read only) Public API (2024-09 and newer)| |public.pickup:write|Pickups (write only) Public API (2024-09 and newer)| |public.product:read|Products (read only) Public API (2024-09 and newer)| |public.product:write|Products (write only) Public API (2024-09 and newer)| |public.rate:read|Rates (read only) Public API (2024-09 and newer)| |public.redirect:write|Redirects (write only) Public API (2024-09 and newer)| |public.reference:read|References (read only) Public API (2024-09 and newer)| |public.setting:read|Settings (read only) Public API (2024-09 and newer)| |public.setting:write|Settings (write only) Public API (2024-09 and newer)| |public.shipment:read|Shipments (read only) Public API (2024-09 and newer)| |public.shipment:write|Shipments (write only) Public API (2024-09 and newer)| |public.shipment_document:read|Shipment Documents (read only) Public API (2024-09 and newer)| |public.shipping_rule:read|Shipping Rules (read only) Public API (2024-09 and newer)| |public.shipping_rule:write|Shipping Rules (write only) Public API (2024-09 and newer)| |public.store:read|Stores (read only) Public API (2024-09 and newer)| |public.tag:read|Tags (read only) Public API (2024-09 and newer)| |public.tag:write|Tags (write only) Public API (2024-09 and newer)| |public.tax_and_duty:read|Tax And Duties (read only) Public API (2024-09 and newer)| |public.track:read|Tracks (read only) Public API (2024-09 and newer)| |public.track_3p:read|Track 3ps (read only) Public API (2024-09 and newer)| |public.track_3p:write|Track 3ps (write only) Public API (2024-09 and newer)| |public.transaction_record:read|Transaction Records (read only) Public API (2024-09 and newer)| |public.webhook:read|Webhooks (read only) Public API (2024-09 and newer)| |public.webhook:write|Webhooks (write only) Public API (2024-09 and newer)|
  - OAuth2AuthorizationCodeRequest: OAuth 2 Authorization Code Request
    - `grant_type` 'authorization_code', required: OAuth 2 Grant Type
    - `client_id` string, required: OAuth 2 Client ID
    - `client_secret` string, required: OAuth 2 Client Secret
    - `redirect_uri` string, uri, required: OAuth 2 Redirect URI
    - `code` string, required: OAuth 2 Authorization Code provided by authenticated user in the callback to `redirect_uri`.
  - OAuth2RefreshTokenRequest: OAuth 2 Refresh Token Request
    - `grant_type` 'refresh_token', required: OAuth 2 Grant Type
    - `client_id` string, required: OAuth 2 Client ID
    - `client_secret` string, required: OAuth 2 Client Secret
    - `scope` Scope (unresolved $ref)
    - `refresh_token` string, required: OAuth 2 Refresh Token

## Response `200`

Access Token (Refresh Token)

- OAuth2TokenResponse: OAuth 2 Token Response
  - `access_token` string: OAuth 2 Access Token
  - `token_type` 'Bearer': OAuth 2 Token Type
  - `expires_in` integer: OAuth 2 Access Token Expiration Time in Seconds
  - `scope` Scope (unresolved $ref)
  - `created_at` integer: OAuth 2 Access Token Creation Time
  - `refresh_token` string, nullable: OAuth 2 Refresh Token. Available only for Authorization Code Grant Type.

## Other responses

- `401`: Unsupported Client Credentials grant type

---

[API](https://skmtc.dev/easyship/apis/easyship-partner-app-authentication.md) - [All operations](https://skmtc.dev/easyship/apis/easyship-partner-app-authentication/llms.txt) - [OpenAPI document](https://skmtc.dev/easyship/apis/easyship-partner-app-authentication/revisions/bc3239c2acb7?raw)
