> For the complete documentation index, see [llms.txt](https://docs.finpay.id/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.finpay.id/api-reference/finpay-disbursement/authorization-and-headers.md).

# Authorization & Headers

For backend based API request/call, Finpay API requires HTTP(s) headers that will be explained below.

### Content-Type and Accept Header <a href="#content-type-and-accept-header" id="content-type-and-accept-header"></a>

Finpay API uses JSON format for input and output, hence it is required to specify JSON as content-type & accept JSON as response. The header specification is as shown below.

* Content-Type: application/json
* Accept: application/json

### Authorization Header <a href="#authorization-header" id="authorization-header"></a>

The Finpay API utilizes the merchant ID and basic authorization header for processing requests. The Merchant ID and Merchant Key are used in conjunction to create the Authorization Header, which is a security measure to prevent unauthorized access to the API.

* For **Development** environment, obtain Merchant Id & Merchant Key in [Sandbox Dashboard](https://dashboard.finpay.id/pages/access-keys)
* For **Production** environment, obtain Merchant Id & Merchant Key in [Dashboard](https://dashboard.finpay.id/pages/access-keys)

To generate Authorization header value, follow the steps given below.

1. Follow the format of Basic Authentication. (example: Username:Password)
2. Username and password are separated by : character.
3. Merchant Id is used as Username and Merchant Key as Password.
   * For example, if your Merchant Id is FINPAY770 and Merchant Key is SoSecret123 then Username:Password would be `FINPAY770:SoSecret123`.
4. Encode this value into base64 format.
   * For example, base64 of FINPAY770:SoSecret123 is `RklOUEFZNzcwOlNvU2VjcmV0MTIz`.
5. Add the word Basic as prefix.
   * The above value would be `Basic RklOUEFZNzcwOlNvU2VjcmV0MTIz`.
6. Your Authorization header is ready.
   * `Authorization: Basic RklOUEFZNzcwOlNvU2VjcmV0MTIz`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.finpay.id/api-reference/finpay-disbursement/authorization-and-headers.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
