Direct Debit

Payment Manipulation

Query, amend or delete an individual payment — provided it has not yet been submitted to BACS.

DELETE/client/{clientCode}/contract/{contractId}/payment/{paymentId}Deletes an existing payment from the database (providing it has not yet been submitted to BACS)#
description:

Deletes an existing payment from the database (providing it has not yet been submitted to BACS)

authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema directDebit/path/client-contract-payment
{
  • clientCode
    string (≤ 6 chars)MandatoryThe client code provided in your welcome email.
  • contractId
    string (guid)MandatoryThe contract GUID on which the payment you are amending has been lodged.
  • paymentId
    string (guid)MandatoryThe payment GUID of the payment you wish to amend.
}
query parameters:
{
  • comment
    string (≤ 255 chars)MandatoryA comment that can be returned when querying the payment.
}

Responses

200OK
response body:
{
  • Message
    stringConfirms the payment has been deleted.
}
400Bad RequestBad request - missing comment
403ForbiddenForbidden - payment contract is protected
404Not FoundPayment not found
Example request
Endpoint
DELETE /client/{clientCode}/contract/{contractId}/payment/{paymentId}
cURL
curl -L -g -X DELETE 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/payment/{paymentId}?comment=A comment' -H 'apiKey: {apiKey}'
Response
HTTP/1.1 200 OK

{
  "Message": "Payment deleted"
}
HTTP/1.1 400 Bad Request

{
  "Message": "Comment must not be empty"
}
HTTP/1.1 403 Forbidden

{
  "Message": "Payment cannot be accessed"
}
HTTP/1.1 404 Not Found

{
  "Message": "Payment not found"
}
GET/client/{clientCode}/contract/{contractId}/payment/{paymentId}Queries the database for details of an existing payment#
description:

Queries the database for details of an existing payment

authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema directDebit/path/client-contract-payment
{
  • clientCode
    string (≤ 6 chars)MandatoryThe client code provided in your welcome email.
  • contractId
    string (guid)MandatoryThe contract GUID on which the payment you are amending has been lodged.
  • paymentId
    string (guid)MandatoryThe payment GUID of the payment you wish to amend.
}

Responses

200OK
response body:
{
  • Id
    string (guid)The GUID of the payment.
  • Amount
    floatThe amount of the payment.
  • Comment
    stringComment passed when the payment was added.
  • Date
    string (date-time)The due date of the payment.
  • IsAdhoc
    booleantrue if this is an ad-hoc payment; false if scheduled.
  • IsCredit
    booleantrue if this is a credit payment.
  • ReasonCode
    integer (0–8)BACS reason code if the payment was returned unpaid.
  • ReasonMessage
    stringPlain-text explanation of the ReasonCode.
  • Status
    stringPossible values: Paid, Pending, Represented, Unpaid, Withdrawn, Indemnity ClaimedCurrent status of the payment.
  • Type
    stringType of payment (e.g. BACS or Manual).
}
403ForbiddenForbidden - payment contract is protected
404Not FoundPayment not found
Example request
Endpoint
GET /client/{clientCode}/contract/{contractId}/payment/{paymentId}
cURL
curl -L -g -X GET 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/payment/{paymentId}' -H 'apiKey: {apiKey}'
Response
HTTP/1.1 200 OK

{
  "Amount": 15.99,
  "Comment": "This is a test",
  "Date": "2017-05-15T00:00:00.000Z",
  "Id": "36bb4f4f-9a7f-4ead-82dc-9295c6fb9e8b",
  "IsAdhoc": true,
  "IsCredit": false,
  "ReasonCode": "0,",
  "Status": "Pending",
  "Type": "BACS"
}
HTTP/1.1 403 Forbidden

{
  "Message": "Payment cannot be accessed"
}
HTTP/1.1 404 Not Found

{
  "Message": "Payment not found"
}
PATCH/client/{clientCode}/contract/{contractId}/payment/{paymentId}Amends an existing payment in the database#
description:

Amends an existing payment in the database

authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema directDebit/path/client-contract-payment
{
  • clientCode
    string (≤ 6 chars)MandatoryThe client code provided in your welcome email.
  • contractId
    string (guid)MandatoryThe contract GUID on which the payment you are amending has been lodged.
  • paymentId
    string (guid)MandatoryThe payment GUID of the payment you wish to amend.
}
query parameters:
{
  • comment
    string (≤ 255 chars)MandatoryA comment that can be returned when querying the payment.
  • amount
    float (decimal places ≤ 2)MandatoryThe amount you wish to change the payment to.
  • date
    string (date-time)MandatoryThe date on which you require the payment to be taken. Format: YYYY-MM-DDT00:00:00.000
}
request body:

{} — This call takes no request body — send an empty JSON object.

Responses

200OK
response body:
{
  • Message
    stringConfirms the payment has been updated.
}
400Bad RequestBad request - invalid arguments
403ForbiddenForbidden - payment contract is protected
404Not FoundPayment not found
Example request
Endpoint
PATCH /client/{clientCode}/contract/{contractId}/payment/{paymentId}
Request body
{}
cURL
curl -L -g -X PATCH 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/payment/{paymentId}?amount=10.00&date=2019-08-01&comment=Test comment' -H 'apiKey: {apiKey}'
Response
HTTP/1.1 200 OK

{
  "Message": "Payment updated"
}
HTTP/1.1 400 Bad Request

{
  "Message": "An amount, comment or date must be passed"
}
HTTP/1.1 403 Forbidden

{
  "Message": "Payment cannot be accessed"
}
HTTP/1.1 404 Not Found

{
  "Message": "Payment not found"
}