All URIs are relative to https://api-sandbox.transferzero.com/v1
Method | HTTP request | Description |
---|---|---|
getAccount | GET /accounts/{Currency} | Fetches account balance for specified currrency |
getAccounts | GET /accounts | Fetches account balances for all currencies |
AccountResponse getAccount(currency)
Fetches account balance for specified currrency
Fetches account balance for specified currrency, and returns current balance and associated currency code
import { AccountsApi } from 'transferzero-sdk';
// Configure API key authorization
const apiClient = new ApiClient();
apiClient.apiKey = '<key>';
apiClient.apiSecret = '<secret>';
apiClient.basePath = 'https://api-sandbox.transferzero.com/v1';
let apiInstance = new AccountsApi(apiClient);
apiInstance.getAccount(currency).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
if (error.isValidationError) {
let result = error.getResponseObject();
console.log(result);
console.error("WARN: Validation error occurred when calling the endpoint");
} else {
console.error("Exception when calling AccountsApi#getAccount");
throw error;
}
});
Name | Type | Description | Notes |
---|---|---|---|
currency | String | Currency code of account balance to fetch Example: `/v1/accounts/USD` |
You can set the API Key and Secret by passing a config object when creating an ApiClient:
const apiClient = new ApiClient({
apiKey: '<key>',
apiSecret: '<secret>',
basePath: 'https://api-sandbox.transferzero.com/v1'
});
Or by setting the properties on an ApiClient instance:
const apiClient = new ApiClient();
apiClient.apiKey = '<key>';
apiClient.apiSecret = '<secret>';
apiClient.basePath = 'https://api-sandbox.transferzero.com/v1';
- Content-Type: Not defined
- Accept: application/json
AccountListResponse getAccounts()
Fetches account balances for all currencies
Fetches account balances for all currencies, and returns an array of the current balances and associated currency codes.
import { AccountsApi } from 'transferzero-sdk';
// Configure API key authorization
const apiClient = new ApiClient();
apiClient.apiKey = '<key>';
apiClient.apiSecret = '<secret>';
apiClient.basePath = 'https://api-sandbox.transferzero.com/v1';
let apiInstance = new AccountsApi(apiClient);
apiInstance.getAccounts().then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
if (error.isValidationError) {
let result = error.getResponseObject();
console.log(result);
console.error("WARN: Validation error occurred when calling the endpoint");
} else {
console.error("Exception when calling AccountsApi#getAccounts");
throw error;
}
});
This endpoint does not need any parameter.
You can set the API Key and Secret by passing a config object when creating an ApiClient:
const apiClient = new ApiClient({
apiKey: '<key>',
apiSecret: '<secret>',
basePath: 'https://api-sandbox.transferzero.com/v1'
});
Or by setting the properties on an ApiClient instance:
const apiClient = new ApiClient();
apiClient.apiKey = '<key>';
apiClient.apiSecret = '<secret>';
apiClient.basePath = 'https://api-sandbox.transferzero.com/v1';
- Content-Type: Not defined
- Accept: application/json