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

# Generate Token

> Generate a new authentication token to use across all API resources

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'https://auth.api.e-cross.tech/token' \
    -H 'Content-Type: application/json' \
    -d '{
      "clientId": "your-client-id",
      "clientSecret": "your-client-secret"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "tokenType": "Bearer",
    "expiresIn": 28800
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json Invalid Credentials theme={null}
  {
    "message": "Incorrect username or password."
  }
  ```
</ResponseExample>

### Request Parameters

<ParamField body="clientId" type="string" required>
  The client ID provided to identify your merchant account (username).
</ParamField>

<ParamField body="clientSecret" type="string" required>
  The client secret to authenticate your merchant account (password).
</ParamField>

### Response Fields

<ResponseField name="token" type="string" required>
  The access token required for the `Authorization` header in all subsequent requests. Use the format: `Authorization:
      Bearer {token}`
</ResponseField>

<ResponseField name="tokenType" type="string" required>
  The token schema type. Always returns `Bearer`.
</ResponseField>

<ResponseField name="expiresIn" type="integer" required>
  Time duration until token expiration in seconds. Default value is 8 hours (28,800 seconds).
</ResponseField>

## Using the Token

Include the token in the `Authorization` header of all API requests:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET 'https://product.api.e-cross.tech/ext/merchant/skus' \
    -H 'Authorization: Bearer YOUR_TOKEN_HERE'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://product.api.e-cross.tech/ext/merchant/skus', {
    headers: {
      Authorization: `Bearer ${token}`,
    },
  });
  ```

  ```python Python theme={null}
  import requests

  headers = {
      'Authorization': f'Bearer {token}'
  }

  response = requests.get(
      'https://product.api.e-cross.tech/ext/merchant/skus',
      headers=headers
  )
  ```
</CodeGroup>
