> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://bcdtravel.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://bcdtravel.ferndocs.com/_mcp/server.

# Request authentication & authorization

## OAUTH2 Authentication

The authentication flow consists of two main parts:

1. Receiving a Bearer token from the OAUTH2 endpoint.
2. Making a call to the Invoice API using this token.

## Obtaining a Bearer token

First, you will need to obtain a `ClientId` and `ClientSecret` from our account or partner manager.

Using these secrets, you will need to obtain a Bearer token:

1. Create a `POST` request to the endpoint `https://auth.travel-data-api.bcdtravel.com/oauth2/token`.

### Headers

| Header          | Value                                                                                                                                                          |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Authorization` | Basic `Base64Encode(ClientId:ClientSecret)` — Client must pass its `ClientId` and `ClientSecret` in the authorization header through Basic HTTP authorization. |
| `Content-Type`  | `application/x-www-form-urlencoded`                                                                                                                            |

### Body

| Parameter    | Value                 |
| ------------ | --------------------- |
| `grant_type` | `client_credentials`  |
| `client_id`  | Your `ClientId` value |

After that, you will be issued an Access Bearer Token with a **1-hour lifetime**.

## Calling the Invoice API

In order to call the Invoice API using the token, create an `Authorization` header in the following format:

```
Authorization: Bearer <your_access_token>
```