> For a complete documentation index, fetch https://docs.voximplant.ai/llms.txt

# GetMoneyAmountToCharge

POST https://api.voximplant.com/platform_api/GetMoneyAmountToCharge

Get the recommended money amount to charge.

Allowed roles: `Owner`, `Admin`, `Accountant`, `Payer`.

**Example request:** Get the recommended money amount to charge in USD.

Reference: https://docs.voximplant.ai/api-reference/management-api/reference/accounts/get-money-amount-to-charge

## Authentication

- `Authorization` header (bearer token, required) — Voximplant Management API uses signed JWT tokens generated from your service-account private key. Pass the token in the `Authorization` header as a Bearer value: ``` Authorization: Bearer $VOXIMPLANT_TOKEN ``` See [Authorization](/api-reference/management-api/authorization) for ready-to-copy snippets in bash, Python, Node.js and Go that turn your `credentials.json` into a token.

## Request

### Query parameters

- `currency` (string, optional, default: The account currency) — The currency name. Examples: USD, RUR, EUR
- `charge_date` (string, optional, default: The current date) — The next charge date, format: YYYY-MM-DD

## Response

### 200

Successful response

- `result` (GetMoneyAmountToChargeResult, optional) — Result

## Types

### GetMoneyAmountToChargeResult

The [GetMoneyAmountToCharge] function result.

- `amount` (double, optional) — The money amount of the subscriptions + plan + negative_balance in the specified currency
- `min_amount` (double, optional) — The 'amount' value minus the positive account balance in the specified currency
- `bank_card_amount_usd` (double, optional) — Exists if bank card payments are allowed. It is the maximum of the 'amount' in USD and the min_card_payment (10$)
- `min_bank_card_amount_usd` (double, optional) — Exists if bank card payments are allowed. It is the maximum of the 'min_amount' in USD and the min_card_payment (10$)
- `robokassa_amount_rub` (double, optional) — Exists if robokassa payments are allowed. It is the maximum of the 'min_amount' in RUR and the min_robokassa_payment (500 RUR)
- `min_robokassa_amount_rub` (double, optional) — Exists if robokassa payments are allowed. It is the maximum of the 'min_amount' in RUR and the min_robokassa_payment (500 RUR)
- `subscriptions` (list of SubscriptionsToChargeType, optional) — The subscriptions to charge

### SubscriptionsToChargeType

The [GetMoneyAmountToCharge] function result field.

- `subscription_amount` (double, optional) — The money amount to charge in the specified currency
- `subscription_type` (string, optional) — The subscription type, example: PHONE_NUM, SIP_REGISTRATION
- `subscription_description` (string, optional) — The subscription description (details). Example: the subscribed phone number
- `subscription_auto_charge` (boolean, optional) — Whether the subscription charges automatically
- `subscription_next_renewal` (string, optional) — Date string as returned by the Management API. The next renewal date, format: YYYY-MM-DD. Displayed for only verified phone numbers

## Examples

**Response**

```json
{
  "result": {
    "amount": 8,
    "min_amount": 7,
    "bank_card_amount_usd": 10,
    "min_bank_card_amount_usd": 7,
    "robokassa_amount_rub": 500,
    "min_robokassa_amount_rub": 500,
    "subscriptions": [
      {
        "subscription_amount": 5,
        "subscription_type": "PHONE_NUM",
        "subscription_description": "74997004411"
      },
      {
        "subscription_amount": 3,
        "subscription_type": "PHONE_NUM",
        "subscription_description": "15002229950"
      }
    ]
  }
}
```

**SDK Code**

```python The account balance is 1$ + min_amount(7$) = amount(8$)
import requests

url = "https://api.voximplant.com/platform_api/GetMoneyAmountToCharge"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript The account balance is 1$ + min_amount(7$) = amount(8$)
const url = 'https://api.voximplant.com/platform_api/GetMoneyAmountToCharge';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go The account balance is 1$ + min_amount(7$) = amount(8$)
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.voximplant.com/platform_api/GetMoneyAmountToCharge"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby The account balance is 1$ + min_amount(7$) = amount(8$)
require 'uri'
require 'net/http'

url = URI("https://api.voximplant.com/platform_api/GetMoneyAmountToCharge")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java The account balance is 1$ + min_amount(7$) = amount(8$)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.voximplant.com/platform_api/GetMoneyAmountToCharge")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php The account balance is 1$ + min_amount(7$) = amount(8$)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.voximplant.com/platform_api/GetMoneyAmountToCharge', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp The account balance is 1$ + min_amount(7$) = amount(8$)
using RestSharp;

var client = new RestClient("https://api.voximplant.com/platform_api/GetMoneyAmountToCharge");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift The account balance is 1$ + min_amount(7$) = amount(8$)
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.voximplant.com/platform_api/GetMoneyAmountToCharge")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```