Balance details

GET
https://www.digicert.com/services/v2/account/subaccount/{{subaccount_id}}/balance

Use this endpoint to retrieve the balance on a subaccount.

cURL
curl -L -X GET 'https://www.digicert.com/services/v2/account/subaccount/{{subaccount_id}}/balance' \
-H 'Content-Type: application/json' \
-H 'X-DC-DEVKEY: {{api_key}}'
Python
import requests

url = "https://www.digicert.com/services/v2/account/subaccount/{{subaccount_id}}/balance"

payload = "{\r\n    \"amount\": 5000,\r\n    \"currency\": \"USD\"\r\n}"
headers = {
  'Content-Type': 'application/json',
  'X-DC-DEVKEY': '{{api_key}}'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
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 := "GET"

  payload := strings.NewReader("{
\n    \"amount\": 5000,
\n    \"currency\": \"USD\"
\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
var request = require('request');
var options = {
  'method': 'GET',
  '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,"currency":"USD"})

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
200 OK
{
    "amount": 5000,
    "currency": "USD"
}

Response parameters

Name Type Description
amount int The amount in the subaccount balance
currency string Currency code used to display pricing to subaccount.
Possible values: See Glossary – Subaccount display currencies.