> ## Documentation Index
> Fetch the complete documentation index at: https://docs.accountingplus.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

The Accounting+ API is organized around REST principles with predictable resource-oriented URLs. All API responses return JSON and use standard HTTP response codes, authentication, and verbs.

**Base URL:** `https://staging-openapi.accountingplus.id`

## Authentication

You need these 3 variables to be able to fully integrated with Accounting+.

| Name              | Data Type | Sample                             |
| ----------------- | --------- | ---------------------------------- |
| client\_id        | string    | thepartner                         |
| client\_secret    | string    | `rrqfQPvstlTSXc9zezzCTXTt3LgEGrEa` |
| signature\_secret | string    | `yH0G6cfb0714XA6Mr36xEGxeEtbD2gph` |

<Note>
  Contact your system administrator or account manager to obtain these keys.
</Note>

Beside that, the user email and tenant\_id are required for some API.

The following parameters must be included in the request header for every API call (excluding the Get Token, Register, and Login endpoints):

| Key           | Value                |
| ------------- | -------------------- |
| Authorization | Bearer *YOUR\_TOKEN* |
| A-Signature   | *YOUR\_SIGNATURE*    |
| A-Data        | *YOUR\_DATA*         |

### Token (Authorization)

Before making an API request to Accounting+ API, you must obtain a token by calling the [API Get Token](/api-reference/endpoint/get-token).

### A-Signature

As additional security guard in every API request, Accounting+ API uses a signature to ensure that the data in each request and response cannot be hijacked and copied by unauthorized users.
This signature is generated using the SHA256-HMAC algorithm and use `signature_secret` as key.

Example: Creating a signature containing path, token, and email

```json theme={null}
path=/v1/sample&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRfaWQiOiJ0ZXN0In0.6c_QFWhU8Yvb_4kZ1kTiovsSfNKAC0oQ4tQs45rjy9U&email=john@gmail.com
```

Sample encrypted with SHA256-HMAC using `yH0G6cfb0714XA6Mr36xEGxeEtbD2gph` as the key:

```json theme={null}
e2d3a074b3478eb658cf2d0b4eae8d2db7e75fca0caabb83d80aa0df01617fae
```

Base64 encoded format:

```json theme={null}
eUgwRzZjZmIwNzE0WEE2TXIzNnhFR3hlRXRiRDJncGg=
```

In this documentation, the encrypted result will be referred to as *YOUR\_SIGNATURE*.

### A-Data

A-Data contains email and tenant\_id variables to identify the user calling the endpoint. Here's an example of how to form it:

```json theme={null}
email=john@gmail.com&tenant_id=055
```

Base64 encoded format:

```json theme={null}
ZW1haWw9am9obkBnbWFpbC5jb20mdGVuYW50X2lkPTA5OQ==
```

In this documentation, the encoded result will be referred to as *YOUR\_DATA*.

## Example

Here's a simple example to retrieve your monthly cashflow:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET \
    "https://staging-openapi.accountingplus.id/v1/dashboard/monthly-cashflow?month=1&year=2025" \
    -H "Content-Type: application/json" \
    -H "Authorization: YOUR_TOKEN" \
    -H "A-Signature: YOUR_SIGNATURE" \
    -H "A-Data": YOUR_DATA"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://staging-openapi.accountingplus.id/v1/dashboard/monthly-cashflow?month=1&year=2025', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json'
      'Authorization: YOUR_TOKEN'
      'A-Signature': YOUR_SIGNATURE'
      'A-Data: YOUR_DATA'
    }
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  headers = {
      'Authorization': 'YOUR_TOKEN'
      'A-Signature': 'YOUR_SIGNATURE'
      'A-Data': 'YOUR_DATA'
      'Content-Type': 'application/json'
  }

  response = requests.get(
      'https://staging-openapi.accountingplus.id/v1/dashboard/monthly-cashflow',
      headers=headers,
      params={'month': 1, 'year': 2025}
  )

  data = response.json()
  print(data)
  ```
</CodeGroup>

### Response Format

All API responses follow a consistent format:

```json theme={null}
{
  "status": "00",
  "message": "success",
  "data": {
    "total_income": 112600,
    "income_growth": 11160,
    "total_expense": 2000,
    "expense_growth": -66.67,
    "total_balance": 15110600,
    "balance_growth": 5004.93
  }
}
```
