DELETE /payments/{id}

This operation allows for the deletion of a single payment which is in DRAFT status.

When you delete a Payment, it will be permanently deleted from the batch it is associated to. Using a GET /payments/{id} (after deleting the Payment) will return as a 404 Not Found.

Request

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

Header
Mandatory
Description

Authorization

Yes

Parameter
Mandatory
Description

id

Yes

The unique payment ID to delete.

Response

A 404 Not Found HTTP response will be returned if the paymentId does not exist.

If the Payment exists, and the Payment could be deleted: an HTTP 200 response will be returned with the following body:

{
  "id": "",
  "batchId": "",
  "msisdn": "27797411850",
  "amount": 250,
  "firstname": "string",
  "lastname": "string",
  "statusCode": "DELETED",
  "isMember": boolean,
  "createdAt": ""
}

If the Payment is not in DRAFT status, then a 400 Bad Request will be returned.

Sample Response
{
  "id": "d07295e6-98ef-46b1-9911-01b8a3426de6",
  "batchId": "7c2c1a0a-f462-42c3-b13c-30da2e4ad216",
  "msisdn": "27821231234",
  "amount": 250,
  "firstname": "Test",
  "lastname": "User 1",
  "statusCode": "DELETED",
  "isMember": true,
  "createdAt": "2022-11-16T14:08:52.127"
}

Last updated