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

> ## Agent Instructions
> Trackstar is a unified REST API for WMS, cart, and carrier systems. Base URL: https://production.trackstarhq.com. There is no SDK; call the API with plain HTTP.
> Send x-trackstar-api-key on every request. Endpoints scoped to one connection also need x-trackstar-access-token. Read both from environment variables and never print them.
> Reads return data Trackstar has already synced from the connected system. Writes (POST, PUT, PATCH, DELETE) are forwarded to the connected system immediately.
> A new connection has no data until its initial sync finishes. Wait for the connection.historical-sync-completed webhook, or poll GET /connections/{connection_id} and check historical_sync_completed.
> List endpoints page with page_token and next_token (limit is capped at 1000). Repeat every filter on every page. Filters use field[operator]=value, for example created_date[gte]=2026-01-01T00:00:00Z.
> Write bodies must not contain null or empty strings; omit the field instead. Call GET /integrations/{integration_type}/{integration_name}/write-info first to learn the exact fields an integration accepts.
> To test without real credentials, POST /sandbox/generate-sandbox/{wms|cart|carrier} with the API key returns a sandbox access token. Start at https://docs.trackstarhq.com/how-to-guides/build-with-ai.md and install the skills with: npx skills add https://docs.trackstarhq.com

# Exchange Auth Code

> Exchanges a temporary authorization code for a permanent access token.
See the [Getting Started guide](/how-to-guides/getting-started) for more details.



## OpenAPI

````yaml post /link/exchange
openapi: 3.1.0
info:
  description: >

    Trackstar is a Unified API that provides standard endpoints for Supply Chain
    Logistics. We currently offer an API for Warehouse Management Systems (WMS).
  title: Trackstar API
  version: 0.1.0
servers:
  - description: Trackstar API
    url: https://production.trackstarhq.com
security: []
tags: []
externalDocs:
  description: Trackstar API Documentation
  url: https://docs.trackstarhq.com
paths:
  /link/exchange:
    post:
      tags:
        - Auth
      summary: Exchange Auth Code
      description: >-
        Exchanges a temporary authorization code for a permanent access token.

        See the [Getting Started guide](/how-to-guides/getting-started) for more
        details.
      operationId: post_POST__link_exchange
      parameters:
        - in: header
          name: x-trackstar-api-key
          description: Your organization-level Trackstar API key.
          schema:
            type: string
            example: <x-trackstar-api-key>
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExchangeInputSchema'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeResponseShipbob'
          description: Successful response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: Validation error
components:
  schemas:
    ExchangeInputSchema:
      type: object
      properties:
        auth_code:
          type: string
          description: >-
            The authorization code returned from the frontend after a user
            installs an integration.
          example: auth_code
        customer_id:
          type:
            - string
            - 'null'
          description: An identifier for your end customer.
          example: customer_id
      required:
        - auth_code
      additionalProperties: false
      title: ExchangeInputSchema
    ExchangeResponseShipbob:
      type: object
      properties:
        access_token:
          type: string
          description: >-
            The permanent access token for the integration used to make requests
            to the Trackstar API.
          example: your_permanent_access_token
        connection_id:
          type: string
          description: A unique connection ID for the integration.
          example: unique_connection_id
        integration_name:
          type: string
          description: The name of the integration that was installed.
          example: shipbob
        customer_id:
          type:
            - string
            - 'null'
          description: An identifier for your end customer.
          example: customer_id
        available_actions:
          type: array
          description: A list of actions that the integration supports.
          example:
            - get_inventory
            - get_products
          items:
            type: string
            description: Actions supported by the integration
            example: available_actions
        me:
          type:
            - object
            - 'null'
          description: >-
            Information that helps identify the connected account. If null, the
            integration does not provide this information.
          example:
            account_id: account_12345
            account_name: My WMS Account
          additionalProperties:
            description: Field value. Structure varies based on integration.
      required:
        - access_token
        - available_actions
        - connection_id
        - customer_id
        - integration_name
        - me
      additionalProperties: false
      title: ExchangeResponseShipbob
    ValidationError:
      properties:
        error:
          type: string
        detail:
          type: object
          properties:
            <location>:
              type: object
              properties:
                <field_name>:
                  type: array
                  items:
                    type: string
      required:
        - error
      type: object
      title: ValidationError

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.