All URIs are relative to https://api-sandbox.transferzero.com/v1
Method | HTTP request | Description |
---|---|---|
getDocument | GET /documents/{Document ID} | Fetching a document |
getDocuments | GET /documents | Getting a list of documents |
postDocuments | POST /documents | Creating a document |
DocumentResponse getDocument(documentID)
Fetching a document
Returns a single document by the Documents ID
import { DocumentsApi } 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 DocumentsApi(apiClient);
apiInstance.getDocument(documentID).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 DocumentsApi#getDocument");
throw error;
}
});
Name | Type | Description | Notes |
---|---|---|---|
documentID | String | ID of the document to get. Example: `/v1/documents/bf9ff782-e182-45ac-abea-5bce83ad6670` |
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
DocumentListResponse getDocuments(opts)
Getting a list of documents
Fetches a list of documents.
import { DocumentsApi } 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 DocumentsApi(apiClient);
let opts = {
'page': 1 // Number | The page number to request (defaults to 1)
'per': 10 // Number | The number of results to load per page (defaults to 10)
};
apiInstance.getDocuments(opts).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 DocumentsApi#getDocuments");
throw error;
}
});
Name | Type | Description | Notes |
---|---|---|---|
page | Number | The page number to request (defaults to 1) | [optional] |
per | Number | The number of results to load per page (defaults to 10) | [optional] |
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
DocumentResponse postDocuments(documentRequest)
Creating a document
Creates a new document
import { DocumentsApi } 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 DocumentsApi(apiClient);
apiInstance.postDocuments(documentRequest).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 DocumentsApi#postDocuments");
throw error;
}
});
Name | Type | Description | Notes |
---|---|---|---|
documentRequest | DocumentRequest |
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: application/json
- Accept: application/json