# Authenticate

## This will create an API AccessToken for an Application

> Return  HTTP Status Code 200 (OK) with AccessToken> \
> Returns HTTP Status Code 400 if could not authenticate

```json
{"openapi":"3.0.1","info":{"title":"The Payment API","version":"v1"},"paths":{"/api/ClientSession":{"post":{"tags":["Authenticate"],"summary":"This will create an API AccessToken for an Application","description":"Return  HTTP Status Code 200 (OK) with AccessToken\r\nReturns HTTP Status Code 400 if could not authenticate","requestBody":{"description":"","content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/ClientSessionRequest"}},"application/json":{"schema":{"$ref":"#/components/schemas/ClientSessionRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/ClientSessionRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/ClientSessionRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthenticationClientSessionResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BrokenRule"}}}}}}}}},"components":{"schemas":{"ClientSessionRequest":{"required":["ClientId","ClientSecret"],"type":"object","properties":{"ClientId":{"type":"string","description":"Unique identifier for the API Partner; provided by FrontStream"},"ClientSecret":{"maxLength":500,"type":"string","description":"Key specifically paired to the clientId"}},"additionalProperties":false,"description":""},"AuthenticationClientSessionResponse":{"type":"object","properties":{"Token":{"type":"string","description":"This is the AccessToken you will use for any other API call","nullable":true},"ClientId":{"type":"string","description":"Unique identifier for the API Partner; provided by FrontStream","format":"uuid"},"ExpirationDate":{"type":"string","description":"The date and time at which the AccessToken will no longer be valid if not used first. Will always be 5 hours from when the response is sent.","format":"date-time"}},"additionalProperties":false,"description":""},"BrokenRule":{"type":"object","properties":{"ErrorCode":{"type":"integer","format":"int32"},"Message":{"type":"string","nullable":true},"LoggerMessage":{"type":"string","nullable":true}},"additionalProperties":false}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.frontstream.com/welcome-to-our-payment-api/api-references/test-payment-api-features/each-api-reference-specifics/authenticate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
