# Additional endpoints

## Get balance

### Request address

`https://cactusgino.com/api/balance/`

### Request parameters

<table data-full-width="true"><thead><tr><th width="180.8">Parameter</th><th>Required</th><th>Format</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>merchant_id</td><td>Yes</td><td>string</td><td>merchant_id</td><td>afsfasf3434</td></tr><tr><td>site_id</td><td>Yes</td><td>integer</td><td>Site ID</td><td>123</td></tr><tr><td>currency</td><td>No</td><td>string</td><td>Currency</td><td>USD</td></tr><tr><td>signature</td><td>Yes</td><td>string</td><td><a href="signature">request signature</a></td><td>afsfasf3434</td></tr></tbody></table>

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

```sh
{ 
    "merchant_id": "test_api_v2",
    "site_id": "101",
    "currency": "USD",
    "signature": "some"
}
```

{% endtab %}

{% tab title="Python" %}

```python
{ 
    "merchant_id": "test_api_v2",
    "site_id": "101",
    "currency": "USD",
    "signature": "some"
}
```

{% endtab %}
{% endtabs %}

### Response parameters

<table data-full-width="true"><thead><tr><th>Parameter</th><th>Format</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>site_id</td><td>integer</td><td>Site ID</td><td>123</td></tr><tr><td>balance</td><td>array</td><td></td><td></td></tr><tr><td>id</td><td>integer</td><td>Balance ID</td><td>1</td></tr><tr><td>name</td><td>string</td><td>Balance name</td><td>Balance_USD</td></tr><tr><td>amount</td><td>integer</td><td>Balance amount</td><td>1000.0</td></tr><tr><td>available</td><td>integer</td><td>Available balance</td><td>900.0</td></tr></tbody></table>

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

```python
{
    "site_id": 101,
    "balances": [
        {
            "id": 1,
            "name": "Test_balance_1",
            "currency": "USD",
            "amount": 10000.0,
            "available": 10000.0
        },
        {
            "id": 3,
            "name": "bal_eur_1",
            "currency": "EUR",
            "amount": 14600.0,
            "available": 14600.0
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Get project balance

### Request address

`https://cactusgino.com/api/balance_project/`

### Request parameters

<table data-full-width="true"><thead><tr><th>Parameter</th><th>Required</th><th>Format</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>project_id</td><td>Yes</td><td>string</td><td>Project ID</td><td>2</td></tr><tr><td>merchant_id</td><td>Yes</td><td>string</td><td>merchant_id</td><td>afsfasf3434</td></tr><tr><td>site_id</td><td>Yes</td><td>integer</td><td>Site ID</td><td>123</td></tr><tr><td>currency</td><td>No</td><td>string</td><td>User login on the merchant's website</td><td>USD</td></tr><tr><td>signature</td><td>Yes</td><td>string</td><td><a href="signature">request signature</a></td><td>si</td></tr></tbody></table>

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

```json
{ 
    "project_id": "2",
    "merchant_id": "test_v2",
    "site_id": "101",
    "currency": "USD",
    "signature": "some"
}
```

{% endtab %}
{% endtabs %}

### Response parameters

<table data-full-width="true"><thead><tr><th>Parameter</th><th>Format</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>project_id</td><td>string</td><td>Project ID</td><td>2</td></tr><tr><td>project_balance</td><td>array</td><td></td><td></td></tr><tr><td>currency</td><td>string</td><td>Currency of summary in project</td><td>USD</td></tr><tr><td>amount</td><td>integer</td><td>Balance summary amount in project</td><td>1000.0</td></tr><tr><td>available</td><td>integer</td><td>Available summary balance in project</td><td>900.0</td></tr></tbody></table>

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

```json
{
    "project_id": 101,
    "project_balance":[
 
         {
            "currency": "USD",
            "amount": 10000.0,
            "available": 10000.0  
        },
        {
            "currency": "EUR",
            "amount": 10000.0,
            "available": 10000.0
        }
 
     ]
}
```

{% endtab %}
{% endtabs %}

## Canceling SBP and P2P invoices <a href="#p2p" id="p2p"></a>

