Client Balance

1. Method: Client Balance


Important notes

Public and Private Keys are unique for Sandbox and Live.
Sandbox Endpoint URL: https://sandbox.api.igsend.co.uk/services/clientbalance/?ClientID= 
Live Endpoint URL: https://api.igsend.co.uk/services/clientbalance/?ClientID= 

 Double click the URL above to insert into the Endpoint field below
Endpoint URL
Public Key
Private Key

Request Payload

None


Response Payload


2. Request Data

As no JSON payload is required for this API, the required data (client ID) must be passed in the URL.

Example: https://api.igsend.co.uk/services/clientbalance/?ClientID=123456

Title Datatype Validation Max. Data Length Example Data Notes
Client ID Int
  • Must not be null or empty or 0
- 100045 This parameter contains an Client ID.

3. JSON Response Data

The table below details the response code, message ID and message returned from an API call.
status MessageID Message Description
1 10010 Client Balance successfully retrieved Response received and tableRes holds the data of the client balance. The AccountBalance value is nested within tableRes
Example JSON response
												
	{    
		"coreRes": 
		{        
			"status": 1,        
			"Message": "Client Balance successfully retrieved.",        
			"MessageID": 10010    
		},    
		"tableRes": 
		[        
			{            
				"ClientID": 100000,            
				"AccountBalance": "1400000",            
				"Status": "success",            
				"Balance Currency": "GBP",            
				"Balance State": "IN_CREDIT"        
			}    
		]
	}
												
											
2 10009 Data Validation Failed. Account Number was not available for this client.

4. Code Example

C#
								
	using (HttpClient client = new HttpClient())
	{
		string PublicKey = "{Your public key}";
		string PrivateKey = "{Your private key}";
		int ClientId = 123456;
		string RequestAddress = "https://api.igsend.co.uk/services/clientbalance/?ClientID=" + ClientId
		client.BaseAddress = new Uri(RequestAddress);
		var auth = string.Format("{0}:{1}", PublicKey, PrivateKey);
		var encoded = Convert.ToBase64String(Encoding.ASCII.GetBytes(auth));
		client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", encoded);
		HttpResponseMessage response = await client.GetAsync(RequestAddress);
	}
								
							
If you develop in another code, which may be useful to other customers, we would love to include further examples here. You can submit your example code to the API team.