POST /batches/{id}/cancel

This operation allows you to cancel a Batch which is in DRAFT status.

All Payments associated to the Batch will also be cancelled.

Request

Ensure the bearer token is included in the Header of the POST operation:

Header
Mandatory
Description

Authorization

Yes

Parameter
Mandatory
Description

id

Yes

The Batch ID to cancel

Response

If the Batch was in DRAFT status, and the Batch could be successfully cancelled, the Batch details will return, including a Batch Summary:

{
  "id": "string($guid)",
  "name": "string",
  "statusCode": "string",
  "externalId": "string",
  "createdAt": "string($date-time)",
  "summary": {
    "paymentsAmount": decimal,
    "paymentsCount": int32,
    "referralsAmount": decimal,
    "settledAmount": decimal,
    "settledCount": int32,
    "cancelledAmount": decimal,
    "cancelledCount": int32
  }
}

Refer to GET /batches/{id} for details on the field values.

The statusCode for the Batch will return as CANCELLED. In addition, cancelledAmount and cancelledCount for the Batch Summary will be populated.

Sample Response
{
  "id": "f945d71c-b00f-4e77-8175-253093157a2f",
  "name": "Test",
  "statusCode": "CANCELLED",
  "createdAt": "2022-06-14T06:26:43.473",
  "summary": {
    "paymentsAmount": 18500,
    "paymentsCount": 185,
    "referralsAmount": 0,
    "settledAmount": 0,
    "settledCount": 0,
    "cancelledAmount": 18500,
    "cancelledCount": 185
  }
}

You can use GET /batches/{id}/payments to get further details on the individual Payments that were cancelled.

Last updated