Retrieve batch status web service | Sage Pay

Programmers guide

To start, please refer our programmer’s guide for more detail on how to apply the required methodology.

Introduction

A web service that allows a user to retrieve the last 10 batches uploaded to the Sage Pay system.

The web service will return all batches, whether they were uploaded via the web service or manually loaded via the Sage Pay web site.

This service relates to the Debit order, Creditor payments and Salary payments services only.

Technical Information

RetrieveBatchStatus is an online, synchronous web service which allows an external system to request the last 10 batches uploaded on the service and receive an immediate response. This service permits only a single request per web service call.

From your application call:

Input

Submit one of the following service keys relevant to the batches to be returned:

  • Debit order service key
  • Creditor payments service key
  • Salary payments service key

Output

You will receive the following numeric code if there is an error in the service.

Numeric Response Description
100 Authentication failed
200 Web service error contact support@sagepay.co.za
311 Service key not valid for this service

If there is no error, you will receive a tab-delimited string response containing the last 10 batches loaded against the service key submitted.

Note: The system will return a maximum of 10 batches, if fewer than 10 are found in the system, all the batches will be returned.

The format of the response.

Field Description
Service key The service key submitted in the request
Batch Id The batch Id allocated by the Sage Pay system
Batch name The batch name allocated by the Sage Pay system

Format: {Service} batch for {Action date}

EG: Debit batch for 2017-07-01

Status 1 – Unauthorised

2 – Authorised

3 – Locked

4 – Processed

5 – Insufficient funds (Applicable to payment batches only)

Batch volume The number of transactions in the batch
Batch value The total value of the batch
Created on Date and time the batch was loaded to the Sage Pay system

Format: CCYY-MM-DD HH:MM:SS.mmm

EG: 2017-07-01 08:40:34.517

Authorised on Date and time the batch was authorised on the Sage Pay system

Format: CCYY-MM-DD HH:MM:SS.mmm

EG: 2017-07-01 08:40:34.517

Batches never authorised will have the default value

1900-01-01 00:00:00.000

Unauthorised on Date and time the batch was unauthorised on the Sage Pay system

Format: CCYY-MM-DD HH:MM:SS.mmm

This field should be read in conjunction with the status field – batches may have been unauthorised and subsequently re-authorised.

Version 1/2017 last updated 1st September 2017