Direct Debit

Restart a Contract

Restarting a contract is fundamentally different to reactivating a contract as it can only be performed if two criteria have been met:

  • The original contract was a fixed term contract which has “Expire” as its “atTheEnd” parameter.
  • The payment schedule has come to a natural end and the contract status has changed to “Expired”.

This call adds a new contract onto the end of the previous contract, in effect “recycling” the previous direct debit at the bank which can save on direct debit set up charges. This call cannot be used unless both of the two criteria above have been met, otherwise unexpected results may occur.

POST/client/{clientCode}/contract/{contractId}/restartReactivates the Direct Debit if it is in the Expired state and payments have already come to an end#
description:

Reactivates the Direct Debit if it is in the Expired state and payments have already come to an end

authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema directDebit/path/client-contract
{
  • clientCode
    string (≤ 6 chars)MandatoryThe client code provided in your welcome email.
  • contractId
    string (guid)MandatoryThe contract GUID that you wish to restart.
}
query parameters:
{
  • paymentDayInMonth
    integerPossible values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 99If the contract is for regular payments, then the day on which you wish the first payment should be passed with this parameter. NOTE: *You may not* select days 29, 30 or 31 of the month; if you wish to select the last day of the month; pass the integer value 99 which represent Last day of the Month. This field is only mandatory if the contract is not an ad-hoc contract. This field is only mandatory if the contract is annual or monthly. You may only select days 1 to 28 or “Last day of the month” which is equal with value 99. Choosing 29, 30 or 31 will result in payments being skipped in months that do not contain that date.
  • paymentMonthInYear
    integer (min 1, max 12)If the contract is for regular payments then the month in which you wish the first payment should be passed with this parameter. This field is only mandatory if the contract is not an ad-hoc contract. This field is only mandatory if the contract is annual or monthly.
  • terminationType
    stringMandatoryPossible values: Take certain number of debits, Until further notice, End on exact datePass the way in which the contract should end using this parameter. If the contract is ad-hoc, you must pass Until further notice.
  • numberOfDebits
    integer (min 0, max 999)If this is a “Take certain Number of Debits” contract then the number of debits to be taken should be passed using this parameter. This field is only mandatory if the termination type is “Take Certain Number of Debits”.
  • initialAmount
    float (decimal places ≤ 2)If this is a contract for regular payments and the first payment is different to the regular payments, then pass the first payment amount with this parameter. Do not pass this parameter with ad-hoc contracts, or where the first amount is the same as the regular amount.
  • amount
    float (decimal places ≤ 2)If the contract is for regular payments, then the regular payment amount should be passed using this parameter. Do not pass this parameter if the contract is an ad-hoc contract. This field is only mandatory if the contract is not an ad-hoc contract.
  • finalAmount
    float (decimal places ≤ 2)If this is a contract for regular payments and the final payment is different to the regular payments, then pass the final payment amount with this parameter. Do not pass this parameter with ad-hoc contracts, or where the final amount is the same as the regular amount.
  • atTheEnd
    stringMandatoryPossible values: Expire, Switch to Further NoticeThis parameter decides what will happen when the contract ends. If you have selected a terminationType of Until Further Notice or the contract is an ad-hoc contract, you must pass Switch to Further Notice.
  • additionalReference
    string (≤ 200 chars)If you wish to add an additional reference to the contract for you own use, this can be passed to using the additionalReference parameter.
}
request body:

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

Responses

200OK
response body:
{
  • Message
    stringConfirms the operation.
}
400Bad RequestBad request - invalid restart date
403ForbiddenForbidden - contract is protected
404Not FoundContract not found
Example request
Endpoint
POST /client/{clientCode}/contract/{contractId}/restart
Request body
{}
cURL
curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/restart?terminationType=Until further notice&atTheEnd=Switch to further notice' -H 'apiKey: {apiKey}'
Response
HTTP/1.1 200 OK

{
  "Message": "Contract restarted"
}
HTTP/1.1 400 Bad Request

{
  "Message": "Start date must be greater than {minStartDate}\n"
}
HTTP/1.1 403 Forbidden

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

{
  "Message": "Contract not found"
}