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

# Start a Temporary Session

> Start a new session for capturing a customer's payment card.

<Card title="Authentication Guide" icon="book" href="/getting-started/authentication#session-token">
  Learn about session token authentication
</Card>

Creates a short-lived session token from your API key credentials. Use this when you need to authenticate client-side operations (such as card capture forms) without exposing your API key to the browser. The returned token is valid for a single session and expires automatically.

## Error Responses

| Code | HTTP Status | Condition                  |
| ---- | ----------- | -------------------------- |
| -150 | 500         | Memory cache insert failed |

## Parameters

### Headers

<ParamField header="Authorization" type="string" required>
  Your API key prefixed with `APIKEY`. Example: `APIKEY your-api-key`. See the [Authentication guide](/getting-started/authentication).
</ParamField>

<RequestExample>
  ```javascript Node.js theme={null}
  const response = await fetch('https://service.pcibooking.net/api/payments/paycard/tempsession', {
    method: 'POST',
    headers: {
      'Authorization': 'APIKEY your-api-key'
    }
  });

  const sessionToken = await response.json();
  console.log(sessionToken);
  ```

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

  response = requests.post(
      'https://service.pcibooking.net/api/payments/paycard/tempsession',
      headers={
          'Authorization': 'APIKEY your-api-key'
      }
  )

  session_token = response.json()
  print(session_token)
  ```
</RequestExample>

## Response

<ResponseExample>
  ```json 200 theme={null}
  "1a75885fabe443588488de7d7e7f9980"
  ```

  ```json 401 theme={null}
  {
      "code": -1003,
      "message": "Not authorized to access this resource",
      "moreInfo": "Bad or missing authorization data, expected APIKEY",
      "errorList": null
  }
  ```
</ResponseExample>
