# Cash method

## Description <a href="#id-skhemarabotysmethodcash-opisanie" id="id-skhemarabotysmethodcash-opisanie"></a>

Cash invoice creation operation:

* [Payin](https://docs.cactusgino.com/cactus/h2h-integration) - /api/create\_invoice + method = cash + additional fields
* [Payout](https://docs.cactusgino.com/cactus/payout) - /api/payout + method =cash + additional fields (link to section)

Operations with a created invoice:

* Canceling an invoice - /api/cash\_in/update/ + update\_type="delete"
* Changing invoice parameters - /api/cash\_in/update/ + update\_type="edit"

## Invoice cancellation <a href="#id-skhemarabotysmethodcash-otmenainvoisa" id="id-skhemarabotysmethodcash-otmenainvoisa"></a>

The operation allows you to cancel a created invoice

```url
https://cactusgino.com/api/cash_in/update/
```

### **Request parameters**

| Parameter    | Required | Format  | Description                                                                                   |
| ------------ | -------- | ------- | --------------------------------------------------------------------------------------------- |
| site\_id     | Yes      | integer | Your site\_id                                                                                 |
| merchant\_id | Yes      | string  | Merchant ID to be determined in the system.                                                   |
| request\_id  | Yes      | string  | Order ID in the seller's system. The identifier of the invoice site that needs to be changed. |
| update\_type | Yes      | String  | The type of invoice modification operation. To cancel the invoice, use "delete".              |
| signature    | Yes      | string  | See request signature. Rules for forming a request signature                                  |

### **Request example**

```json
{ 
    'merchant_id': 'test_api_v2',
    'request_id': 'test20240430132039',
    'signature': '7b71ef53367785053e8e3bb3300ac4458884428f',
    'site_id': '101',
    'update_type': 'delete'
}
```

### Request response

```json
{ 
    'amount': 10000000,
    'currency': 'RUB',
    'invoice_id': 23249,
    'request_id': 'test20240430132039',
    'signature': '5520cc4d1ec1433f8ff01470f0d95c3b9a363000',
    'site_id': 101,
    'site_login':
    'user_4',
    'success': True
}
```

## Operations with a created invoice <a href="#id-skhemarabotysmethodcash-operaciissozdannyminvoisom" id="id-skhemarabotysmethodcash-operaciissozdannyminvoisom"></a>

The operation will allow you to change the data

```url
https://cactusgino.com/api/cash_in/update/
```

### **Request parameters**

| Parameter    | Required | Format  | Description                                                                                   |
| ------------ | -------- | ------- | --------------------------------------------------------------------------------------------- |
| site\_id     | Yes      | integer | Your site\_id                                                                                 |
| merchant\_id | Yes      | string  | Merchant ID to be determined in the system.                                                   |
| request\_id  | Yes      | string  | Order ID in the seller's system. The identifier of the invoice site that needs to be changed. |
| update\_type | Yes      | String  | The type of invoice modification operation. To edit the invoice parametrs, use "edit".        |
| address      | No       | String  | Address                                                                                       |
| messenger    | No       | String  | Messenger                                                                                     |
| username     | No       | String  | Username in messenger                                                                         |
| asap         | No       | Bool    | Flag to indicate urgency.                                                                     |
| time         | No       | String  | Time                                                                                          |
| signature    | Yes      | string  | See request signature. Rules for forming a request signature                                  |

### **Request example**

```json
{ 
    'address': 'Test, Test Street 13',
    'asap': True,
    'merchant_id': 'test_api_v2',
    'messenger': 'telegram',
    'request_id': 'test20240430134054',
    'signature': 'bffa683bee744ba459bec878f29d9b2b4f4bf792',
    'site_id': '101',
    'update_type': 'edit',
    'username': '@test_user'
}
```

### Request answer

```json
{ 
    'amount': 10000000,
    'currency': 'RUB',
    'invoice_id': 23250,
    'request_id': 'test20240430134054',
    'signature': '093f12dbed86f8f38c417bf78d0ce51cc753b355',
    'site_id': 101,
    'site_login': 'user_4',
    'success': True
}
```
