> 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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: management-api
  version: 1.0.0
paths:
  /GetMoneyAmountToCharge:
    post:
      operationId: get-money-amount-to-charge
      summary: GetMoneyAmountToCharge
      description: |-
        Get the recommended money amount to charge.

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

        **Example request:** Get the recommended money amount to charge in USD.
      tags:
        - subpackage_accounts
      parameters:
        - name: currency
          in: query
          description: 'The currency name. Examples: USD, RUR, EUR'
          required: false
          schema:
            type: string
            default: The account currency
        - name: charge_date
          in: query
          description: 'The next charge date, format: YYYY-MM-DD'
          required: false
          schema:
            type: string
            default: The current date
        - name: Authorization
          in: header
          description: >-
            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.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/accounts_GetMoneyAmountToCharge_Response_200
servers:
  - url: https://api.voximplant.com/platform_api
components:
  schemas:
    SubscriptionsToChargeType:
      type: object
      properties:
        subscription_amount:
          type: number
          format: double
          description: The money amount to charge in the specified currency
        subscription_type:
          type: string
          description: 'The subscription type, example: PHONE_NUM, SIP_REGISTRATION'
        subscription_description:
          type: string
          description: >-
            The subscription description (details). Example: the subscribed
            phone number
        subscription_auto_charge:
          type: boolean
          description: Whether the subscription charges automatically
        subscription_next_renewal:
          type: string
          description: >-
            Date string as returned by the Management API.


            The next renewal date, format: YYYY-MM-DD. Displayed for only
            verified phone numbers
      description: The [GetMoneyAmountToCharge] function result field.
      title: SubscriptionsToChargeType
    GetMoneyAmountToChargeResult:
      type: object
      properties:
        amount:
          type: number
          format: double
          description: >-
            The money amount of the subscriptions + plan + negative_balance in
            the specified currency
        min_amount:
          type: number
          format: double
          description: >-
            The 'amount' value minus the positive account balance in the
            specified currency
        bank_card_amount_usd:
          type: number
          format: double
          description: >-
            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:
          type: number
          format: double
          description: >-
            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:
          type: number
          format: double
          description: >-
            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:
          type: number
          format: double
          description: >-
            Exists if robokassa payments are allowed. It is the maximum of the
            'min_amount' in RUR and the min_robokassa_payment (500 RUR)
        subscriptions:
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionsToChargeType'
          description: The subscriptions to charge
      description: The [GetMoneyAmountToCharge] function result.
      title: GetMoneyAmountToChargeResult
    accounts_GetMoneyAmountToCharge_Response_200:
      type: object
      properties:
        result:
          $ref: '#/components/schemas/GetMoneyAmountToChargeResult'
          description: Result
      title: accounts_GetMoneyAmountToCharge_Response_200
  securitySchemes:
    JwtAuth:
      type: http
      scheme: bearer
      description: >-
        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.

```

## SDK Code Examples

```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()
```