Direct Debit
Patches
On regularly scheduled contracts, patches can be used to make temporary changes to the payments generated, or stop them from generated. Patches can not be applied to ad-hoc contracts. We offer four different types of patches:
Change amountFreeze collect (leave contract as is)Give notice (terminate contract)Skip collection
Please note that for Give notice (terminate contract) patches, we allow GET, PATCH and
DELETE requests for, but we do not allow to be created via the API. To add a give notice
patch, you must do this via the admin UI.
POST/client/{clientCode}/contract/{contractId}/patch/changeamountAdds a patch to change payment amount for a contract#
description:
Adds a patch to change payment amount for a contract
authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema
directDebit/path/client-contract{
- clientCode
- contractId
}
query parameters:
{
- from
- to
- amount
- comment
}
request body:
{
- Comment
- From
- To
- Amount
}
Responses
200OK
response body:
{
- Message
}
400Bad RequestBad Request - Overlapping patches
404Not FoundContract not found
Example — query parameters
Endpoint
POST /client/{clientCode}/contract/{contractId}/patch/changeamountcURL
curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/patch/changeamount?from=2021-12-05T00%3A00%3A00&to=2021-12-15T00%3A00%3A00&amount=9.99&comment=Price+increase' \
-H 'apiKey: {apiKey}'Response
HTTP/1.1 200 OK
{
"Message": "New Patch added to contract"
}HTTP/1.1 400 Bad Request
{
"Detail": "This Patch overlaps with an existing Patch for the same Contract. Please check dates.",
"ErrorCode": 3,
"Message": "Validation error"
}HTTP/1.1 404 Not Found
{
"error": "The requested resource is not found"
}Example — request body
Endpoint
POST /client/{clientCode}/contract/{contractId}/patch/changeamountRequest body
{
"Comment": "Price increase",
"From": "2021-12-05T00:00:00",
"To": "2021-12-15T00:00:00",
"Amount": 9.99
}cURL
curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/patch/changeamount' \
-H 'Content-Type: application/json' \
-H 'apiKey: {apiKey}' \
-d '{"Comment":"Price increase","From":"2021-12-05T00:00:00","To":"2021-12-15T00:00:00","Amount":9.99}'Response
HTTP/1.1 200 OK
{
"Message": "New Patch added to contract"
}HTTP/1.1 400 Bad Request
{
"Detail": "This Patch overlaps with an existing Patch for the same Contract. Please check dates.",
"ErrorCode": 3,
"Message": "Validation error"
}HTTP/1.1 404 Not Found
{
"error": "The requested resource is not found"
}POST/client/{clientCode}/contract/{contractId}/patch/skipAdds a patch to skip collections for a contract#
description:
Adds a patch to skip collections for a contract
authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema
directDebit/path/client-contract{
- clientCode
- contractId
}
query parameters:
shared schema
directDebit/patch-window{
- Comment
- From
- To
}
request body:
shared schema
directDebit/patch-window{
- Comment
- From
- To
}
Responses
200OK
response body:
{
- Message
}
400Bad RequestBad Request - Overlapping patches
404Not FoundContract not found
Example — query parameters
Endpoint
POST /client/{clientCode}/contract/{contractId}/patch/skipcURL
curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/patch/skip?from=2021-12-05T00%3A00%3A00&to=2021-12-15T00%3A00%3A00&comment=Payment+pause' \
-H 'apiKey: {apiKey}'Response
HTTP/1.1 200 OK
{
"Message": "New Patch added to contract"
}HTTP/1.1 400 Bad Request
{
"Detail": "This Patch overlaps with an existing Patch for the same Contract. Please check dates.",
"ErrorCode": 3,
"Message": "Validation error"
}HTTP/1.1 404 Not Found
{
"error": "The requested resource is not found"
}Example — request body
Endpoint
POST /client/{clientCode}/contract/{contractId}/patch/skipRequest body
{
"Comment": "Payment pause",
"From": "2021-12-05T00:00:00",
"To": "2021-12-15T00:00:00"
}cURL
curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/patch/skip' \
-H 'Content-Type: application/json' \
-H 'apiKey: {apiKey}' \
-d '{"Comment":"Payment pause","From":"2021-12-05T00:00:00","To":"2021-12-15T00:00:00"}'Response
HTTP/1.1 200 OK
{
"Message": "New Patch added to contract"
}HTTP/1.1 400 Bad Request
{
"Detail": "This Patch overlaps with an existing Patch for the same Contract. Please check dates.",
"ErrorCode": 3,
"Message": "Validation error"
}HTTP/1.1 404 Not Found
{
"error": "The requested resource is not found"
}POST/client/{clientCode}/contract/{contractId}/patch/freezeAdds a patch to freeze collections for a contract#
description:
Adds a patch to freeze collections for a contract
authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema
directDebit/path/client-contract{
- clientCode
- contractId
}
query parameters:
shared schema
directDebit/patch-window{
- Comment
- From
- To
}
request body:
shared schema
directDebit/patch-window{
- Comment
- From
- To
}
Responses
200OK
response body:
{
- Message
}
400Bad RequestBad Request - Overlapping patches
404Not FoundContract not found
Example — query parameters
Endpoint
POST /client/{clientCode}/contract/{contractId}/patch/freezecURL
curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/patch/freeze?from=2021-12-05T00%3A00%3A00&to=2021-12-15T00%3A00%3A00&comment=Payment+freeze' \
-H 'apiKey: {apiKey}'Response
HTTP/1.1 200 OK
{
"Message": "New Patch added to contract"
}HTTP/1.1 400 Bad Request
{
"Detail": "This Patch overlaps with an existing Patch for the same Contract. Please check dates.",
"ErrorCode": 3,
"Message": "Validation error"
}HTTP/1.1 404 Not Found
{
"error": "The requested resource is not found"
}Example — request body
Endpoint
POST /client/{clientCode}/contract/{contractId}/patch/freezeRequest body
{
"Comment": "Payment freeze",
"From": "2021-12-05T00:00:00",
"To": "2021-12-15T00:00:00"
}cURL
curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/patch/freeze' \
-H 'Content-Type: application/json' \
-H 'apiKey: {apiKey}' \
-d '{"Comment":"Payment freeze","From":"2021-12-05T00:00:00","To":"2021-12-15T00:00:00"}'Response
HTTP/1.1 200 OK
{
"Message": "New Patch added to contract"
}HTTP/1.1 400 Bad Request
{
"Detail": "This Patch overlaps with an existing Patch for the same Contract. Please check dates.",
"ErrorCode": 3,
"Message": "Validation error"
}HTTP/1.1 404 Not Found
{
"error": "The requested resource is not found"
}GET/client/{clientCode}/contract/{contractId}/patchesReturns all patches applied to a given contract#
description:
Returns all patches applied to a given contract
authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema
directDebit/path/client-contract{
- clientCode
- contractId
}
Responses
200OK
response body:
{
- Patches [ {
- Amount
- Comment
- DateAdded
- DateFrom
- DateTo
- Id
- Type
} ]
}
404Not FoundContract not found
Example request
Endpoint
GET /client/{clientCode}/contract/{contractId}/patchescURL
curl -L -g -X GET 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/patches' \
-H 'apiKey: {apiKey}'Response
HTTP/1.1 200 OK
{
"Patches": [
{
"Id": "bd686494-2b90-47b4-95f9-e88568aeb49f",
"DateAdded": "2021-11-25T14:32:49",
"Type": "Change amount",
"DateFrom": "2021-12-15T00:00:00",
"DateTo": "2021-12-25T00:00:00",
"Amount": 11,
"Comment": "Price increase"
},
{
"Id": "769f959c-57b2-4c7e-82c5-8179b9094c7e",
"DateAdded": "2021-11-25T14:34:14",
"Type": "Skip collection (adjusts contract)",
"DateFrom": "2021-12-25T00:00:00",
"DateTo": "2022-01-05T00:00:00",
"Amount": null,
"Comment": "Payment pause"
},
{
"Id": "a4642e6c-75c3-4439-9474-c073925eb47c",
"DateAdded": "2021-11-25T14:38:08",
"Type": "Freeze collect (leave contract as is)",
"DateFrom": "2022-01-10T00:00:00",
"DateTo": "2022-01-15T00:00:00",
"Amount": null,
"Comment": "Payment pause 2"
}
]
}HTTP/1.1 404 Not Found
{
"error": "The requested resource is not found"
}GET/client/{clientCode}/contract/{contractId}/patch/{patchId}Gets details of a specific patch#
description:
Gets details of a specific patch
authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema
directDebit/path/client-contract-patch{
- clientCode
- contractId
- patchId
}
Responses
200OK
response body:
{
- Amount
- Comment
- DateAdded
- DateFrom
- DateTo
- Id
- Type
}
404Not FoundContract/patch not found
Example request
Endpoint
GET /client/{clientCode}/contract/{contractId}/patch/{patchId}cURL
curl -L -g -X GET 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/patch/{patchId}' \
-H 'apiKey: {apiKey}'Response
HTTP/1.1 200 OK
{
"Id": "bd686494-2b90-47b4-95f9-e88568aeb49f",
"DateAdded": "2021-11-25T14:32:49",
"Type": "Change amount",
"DateFrom": "2021-12-15T00:00:00",
"DateTo": "2021-12-25T00:00:00",
"Amount": 11,
"Comment": "Price increase"
}HTTP/1.1 404 Not Found
{
"ErrorCode": 0,
"Detail": null,
"Message": "Patch not found"
}PATCH/client/{clientCode}/contract/{contractId}/patch/{patchId}Updates the end date of a patch#
description:
Updates the end date of a patch
authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema
directDebit/path/client-contract-patch{
- clientCode
- contractId
- patchId
}
query parameters:
{
- to
- comment
}
request body:
{
- To
- Comment
}
Responses
200OK
response body:
{
- Message
}
400Bad RequestBad Request - Invalid To date
404Not FoundContract/patch not found
Example — query parameters
Endpoint
PATCH /client/{clientCode}/contract/{contractId}/patch/{patchId}cURL
curl -L -g -X PATCH 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/patch/{patchId}?to=2021-12-25T00%3A00%3A00&comment=Extended+patch' \
-H 'apiKey: {apiKey}'Response
HTTP/1.1 200 OK
{
"Message": "Patch updated"
}HTTP/1.1 400 Bad Request
{
"ErrorCode": 3,
"Detail": "To date should be greater than From Date. Please check patch dates",
"Message": "Validation error"
}HTTP/1.1 404 Not Found
{
"ErrorCode": 0,
"Detail": null,
"Message": "Patch not found"
}Example — request body
Endpoint
PATCH /client/{clientCode}/contract/{contractId}/patch/{patchId}Request body
{
"To": "2021-12-15T00:00:00.000",
"Comment": "Extend patch"
}cURL
curl -L -g -X PATCH 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/patch/{patchId}' \
-H 'Content-Type: application/json' \
-H 'apiKey: {apiKey}' \
-d '{"To":"2021-12-15T00:00:00.000","Comment":"Extend patch"}'Response
HTTP/1.1 200 OK
{
"Message": "Patch updated"
}HTTP/1.1 400 Bad Request
{
"ErrorCode": 3,
"Detail": "To date should be greater than From Date. Please check patch dates",
"Message": "Validation error"
}HTTP/1.1 404 Not Found
{
"ErrorCode": 0,
"Detail": null,
"Message": "Patch not found"
}DELETE/client/{clientCode}/contract/{contractId}/patch/{patchId}Deletes a patch#
description:
Deletes a patch
authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema
directDebit/path/client-contract-patch{
- clientCode
- contractId
- patchId
}
Responses
200OK
response body:
{
- Message
}
404Not FoundContract/patch not found
Example request
Endpoint
DELETE /client/{clientCode}/contract/{contractId}/patch/{patchId}cURL
curl -L -g -X DELETE 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/patch/{patchId}' \
-H 'apiKey: {apiKey}'Response
HTTP/1.1 200 OK
{
"Message": "Patch deleted"
}HTTP/1.1 404 Not Found
{
"ErrorCode": 0,
"Detail": null,
"Message": "Patch not found"
}