get_balance

Queries the requester's account, and returns the total amount of money in the account and the amount that is allocated to pending transactions.

Request parameters for get_balance

Standard parameters:

  • action = get_balance
  • object = balance
  • registrant_ip = valid IP address of the registrant attributes

Response parameters for get_balance

Standard parameters:

  • action = reply
  • object = balance
  • is_success = a Boolean is returned, indicating success or failure of the request
  • response_code = response code indicating outcome of the request
  • response_text = message describing the outcome of the request

Attributes:

If the request is successful, the attributes associative array may include the following:

Parameter name

Obligation

Definition / Value

balance

Returned if is_success = true

The total amount of money in the requester's account, including the amount that is allocated to pending transactions.

hold_balance

Returned if is_success = true

The amount of money in the requester's account that is allocated to pending transactions.

Examples for get_balance

Request

<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<!DOCTYPE OPS_envelope SYSTEM 'ops.dtd'> <OPS_envelope>
<OPS_envelope>
    <header>
        <version>0.9</version>
    </header>
    <body>
        <data_block>
            <dt_assoc>
                <item key="protocol">XCP</item>
                <item key="action">GET_BALANCE</item>
                <item key="object">BALANCE</item>
                <item key="registrant_ip" />
            </dt_assoc>
        </data_block>
    </body>
</OPS_envelope>

Response

<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<!DOCTYPE OPS_envelope SYSTEM 'ops.dtd'>
<OPS_envelope>
    <header>
        <version>0.9</version>
    </header>
    <body>
        <data_block>
            <dt_assoc>
                <item key="protocol">XCP</item>
                <item key="action">REPLY</item>
                <item key="object">BALANCE</item>
                <item key="is_success">1</item>
                <item key="response_code">200</item>
                <item key="response_text">Command successful</item>
                <item key="attributes">
                    <dt_assoc>
                        <item key="balance">8549.18</item>
                        <item key="hold_balance">1676.05</item>
                    </dt_assoc>
                </item>
            </dt_assoc>
        </data_block>
    </body>
</OPS_envelope>