Direct Debit
Adding/Querying Payments
Lodge ad-hoc payments against a contract, and query the payments already held against it.
GET/client/{clientCode}/contract/{contractId}/paymentQueries the database and returns details of payments related to the specified contract#
description:
Queries the database and returns details of payments related to the specified contract
authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema
directDebit/path/client-contract{
- clientCode
- contractId
}
query parameters:
{
- rows
}
Responses
200OK
response body:
{
- Payments [ {
- Amount
- Comment
- Date
- Id
- IsAdhoc
- IsCredit
- ReasonCode
- ReasonMessage
- Status
- Type
} ]
}
403ForbiddenForbidden - contract is protected
404Not FoundContract not found
Example request
Endpoint
GET /client/{clientCode}/contract/{contractId}/paymentcURL
curl -L -g -X GET 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/payment' -H 'apiKey: {apiKey}'Response
HTTP/1.1 200 OK
{
"Payments": [
{
"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": "Contract cannot be accessed"
}HTTP/1.1 404 Not Found
{
"Message": "Contract not found"
}POST/client/{clientCode}/contract/{contractId}/paymentAdds a payment to the database to the contract specified in the URL#
description:
Adds a payment to the database to the contract specified in the URL
authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema
directDebit/path/client-contract{
- clientCode
- contractId
}
query parameters:
{
- amount
- date
- comment
- isCredit
}
request body:
{
- Amount
- Comment
- Date
- IsCredit
}
Responses
200OK
response body:
{
- Amount
- Contract
- DueDate
- Error
- Id
- Message
}
400Bad RequestBad request - invalid payment amount
403ForbiddenForbidden - contract is protected
404Not FoundContract not found
Example — query parameters
Endpoint
POST /client/{clientCode}/contract/{contractId}/paymentcURL
curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/payment?amount=10.00&date=2019-08-01&comment=A comment' \
-H 'apiKey: {apiKey}'Response
HTTP/1.1 200 OK
{
"Amount": 15.99,
"Contract": "b3c17b6f-9ad2-4fa3-9a33-8a8f6813ab1f",
"DueDate": "2017-05-15T00:00:00.000Z",
"Id": "1b2ac277-5f1f-424a-b55f-323d5bcef8f6"
}HTTP/1.1 400 Bad Request
{
"Message": "Amount must be greater than zero"
}HTTP/1.1 403 Forbidden
{
"Message": "Contract cannot be accessed"
}HTTP/1.1 404 Not Found
{
"Message": "Contract not found"
}Example — request body
Endpoint
POST /client/{clientCode}/contract/{contractId}/paymentRequest body
{
"Amount": 10.0,
"Comment": "A comment.",
"Date": "2019-08-01T00:00:00.000",
"IsCredit": false
}cURL
curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/payment' \
-H 'Content-Type: application/json' \
-H 'apiKey: {apiKey}' \
-d '{"Amount":10.0,"Comment":"A comment.","Date":"2019-08-01T00:00:00.000","IsCredit":false}'Response
HTTP/1.1 200 OK
{
"Amount": 15.99,
"Contract": "b3c17b6f-9ad2-4fa3-9a33-8a8f6813ab1f",
"DueDate": "2017-05-15T00:00:00.000Z",
"Id": "1b2ac277-5f1f-424a-b55f-323d5bcef8f6"
}HTTP/1.1 400 Bad Request
{
"Message": "Amount must be greater than zero"
}HTTP/1.1 403 Forbidden
{
"Message": "Contract cannot be accessed"
}HTTP/1.1 404 Not Found
{
"Message": "Contract not found"
}