### Request address <a href="#f4307cee19-5" id="f4307cee19-5"></a>

`https://cactusgino.com/api/close_invoice/`

### Request parameters <a href="#id-88964dca07" id="id-88964dca07"></a>

<table data-full-width="true"><thead><tr><th>Parameter</th><th>Required</th><th>Format</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>site_login</td><td>Yes</td><td>string</td><td>site_login of the user, previously sent to create an invoice</td><td>afsfasf3434</td></tr><tr><td>merchant_id</td><td>Yes</td><td>string</td><td>merchant_id</td><td>afsfasf3434</td></tr><tr><td>signature</td><td>Yes</td><td>string</td><td><a href="signature">request signature</a></td><td>afsfasf3434</td></tr><tr><td>site_id</td><td>Yes</td><td>integer</td><td>Site ID</td><td>123</td></tr><tr><td>request_id</td><td>Yes</td><td>string</td><td>Payment ID from the merchant</td><td>kjksjf-fsdff-s</td></tr></tbody></table>

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

#### <mark style="color:red;">Failed response</mark>

```sh
{
  "success": false,
  "message": "Invalid ContentType or json format",
  "signature": "kfnf3-njdfsd-fdsfkdsf"
}
```

#### <mark style="color:green;">Successful response</mark>

<pre class="language-sh"><code class="lang-sh">{
    "success": true
    "amount": 10000.0,
    "status": 4,
    "site_id": "34",
    "site_login": "test_login",
    "request_id": "43435",
<strong>    "invoice_id": 343445,
</strong>    "currency": "USD",
    "received_currency": "USD",
    "received_amount": 43
}
</code></pre>

{% endtab %}

{% tab title="python" %}

#### <mark style="color:red;">Failed response</mark>

```python
{
  "success": false,
  "message": "Invalid ContentType or json format",
  "signature": "kfnf3-njdfsd-fdsfkdsf"
}
```

#### <mark style="color:green;">Successful response</mark>

```python
{
    "success": true
    "amount": 10000.0,
    "status": 4,
    "site_id": "34",
    "site_login": "test_login",
    "request_id": "43435",
    "invoice_id": 343445,
    "currency": "USD",
    "received_currency": "USD",
    "received_amount": 43
}
```

{% endtab %}
{% endtabs %}

### Response parameters

<table data-full-width="true"><thead><tr><th>Parameters</th><th>Required</th><th>Format</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>success</td><td>Yes</td><td>bool</td><td>Request success</td><td>False</td></tr><tr><td>amount</td><td>Yes</td><td>int</td><td>Transaction amount in order currency in minor units, for example for US dollars - in cents</td><td>10000</td></tr><tr><td>status</td><td>Yes</td><td>int</td><td>Operation status</td><td>4</td></tr><tr><td>site_id</td><td>Yes</td><td>integer</td><td>Site ID</td><td>123</td></tr><tr><td>site_login</td><td>Yes</td><td>string</td><td>User login on the merchant's website</td><td>test_login</td></tr><tr><td>request_id</td><td>Yes</td><td>string</td><td>Payment ID from the merchant</td><td>kjksjf-fsdff-s</td></tr><tr><td>invoice_id</td><td>Yes</td><td>int</td><td>Unique id in the cactus system</td><td>905910</td></tr><tr><td>currency</td><td>Yes</td><td>string</td><td>Currency</td><td>KZT</td></tr><tr><td>received_currency</td><td>Yes</td><td>string</td><td>Currency in which the payment will be made</td><td>KZT</td></tr><tr><td>received_amount</td><td>int</td><td>Numeric</td><td>Final payment amount (if payment is unsuccessful, returns 0) minor units</td><td>10000</td></tr><tr><td>message</td><td>Yes</td><td>string</td><td>Error message if any</td><td>No card available</td></tr></tbody></table>

## Checking the invoice status <a href="#f67458f9ed" id="f67458f9ed"></a>

### Request address <a href="#f4307cee19-6" id="f4307cee19-6"></a>

`https://cactusgino.com/api/check_status/`

### Request parameters <a href="#id-88964dca07-2" id="id-88964dca07-2"></a>

