--- title: "Add or remove funds" source_url: https://dev.digicert.com/certcentral-apis/services-api/subaccount/add-or-remove-funds.html api_method: POST api_endpoint: "/services/v2/account/subaccount/{{subaccount_id}}/balance" api_url: "https://www.digicert.com/services/v2/account/subaccount/{{subaccount_id}}/balance" --- **POST** `https://www.digicert.com/services/v2/account/subaccount/{{subaccount_id}}/balance` Use this endpoint to add or remove funds from the subaccount balance. ## Example requests and responses **cURL** ```bash curl -L -X PUT 'https://www.digicert.com/services/v2/account/subaccount/{{subaccount_id}}/balance' \ -H 'Content-Type: application/json' \ -H 'X-DC-DEVKEY: {{api_key}}' \ --data-raw '{ "amount" : 5000, "transaction_type" : "deposit" }' ``` **Python** ```python import requests url = "https://www.digicert.com/services/v2/account/subaccount/{{subaccount_id}}/balance" payload = "{\r\n\t\"amount\" : 5000,\r\n\t\"transaction_type\" : \"deposit\"\r\n}" headers = { 'Content-Type': 'application/json', 'X-DC-DEVKEY': '{{api_key}}' } response = requests.request("PUT", url, headers=headers, data = payload) print(response.text.encode('utf8')) ``` **Go** ```go package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://www.digicert.com/services/v2/account/subaccount/{{subaccount_id}}/balance" method := "PUT" payload := strings.NewReader("{ \n \"amount\" : 5000, \n \"transaction_type\" : \"deposit\" \n}") client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) } req.Header.Add("Content-Type", "application/json") req.Header.Add("X-DC-DEVKEY", "{{api_key}}") res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body)) } ``` **NodeJS** ```javascript var request = require('request'); var options = { 'method': 'PUT', 'url': 'https://www.digicert.com/services/v2/account/subaccount/{{subaccount_id}}/balance', 'headers': { 'Content-Type': 'application/json', 'X-DC-DEVKEY': '{{api_key}}' }, body: JSON.stringify({"amount":5000,"transaction_type":"deposit"}) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); ``` ## 204 No Content ```json // empty ``` ## Request parameters
| Name | Req/Opt | Type | Description |
|---|---|---|---|
| amount | required | int | Amount to be added or removed from the subaccount balance, in the subaccount’s display currency. |
| transaction_type | required | string | Type of transaction to request. Possible values: deposit (adds amount to subaccount balance) or deduct (removes amount from subaccount balance). |