cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
206 lines (136 loc) • 7.52 kB
Markdown
# CyberSource.TransactionBatchesApi
All URIs are relative to *https://apitest.cybersource.com*
Method | HTTP request | Description
------------- | ------------- | -------------
[**getTransactionBatchDetails**](TransactionBatchesApi.md#getTransactionBatchDetails) | **GET** /pts/v1/transaction-batch-details/{id} | Get Transaction Details for a given Batch Id
[**getTransactionBatchId**](TransactionBatchesApi.md#getTransactionBatchId) | **GET** /pts/v1/transaction-batches/{id} | Get Individual Batch File
[**getTransactionBatches**](TransactionBatchesApi.md#getTransactionBatches) | **GET** /pts/v1/transaction-batches | Get a List of Batch Files
[**uploadTransactionBatch**](TransactionBatchesApi.md#uploadTransactionBatch) | **POST** /pts/v1/transaction-batch-upload | Upload a Batch File
<a name="getTransactionBatchDetails"></a>
# **getTransactionBatchDetails**
> getTransactionBatchDetails(id, opts)
Get Transaction Details for a given Batch Id
Provides real-time detailed status information about the transactions that you previously uploaded in the Business Center or processed with the Offline Transaction File Submission service.
### Example
```javascript
var CyberSource = require('CyberSource');
var apiInstance = new CyberSource.TransactionBatchesApi();
var id = "id_example"; // String | The batch id assigned for the template.
var opts = {
'uploadDate': new Date("2013-10-20"), // Date | Date in which the original batch file was uploaded. Date must be in ISO-8601 format. Please refer the following link to know more about ISO 8601 format.[Rfc Date Format](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14) **Example date format:** - yyyy-MM-dd
'status': "status_example" // String | Allows you to filter by rejected response. Valid values: - Rejected
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.getTransactionBatchDetails(id, opts, callback);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| The batch id assigned for the template. |
**uploadDate** | **Date**| Date in which the original batch file was uploaded. Date must be in ISO-8601 format. Please refer the following link to know more about ISO 8601 format.[Rfc Date Format](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14) **Example date format:** - yyyy-MM-dd | [optional]
**status** | **String**| Allows you to filter by rejected response. Valid values: - Rejected | [optional]
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json;charset=utf-8
- **Accept**: text/csv, application/xml, text/vnd.cybersource.map-csv
<a name="getTransactionBatchId"></a>
# **getTransactionBatchId**
> PtsV1TransactionBatchesIdGet200Response getTransactionBatchId(id)
Get Individual Batch File
This API provides details like upload date, completion date, transaction count and accepted and rejected transaction count of the individual batch file using the batch id
### Example
```javascript
var CyberSource = require('CyberSource');
var apiInstance = new CyberSource.TransactionBatchesApi();
var id = "id_example"; // String | The batch id assigned for the template.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getTransactionBatchId(id, callback);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| The batch id assigned for the template. |
### Return type
[**PtsV1TransactionBatchesIdGet200Response**](PtsV1TransactionBatchesIdGet200Response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json;charset=utf-8
- **Accept**: application/hal+json
<a name="getTransactionBatches"></a>
# **getTransactionBatches**
> PtsV1TransactionBatchesGet200Response getTransactionBatches(startTime, endTime)
Get a List of Batch Files
Provide the date and time search range to get a list of Batch Files ready for settlement
### Example
```javascript
var CyberSource = require('CyberSource');
var apiInstance = new CyberSource.TransactionBatchesApi();
var startTime = new Date("2013-10-20T19:20:30+01:00"); // Date | Valid report Start Time in **ISO 8601 format** Please refer the following link to know more about ISO 8601 format.[Rfc Date Format](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14) **Example date format:** - yyyy-MM-dd'T'HH:mm:ss.SSSZZ
var endTime = new Date("2013-10-20T19:20:30+01:00"); // Date | Valid report End Time in **ISO 8601 format** Please refer the following link to know more about ISO 8601 format.[Rfc Date Format](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14) **Example date format:** - yyyy-MM-dd'T'HH:mm:ss.SSSZZ
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getTransactionBatches(startTime, endTime, callback);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**startTime** | **Date**| Valid report Start Time in **ISO 8601 format** Please refer the following link to know more about ISO 8601 format.[Rfc Date Format](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14) **Example date format:** - yyyy-MM-dd'T'HH:mm:ss.SSSZZ |
**endTime** | **Date**| Valid report End Time in **ISO 8601 format** Please refer the following link to know more about ISO 8601 format.[Rfc Date Format](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14) **Example date format:** - yyyy-MM-dd'T'HH:mm:ss.SSSZZ |
### Return type
[**PtsV1TransactionBatchesGet200Response**](PtsV1TransactionBatchesGet200Response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json;charset=utf-8
- **Accept**: application/hal+json
<a name="uploadTransactionBatch"></a>
# **uploadTransactionBatch**
> uploadTransactionBatch(file)
Upload a Batch File
This endpoint enables the upload of a batch file containing transactions for processing.
### Example
```javascript
var CyberSource = require('CyberSource');
var apiInstance = new CyberSource.TransactionBatchesApi();
var file = "/path/to/file.txt"; // File | The file to upload.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.uploadTransactionBatch(file, callback);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**file** | **File**| The file to upload. |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json