# Quick Start

## Let's get you set up and ready to start using the Payment API

### Use your Client credentials

Let's make sure you can gain access to our **FrontStream** **Payment API**.  As a **FrontStream API Partner** you will be set up with secure credentials to gain access and authenticate your requests. Use your FrontStream assigned ClientId and ClientSecret to retrieve a one time use AccessToken for gaining access to our different API endpoints.

Missing your credentials? Please contact us at:

{% embed url="<https://www.frontstream.com/payments>" %}

To try a test and directly interact with the API endpoint click "Test It" and use an embedded API client to send requests with custom headers and variables, then see the live response; essentially letting you test this API directly within this page. When testing please use our Demo URL: `https://demo-payments.frontstream.com/api/ClientSession`

## 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}}}}
```

### Client Session Example

Take a look at how you might call this method:

{% tabs %}
{% tab title="C#" %}

```csharp
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

public class Program
{
    public static async Task Main(string[] args)
    {
        using (var client = new HttpClient())
        {
            var url = "/api/ClientSession";
            var requestBody = new
            {
                ClientId = "text",
                ClientSecret = "text"
            };

            var content = new StringContent(
                Newtonsoft.Json.JsonConvert.SerializeObject(requestBody),
                Encoding.UTF8,
                "application/json-patch+json"
            );

            var response = await client.PostAsync(url, content);
            var responseData = await response.Content.ReadAsStringAsync();

            Console.WriteLine(responseData);
        }
    }
}

```

{% endtab %}

{% tab title="Postman" %}
To make the API request in Postman, follow these steps:

1. **Method**: Set to `POST`.
2. **URL**: Enter the API endpoint URL (e.g., `https://demo-payments.frontstream.com/api/ClientSession`).
3. **Headers**:
   * Key: `Content-Type`
   * Value: `application/json-patch+json`
4. **Body**: Select `raw`, then choose `JSON` format. Paste the following JSON:

   ```json
   {
     "ClientId": "text",
     "ClientSecret": "text"
   }
   ```
5. **Send**: Click the `Send` button and view the response in the output section.
   {% endtab %}
   {% endtabs %}

### For more information please **contact us** at:

{% embed url="<https://www.frontstream.com/payments>" %}

### Ready to make your first Payment request?

Dive into the API reference specifics next:&#x20;

{% content-ref url="/pages/0fJ5kq2BRgIYSe3scZiO" %}
[API references](/welcome-to-our-payment-api/api-references.md)
{% endcontent-ref %}


---

# 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/quick-start.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.
