# Exchange credentials for an API key

Exchanges a store's `client_id` and `client_secret` for its API key, which can then be used as the `Bearer` token for authenticated requests.

Endpoint: POST /stores/session
Version: 1.1.0
Security: ApiKey

## Security:

  - `ApiKey` (unknown)
    apiKey in header Authorization

## Request body:

  - `application/vnd.api+json` (unknown)
    The store credentials to exchange.

## Request fields (application/vnd.api+json):

  - `data` (object)

  - `data.type` (string)
    Enum: "session"

  - `data.attributes` (object)

  - `data.attributes.client_id` (string, required)
    The store access key.

  - `data.attributes.client_secret` (string, required)
    The store secret key.

## Response 200:

  - `200` (unknown)
    The store API key.

## Response 200 fields (application/vnd.api+json):

  - `data` (object)

  - `data.type` (string)
    Enum: "session"

  - `data.id` (string)
    The store API key (same value as the `token` attribute).

  - `data.attributes` (object)

  - `data.attributes.token` (string)
    The store API key to use as the Bearer token.

## Response 401:

  - `401` (unknown)
    Authentication failed.

## Response 401 fields (application/vnd.api+json):

  - `errors` (array)
    A list of errors.

  - `errors.detail` (string)
    A human-readable explanation of the error.
    Example: Explanation of the problem.

