Use this endpoint to add or remove funds from the subaccount balance.
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"
}'
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'))
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))
}
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);
});
// empty
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).
|