# Authentication

Use the bearer token returned by `/auth/` for all Merchant Acquiring Partner API requests.

`Authorization: Bearer <token>`

#### /auth/ <a href="#auth" id="auth"></a>

Method: POST\
Max Expected Response Time: 60 seconds

**Request Body**

| Field    | Type   | Mandatory | Description      |
| -------- | ------ | --------- | ---------------- |
| username | string | Yes       | Partner username |
| password | string | Yes       | Partner password |

**Response Body**

| Field   | Type   | Description                                                                                                               |
| ------- | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| token   | string | Bearer token used in the `Authorization` header for each API request. Expires in 24 hours.                                |
| rc      | string | [Response code](/api-reference/mitra-finpay/merchant-acquiring-partner-api/reference/response-code.md) (`00`, `10`, `11`) |
| message | string | Response message.                                                                                                         |

Request:

```json
{
  "username": "username",
  "password": "password"
}
```

Response:

```json
{
  "token": "bWl0cmFmaW5wYXltaXRyYWZpbnBheTIwMjYwNTA4MTc0MTAw",
  "rc": "00",
  "message": "Success"
}
```

## POST /auth/

> Auth

```json
{"openapi":"3.0.1","info":{"title":"MF - H2H Prod v1 sama mitra","version":"1.0.0"},"security":[],"paths":{"/auth/":{"post":{"summary":"Auth","deprecated":false,"description":"","tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"}},"required":["username","password"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"expired":{"type":"string"},"rc":{"type":"string"},"message":{"type":"string"}},"required":["token","expired","rc","message"]}}}}}}}}}
```


---

# 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://docs.finpay.id/api-reference/mitra-finpay/merchant-acquiring-partner-api/authentication.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.