<table data-full-width="true"><thead><tr><th>Parameters</th><th>Required</th><th>Format</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>merchant_id</td><td>Yes</td><td>string</td><td>Merchant ID, to be determined in the system</td><td>superkey</td></tr><tr><td>site_login</td><td>Yes</td><td>varchar(256)</td><td>Login of the user making the payment</td><td>jnsdf093jfsdklfndf09</td></tr><tr><td>site_id</td><td>Yes</td><td>integer</td><td>Your site_id</td><td>21</td></tr><tr><td>request_id</td><td>Yes</td><td>string</td><td>Order ID in the seller's system</td><td>uib64bc9494n9v</td></tr><tr><td>signature</td><td>Yes</td><td>string</td><td>See request signature <a href="https://docs.cactusgino.com/?python#a5dcf372a2">. Rules for forming a request signature</a></td><td>f</td></tr></tbody></table>

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

#### <mark style="color:red;">Failed response</mark>

```sh
{
  "success": false,
  "message": "Invalid ContentType or json format",
  "signature": "kfnf3-njdfsd-fdsfkdsf"
}
```

#### <mark style="color:green;">Successful response</mark>

```sh
{
    "success": true,
    "status": 4,
    "site_id": 701,
    "site_login": "jkaja74nfkjndsf09dsjfmdosif0-sdf,",
    "request_id": "dmnks-dfdsf-dfsdf-sfdds",
    "invoice_id": 1231314,
    "currency": "USD",
    "signature": "dasdmdkmdasdsd0dsa0kdk20d2k2d2"

}
```

{% endtab %}

{% tab title="python" %}

#### <mark style="color:red;">Failed response</mark>

```python
{
  "success": false,
  "message": "Invalid ContentType or json format",
  "signature": "kfnf3-njdfsd-fdsfkdsf"
}
```

#### <mark style="color:green;">Successful response</mark>

```python
{
    "success": true,
    "status": 4,
    "site_id": 701,
    "site_login": "jkaja74nfkjndsf09dsjfmdosif0-sdf,",
    "request_id": "dmnks-dfdsf-dfsdf-sfdds",
    "invoice_id": 1231314,
    "currency": "USD",
    "signature": "dasdmdkmdasdsd0dsa0kdk20d2k2d2"

}
```

{% endtab %}
{% endtabs %}

### Response parameters <a href="#id-1300eba048" id="id-1300eba048"></a>

<table data-full-width="true"><thead><tr><th>Parameter</th><th>Required</th><th>Format</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>site_id</td><td>Yes</td><td>integer</td><td>Site ID</td><td>123</td></tr><tr><td>site_login</td><td>Yes</td><td>string</td><td>User login on the merchant's website</td><td>test_login</td></tr><tr><td>status</td><td>Yes</td><td>Enum</td><td>Operation status </td><td>4</td></tr><tr><td>invoice_id</td><td>Yes</td><td>int</td><td>Unique id in the cactus system</td><td>905910</td></tr><tr><td>request_id</td><td>Yes</td><td>string</td><td>Payment ID from the merchant</td><td>kjksjf-fsdff-s</td></tr><tr><td>amount</td><td>Yes</td><td>int</td><td>Transaction amount in order currency in minor units, for example for US dollars - in cents</td><td>10000</td></tr><tr><td>received_amount</td><td>int</td><td>Numeric</td><td>Final payment amount (if payment is unsuccessful, returns 0) minor units</td><td>10000</td></tr><tr><td>success</td><td>Yes</td><td>bool</td><td>Request success</td><td>True</td></tr><tr><td>currency</td><td>Yes</td><td>string</td><td>Currency</td><td>KZT</td></tr><tr><td>received_currency</td><td>Yes</td><td>string</td><td>Currency in which the payment will be made</td><td>KZT</td></tr><tr><td>signature</td><td>Yes</td><td>string</td><td>See request signature <a href="https://docs.cactusgino.com/?python#a5dcf372a2">. Rules for forming a request signature</a></td><td></td></tr><tr><td>message</td><td>Yes</td><td>string</td><td>Error message if any</td><td>No card available</td></tr></tbody></table>
