To retrieve balances, you need to get the values of the following fields in Financials:


To try out the steps in this section, install Postman and open the Postman collection we have prepared for you. In the collection, open the Retrieve balances of all Account records request and replace variables with actual values.

Download Postman Open Postman Collection


Step 1: Create a GET request

Configure your application to send the following GET request that uses the Salesforce Object Query Language (SOQL):

GET https://{your_Salesforce_domain}/services/data/v44.0/queryAll?q=SELECT Id,Name,s2cor__Base_Balance__c,s2cor__Base_Debit__c,s2cor__Base_Credit__c,s2cor__Foreign_Balance__c,s2cor__Foreign_Debit__c,s2cor__Foreign_Credit__c FROM s2cor__Sage_ACC_Tag__c WHERE s2cor__Account__c != null

where


Step 2: Configure authorization

Make sure your request uses OAuth 2.0. Authorization data must be included in the request URL.


Step 3: Configure headers

Configure the request headers to include the following key-value pairs:

Key Value
Authorization Bearer {access_token}
Example:
Bearer 00D0N000000h6Yq!AR0AQObORnk9lCldrMydk1Y3cuyqpscqcU.T1xvoM1uWkWrr8MLu2ehJLKp7Mz3Qeu.eQGI13qlH_HfGEEMxV_J8FdI1TwdR
Content-Type application/json

Step 4: Send your request

Send your request and parse the response. The JSON payload you receive contains the balances for all Account records in your Salesforce organization.


Example response


{
    "totalSize": 4,
    "done": true,
    "records": [
        {
            "attributes": {
                "type": "s2cor__Sage_ACC_Tag__c",
                "url": "/services/data/v44.0/sobjects/s2cor__Sage_ACC_Tag__c/a130N00000IuXiBQAV"
            },
            "Id": "a130N00000IuXiBQAV",
            "Name": "Australian AI Inc",
            "s2cor__Base_Balance__c": 27000,
            "s2cor__Base_Debit__c": 200000,
            "s2cor__Base_Credit__c": 173000,
            "s2cor__Foreign_Balance__c": 0,
            "s2cor__Foreign_Debit__c": 0,
            "s2cor__Foreign_Credit__c": 0
        },
        {
            "attributes": {
                "type": "s2cor__Sage_ACC_Tag__c",
                "url": "/services/data/v44.0/sobjects/s2cor__Sage_ACC_Tag__c/a130N00000IuXvxQAF"
            },
            "Id": "a130N00000IuXvxQAF",
            "Name": "Blue Cloud Blockchain",
            "s2cor__Base_Balance__c": 54000,
            "s2cor__Base_Debit__c": 106750,
            "s2cor__Base_Credit__c": 52750,
            "s2cor__Foreign_Balance__c": 0,
            "s2cor__Foreign_Debit__c": 0,
            "s2cor__Foreign_Credit__c": 0
        },
        {
            "attributes": {
                "type": "s2cor__Sage_ACC_Tag__c",
                "url": "/services/data/v44.0/sobjects/s2cor__Sage_ACC_Tag__c/a130N00000IuXi5QAF"
            },
            "Id": "a130N00000IuXi5QAF",
            "Name": "BlueRail Consulting",
            "s2cor__Base_Balance__c": 8000,
            "s2cor__Base_Debit__c": 75000,
            "s2cor__Base_Credit__c": 67000,
            "s2cor__Foreign_Balance__c": 0,
            "s2cor__Foreign_Debit__c": 0,
            "s2cor__Foreign_Credit__c": 0
        },
        {
            "attributes": {
                "type": "s2cor__Sage_ACC_Tag__c",
                "url": "/services/data/v44.0/sobjects/s2cor__Sage_ACC_Tag__c/a130N00000IuXhtQAF"
            },
            "Id": "a130N00000IuXhtQAF",
            "Name": "CodeSecure Inc",
            "s2cor__Base_Balance__c": 7500,
            "s2cor__Base_Debit__c": 77500,
            "s2cor__Base_Credit__c": 70000,
            "s2cor__Foreign_Balance__c": 0,
            "s2cor__Foreign_Debit__c": 0,
            "s2cor__Foreign_Credit__c": 0
        }
    ]
}