> For the complete documentation index, see [llms.txt](https://docs.latam-payments.depay.us/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.latam-payments.depay.us/reference/api-reference/authentication.md).

# Authentication

To initiate use of the API, the first step is to acquire an API Key from Depay. This key uniquely identifies and grants you access to our services. After receiving your API Key, you must then obtain a JWT (JSON Web Token), which is essential for authenticating and authorizing your subsequent interactions with the API. This process ensures that access is both secure and tailored to your specific needs.

## Get access token

<mark style="color:blue;">`GET`</mark> `https://stage.api.payments.depay.us/auth/token`

> Retrieves Bearer Token needed to authenticate throughout the API Endpoints.

#### Headers

| Name                                        | Type   | Description       |
| ------------------------------------------- | ------ | ----------------- |
| x-api-key<mark style="color:red;">\*</mark> | String | \<YOUR\_API\_KEY> |

{% tabs %}
{% tab title="200: OK Successful operation" %}

```json
{
    "expiresIn": "3600",
    "accessToken": "<ACCESS_TOKEN>",
    "refreshToken": "<REFRESH_TOKEN>"
}
```

{% endtab %}

{% tab title="403: Forbidden Invalid API-Key supplied" %}

```json
{
    "statusCode": 403,
    "message": "Forbidden resource"
}
```

{% endtab %}
{% endtabs %}

Once obtained your `accessToken` you should use it to authenticate  subsequent requests across all API endpoints. In order to do so, it should be included in the Authorization header of each request.

For example:

<pre class="language-http"><code class="lang-http">GET https://stage.api.payments.depay.us/payins/orders/{uuid}
<strong>Host: https://stage.api.payments.depay.us
</strong>Authorization: Bearer &#x3C;ACCESS_TOKEN>
</code></pre>
