> ## Documentation Index
> Fetch the complete documentation index at: https://developers.teleship.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get access token

> Obtain an OAuth2 access token for API authentication.

**How it works:**
- Provide your client credentials (client_id and client_secret)
- Receive a Bearer token for API access
- Token expires after 1 hour

**Security:**
- Always use HTTPS
- Store credentials securely
- Never expose client_secret in client-side code




## OpenAPI

````yaml /api-reference/openapi.json post /oauth/token
openapi: 3.0.0
info:
  title: Teleship
  description: >

    Teleship is a leading cross-border logistics provider offering seamless
    global commerce solutions through our comprehensive API.


    With Teleship's API, developers can integrate our cross-border shipping
    services, trade engine, and logistics solutions directly into their
    applications.


    **Key Features:**

    - Cross-border shipping solutions for international commerce

    - Real-time shipping rates and delivery estimates

    - End-to-end shipment tracking with detailed status updates

    - Automated customs compliance and product classification

    - Real-time event notifications through webhooks


    **Why Teleship?**

    - API-first: Developer-friendly integration with comprehensive documentation

    - Enterprise-ready: Built for businesses of all sizes

    - Secure: Enterprise-grade security and compliance

    - Integrated: Seamless connection with e-commerce, ERP, and fulfillment
    systems


    Start shipping globally with Teleship's powerful cross-border logistics API.
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.teleship.com
security: []
tags: []
paths:
  /oauth/token:
    post:
      tags:
        - Authentication
      summary: Get access token
      description: |
        Obtain an OAuth2 access token for API authentication.

        **How it works:**
        - Provide your client credentials (client_id and client_secret)
        - Receive a Bearer token for API access
        - Token expires after 1 hour

        **Security:**
        - Always use HTTPS
        - Store credentials securely
        - Never expose client_secret in client-side code
      operationId: getToken
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - clientId
                - clientSecret
              properties:
                clientId:
                  type: string
                  description: Your API client ID
                  example: your-client-id
                clientSecret:
                  type: string
                  description: Your API client secret
                  example: your-client-secret
      responses:
        '200':
          description: Access Token Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  accessToken:
                    type: string
                    description: JWT access token for API authentication
                    example: >-
                      eyJhbGciOiJSUzI1NiIsImtpZCI6IjMzMDUxMThiZTBmNTZkYzA4NGE0NmExN2RiNzU1NjVkNzY4YmE2ZmUiLCJ0eXAiOiJKV1QifQ...
                  expirationTime:
                    type: number
                    description: Token expiration timestamp
                    example: 1717702808582
                  expiresIn:
                    type: number
                    description: >-
                      Time until token expiration in milliseconds (not a
                      timestamp)
                    example: 3600000
                  tokenType:
                    type: string
                    description: Type of token (always Bearer)
                    example: Bearer
                  refreshToken:
                    type: string
                    description: Refresh token for obtaining new access tokens
                    example: AMf-vBx...
                example:
                  accessToken: >-
                    eyJhbGciOiJSUzI1NiIsImtpZCI6IjMzMDUxMThiZTBmNTZkYzA4NGE0NmExN2RiNzU1NjVkNzY4YmE2ZmUiLCJ0eXAiOiJKV1QifQ.eyJuYW1lIjoiIiwiaXNzIjoiaHR0cHM6Ly9zZWN1cmV0b2tlbi5nb29nbGUuY29tL3RlbGVzaGlwLWY5OTA4IiwiYXVkIjoidGVsZXNoaXAtZjk5MDgiLCJhdXRoX3RpbWUiOjE3MTc2OTkyMDgsInVzZXJfaWQiOiJjZDg2ZjUzMS02MjNhLTQ4Y2MtYTdlZS0yNDhiODA2ZWM2ZTYiLCJzdWIiOiJjZDg2ZjUzMS02MjNhLTQ4Y2MtYTdlZS0yNDhiODA2ZWM2ZTYiLCJpYXQiOjE3MTc2OTkyMDgsImV4cCI6MTcxNzcwMjgwOCwiZW1haWwiOiJjZDg2ZjUzMS02MjNhLTQ4Y2MtYTdlZS0yNDhiODA2ZWM2ZTZAYXV0aC50ZWxlc2hpcC50ZWxlc2hpcC5jb20iLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnsiZW1haWwiOlsiY2Q4NmY1MzEtNjIzYS00OGNjLWE3ZWUtMjQ4YjgwNmVjNmU2QGF1dGgudGVsZXNoaXAudGVsZXNoaXAuY29tIl19LCJzaWduX2luX3Byb3ZpZGVyIjoicGFzc3dvcmQifX0.H2VPnCqHyfYNeiQzPDgnrRnaDv_SLhK7OKquWoxFql5szjn5uMeYQzxCDj9iCxFMYaPN5JnCqNonOH6Feat3HML79oEi58WE43jpxoygqDlS2r1dzGCiuywaHgXKcVnVrL5cDhcWquMz1mtrY0iwqH8N8pUleIOBE1n5NGWFDedXX0JI3taaX9eGW2AHq_vIx-69WchA75_tZV0_vSDRo8vWddSfvwqVqEo3fooQS6mfMwW2jsaaBj3N-BffyXlaI2FasiO6yN9ofLZ4kbuoRxn1BZE8ER6POn60DX2WlWYg0OV8dCbKLHSGSp_xQuyLYwiroW3lB5y1SKjoKAT2YA
                  expirationTime: 1717702808582
                  expiresIn: 3600000
                  tokenType: Bearer
        '400':
          description: Missing or invalid client credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseMessagesDto'
        '401':
          description: Unauthorized, invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseMessagesDto'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseMessagesDto'
components:
  schemas:
    ResponseMessagesDto:
      type: object
      properties:
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ErrorResponseDto'
      required:
        - messages
    ErrorResponseDto:
      type: object
      properties:
        code:
          type: number
        level:
          type: string
          enum:
            - error
            - warning
            - info
          example: error
          description: Error level
          default: error
        timestamp:
          format: date-time
          type: string
          example: '2024-01-01T00:00:00.00Z'
        message:
          type: string
          example: An error occurred
        details:
          example:
            - Missing required field
          type: array
          items:
            type: string
      required:
        - code
        - level
        - timestamp
        - message
        - details

````