API Reference
Create a batch
POST
/batches/{filename}Batch File Format
The Batch File Format is detailed in the Overview section of the Batches Reference. There are three formats - Purchases, Refunds, Direct Debits.
Filename Convention
The Batch filename must fit a specific convention in order to be accepted. When uploading your batch please ensure that the filename uses the following pattern:
BATCH-[version]-[type]-[username]-[date]-[reference].csvWhere:
versionis the file format version (currently v1)typeis the batch file type (PURCHASE, REFUND or DIRECTDEBIT)usernameis your merchant usernamedateis the date in YYYYMMDD format when the batch should be processedreferenceis your reference for the batch file
Body Parameters
RAW_BODYstring (binary)(optional)The batch CSV file format
Query Parameters
filenamestringYour CSV batch payments file name
Request
curl
curl https://gateway.pmnts-sandbox.io/v1.0/batches/BATCH-v1-PURCHASE-TEST-20180131-1516337064.csv \
-u TEST:TEST \
--data-binary @tmp/batches/BATCH-v1-PURCHASE-TEST-20180131-1516337064.csv \
-H "Content-Type: text/csv" \Response
201cURL
json
{
"successful": true,
"response": {
"id": "071-BF-2H8VWBRN",
"filename": "BATCH-v1-PURCHASE-TEST-20180131-1516337064.csv",
"created_at": "2018-02-19T12:29:55+11:00",
"process_date": "2018-01-31",
"start_date": null,
"completed_date": null,
"status": "New",
"type": "PURCHASE",
"reference": "1516337064"
},
"errors": [],
"test": false
}201Ruby
json
{
"id": "071-BF-NFIIDN7F",
"filename": "BATCH-v1-PURCHASE-TEST-20180131-1516337065.csv",
"created_at": "2018-02-19T12:36:20+11:00",
"process_date": "2018-01-31",
"start_date": null,
"completed_date": null,
"status": "New",
"type": "PURCHASE",
"reference": "1516337065"
}