# GetBalance API

#### **Base URL :**

{% hint style="info" %}

> **`Staging :`** [**https://stagingaccount.xoxoday.com/chef**](https://stagingaccount.xoxoday.com/chef)
>
> **`Production :`** [**https://accounts.xoxoday.com/chef**](https://accounts.xoxoday.com/chef)
> {% endhint %}

{% tabs %}
{% tab title="Request" %}

```bash

curl -X POST {OAUTH_URL}/v1/oauth/api 
--header 'Authorization: Bearer eyJ0b2tlbkNvbnRlbnQiOnsiaXNzdWVkRm9yIjoiRnJlc2h3b3JrcyIsInNjb3BlIjoiIiwiaXNzdWVkQXQiOjE1NTk4MDQ1Nzg1ODIsImV4cGlyZXNBdCI6IjIwMTktMDYtMjFUMDc6MDI6NTguNTgyWiIsInRva2VuX3R5cGUiOiJVU0VSIn0sImFfdCI6ImV5SmxibU1pT2lKQk1USTRRMEpETFVoVE1qVTJJaXdpWVd4bklqb2lSVU5FU0MxRlV5SXNJbXRwWkNJNkltVnVZeUlzSW1Wd2F5STZleUpyZEhraU9pSkZReUlzSW1OeWRpSTZJbEF0TWpVMklpd2llQ0k2SWpoMmJVTkVRMUZQZW1wQlNHWndabXQ0TVhjNVluZHphM1JhZWtRek0ySXRZamx0VVhSclEyRnhNV3NpTENKNUlqb2lZMGR0V2kxdWIySjBWbUptTVdGdVNraDBUMmxoWW5VMFZHUlVhRzVVYmpCYWRuWnJabGMwYzBWb2N5SjlmUS4uU1h3TlNUSWhFUXNlN0htaXpPUmFIQS5NRzBVUy1lek1IOEFsbWFLc2ZTY3Nwa2FlYzBIcW9FcUV1YXRoNHRSTTRpeVg2dFByX1ZjTnlsdnk5YjlGLTZHR01DbjY1TjYwYnpIUUJtRVZvZGRYVWlvQS1kTkpuaE9KdThHczRfeW9pM042VGFOdWhjRENCUGtwWk1CeTlDRjJBaEh4UGotQkd0SzdEamhNbjBBQXpTM1VhTE11eUdrTmNwSGxQSUxNcFlVM' 
--header 'Content-Type: application/json'
  -d '{
	"query": "plumProAPI.query.getBalance",
	"tag": "plumProAPI",
	"variables": {
		"data":{
			
		}
	}
}

```

{% endtab %}

{% tab title="Response" %}

#### `200 : Success`

`returns list of vouchers filtered by the applicable filters`

```bash
{
    "data": {
        "getBalance": {
            "status": 1,
            "data": {
                "points": 109970,
                "value": 109970,
                "currency": "INR"
            }
        }
    }
}
```

#### `502 : Failure`&#x20;

`Failed to fetch client's balance.`

```
{
	   code: 502,
	   errorId: "PLE10023",
	   errorInfo: "Failed to get client's balance",
   error: "Eg: Bad Gateway"
}
```

#### `500: Failure`

`Internal server error`

```
{ 
   code: 500, 
   error: "Eg: Internal server error"
}
```

{% endtab %}
{% endtabs %}

## Parameters

{% tabs %}
{% tab title="Request " %}

#### `Body Parameters`

| `Property`           | `Type`       | **`Description`**                                            |
| -------------------- | ------------ | ------------------------------------------------------------ |
| Authorization header | Bearer Token | This is the Bearer User access\_token obtained by the client |

{% hint style="info" %}
**"\*" means the request parameter is mandatory**
{% endhint %}
{% endtab %}

{% tab title="Response" %}

#### `Body Parameters`

| Property      | Type    | Description                                  |
| ------------- | ------- | -------------------------------------------- |
| Status        | Integer | 0 (Failure) / 1 (Successful)                 |
| Points        | Integer | Remaining points balance in Base Currency    |
| Value         | Integer | Value of the existing points in INR currency |
| Currency      | String  | Base currency                                |
| {% endtab %}  |         |                                              |
| {% endtabs %} |         |                                              |


---

# 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://xoxoday.gitbook.io/plum/developer-resources/overview-of-reward_api/api-endpoints-1/account-balance/getbalance-api.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.
