swagger: "2.0" info: description: > **NOTICE:** The hosts for the API are now located at `ddcms.accesspaysuite.com` and `playpen.accesspaysuite.com`, instead of `ecm3.eazycollect.co.uk` and `playpen.eazycollect.co.uk` respectively. While the old URLs will continue to work as normal, and although there's no plans currently to disable these URLs, we would strongly recommend you update your integration to call the new URLs. **NOTICE:** The URL hosting this documentation has now been updated to https://api-docs-ddcms-v3.accesspaysuite.com We strongly encourage all of our customers to actively change to using this new link. Connections to the current site https://eazycollectservices.github.io/EazyCollectAPIv3/ will automatically redirect to https://api-docs-ddcms-v3.accesspaysuite.com. However, we only intend to maintain this automatic redirect across a transitional period, so please ensure you update your bookmarks and links as soon as possible. ## About Access Paysuite Access PaySuite is a leading provider of payment solutions to mid-sized UK organisations. Part of The Access Group, it combines payments expertise with unparalleled SaaS experience to help customers across commercial and not for profit sectors improve their payment solutions, providing organisations with the freedom to accelerate their innovation and growth. For more information about Access PaySuite, visit www.accesspaysuite.com Our Collection Services are based around our Direct Debit and Credit Management System (DDCMS) application which manages the Direct Debit process from beginning to end and is connected to a robust and powerful BACS submission engine. The system also provides a range of management information via the easy to use secure web interface. ## API Technical Details The API is REST based and communication is conducted over a regular HTTPS connection. It accepts input in the `x-www-form-urlencoded` format with output being provided in either JSON or XML format as required. The output is selected using the `Accept` header including either `application/json` or `application/xml`. The API key should be also be specified in the request using the `apiKey` header. Our API uses four different HTTP methods to indicate the different operations being undertaken on the data being manipulated. These are: |**Method** | **Operation** | -------------- | -------------- | **HTTP GET** | Request for information from the server. The server will respond with the data requested. | **HTTP POST** | Request to create a record on the server. The POST request must be accompanied by the relevant data in the body or query string as dictated by the specification below. | **HTTP PATCH** | Request to amend (or partially amend) the record on the server. | **HTTP DELETE**| A request to remove a record from the server (only available on the client return data endpoint call). ### Example Headers for JSON Mode: ``` GET https://ddcms.accesspaysuite.com/api/v3/client/LUISCT/BACS/customer/callback Accept: application/json apiKey: xAQdXTPtZPG3QqsUJw73wx1o Content-Type: application/json ``` ## The Direct Debit Process Throughout the development of our API we have sought to simplify the Direct Debit process as much as possible, however due to the technical nature of Direct Debits it is helpful to understand the general data flow and the reasons for certain time delays. For additional information about the time delays required when setting up new Direct Debit contracts or ad-hoc collections, please see "*A note on Working Days*". 1. After creating a ‘Customer’ record on our system, you will need to assign a ‘schedule’ to them. The schedule can take a number of forms: - A schedule that can collect ad-hoc payments as and when you request them via the API. There will usually be date restrictions in place. - A schedule where you ask us to collect regular amounts on regular dates in a month, or days in a week as per your requirements. - A schedule where a pre-determined amount is taken on regular dates in a month, or days in a week as per your instructions. - A schedule where the collection amounts and or dates are fixed. Access Paysuite creates the schedules as part of the set-up process and the available schedules can be listed by using the ‘schedules’ call. 2. As soon as a schedule is applied to a customer record, we send an instruction to BACS to create the Direct Debit instruction. The date for the first payment required should be set at least your SUN's configured *First Payment Delay* after the schedule creation date. 3. Ad-hoc payments need to be lodged onto *DDCMS* at least your SUN's configured *Subsequent Payment Delay* before the collection date. 4. Around three working days before the collection date, we submit the payments to BACS for collection. Payments cannot be changed after submission has occurred. 5. The final status of the payment records can be enquired upon 3 working days following the collection date. Where a payment collection date falls on a weekend or a non UK banking day, the collection date is automatically moved to the next working day, and the developer will need to take this into account. (e.g.: A payment scheduled on Saturday, 1st June 2013 will be collected on Monday 3rd June 2013. Payment statuses will be available from Thursday 6th June 2013.) ## A note on Working Days Regarding these time delays, you will see mention of two particular delays that need to be considered, particularly when adding new Direct Debit contracts or ad-hoc payments: - **First Payment Delay:** Default is **10 working days** but can be as low as **5**. - **Subsequent Payment Delay:** Default is **5 working days** but can be as low as **3**. If you wish to lower these delays whilst testing the API in our playpen, please raise a support case. Requests to lower delays on a live account should be raised with your Customer Success Manager or sales contact. Note that it may not be possible for us to change your account's configured delays. We ask that our clients that their First Payment Delay is the **absolute minimum** between creating a customer and contract and collecting the first payment. Payments for existing contracts must be submitted and confirmed by 12pm the Subsequent Payment Delay before the collection date for existing customers with an active Direct Debit. We strongly recommend that customers are created and payments uploaded 1 -2 days in advance of these cut off times as these deadlines leave **no** contingency to problem solve any issues that arise which could lead to payments being missed. **It is important to note** that if a collection date falls on a weekend or a bank holiday, then the delay rules start from the following working day; so for a Saturday or a Sunday, the number of working days to delay should be counted back from the next non-UK bank holiday Monday. **For example:** Assuming **First Payment Delay** = **10 working days** and **Subsequent Payment Delay** = **5 working days** For payments due on Saturday 19/04/2025 - Payments for existing customers would need to be submitted and confirmed by 12pm on Monday 14/04/2025. - New customers would need to be confirmed by 12pm on Monday 07/04/2025. **Note:** 18/04/2025 (Good Friday) and 21/04/2025 (Easter Monday) are Bank Holidays in the UK and do not count as banking days. To view the deadlines for lodging collections for new and existing customers for any given collection date, please see our **Date Calculator** at https://www.accesspaysuite.com/date. Alternatively, see the `GET /paymentdate` API call available under **Payment Dates** to see the earliest possible dates for first and subsequent payments. ## Using the API and UI together DDCMS provides a useful User Interface (UI) available via your browser which gives access to your customer data and a suite of reports. If you have chosen to do a “full integration” with your own Customer Relationship Management or Accounting software, then it must be borne in mind that your software is driving the payment process entirely. In “full integration” mode you will be using the API to set up direct debits and send ad-hoc payments as and when collections are required; in this arrangement we generally advise against using the UI other than to download paid/unpaid reports. It is important to note that when using the API in a “full integration” the following anomalies will be present within the UI: - The account and arrears balances shown in the Access Paysuite UI against each customer will not reflect manual payments made in your CRM/Accounts package unless they are also (double) keyed as manual payments onto the DDCMS UI. If you require any further assistance with using the API and UI together, please contact the IT Helpdesk at support@accesspaysuite.com ## Errors The API uses standard HTTP status codes to indicate the success or failure of an API call. The error body provided will be either JSON or XML format per the preference included within the headers. Due to the complexity of the API and the Direct Debit Scheme, we are unable to provide a definitive list of all the errors that the system may generate, however we have attempted to make the errors generated as clear as possible – i.e. Plain English. We also recommend using the panels on the right hand side to get aquainted with the HTTP status codes the API may return. **Examples:** **JSON:** ```json { "Message": "The requested resource does not support http method 'POST'." } ``` **XML:** ```xml The requested resource does not support http method 'POST'. ``` ## Environments We offer two environments to developers, `playpen` and `ddcms`. Our `playpen` environment is designed for all your testing needs. Our `ddcms` environment is our production environment and we strongly recommend using the `playpen` environment to get acquainted with how the API functions and returns data. If you would like access to our `playpen` environment, please contact our sales team at `sales@accesspaysuite.com`. The two environments behave identically, with the only difference being how you would access an environment. All requests to our production environment would go through `ddcms.accesspaysuite.com` whereas requests for our playpen environment would go through `playpen.accesspaysuite.com`. contact: email: support@accesspaysuite.com license: name: MIT url: >- https://github.com/EazyCollectServices/EazyCollectAPIv3/blob/master/LICENSE title: Access Paysuite version: 3.0.0 x-logo: backgroundColor: "#4b112c" url: "https://www.accesspaysuite.com/media/iwwhai0a/paysuite-logo.png" host: "ddcms.accesspaysuite.com" basePath: "/api/v3" schemes: - https paths: "/client/{clientCode}/BACS/{entity}/callback": delete: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The entity for which to receive callback BACS messages. enum: - bulkpayment - customer - contract - payment - schedule in: path name: entity required: true type: string responses: "200": description: OK examples: application/json: schema: example: Message: Callback URL cleared. type: string application/xml: |- Callback URL cleared. tags: - Return Endpoints description: Clears the set callback URL for the specified entity. summary: Clears the set callback URL for the given return endpoint x-codeSamples: - lang: C# source: > var delete = new Delete(settings); string request = delete.CallbackUrl("contract"); - lang: Python source: > client = eazysdk.EazySDK() request = client.delete.callback_url("contract") - lang: Java source: > Delete delete = new Delete(settings); String request = delete.callbackUrl("contract"); - lang: cURL source: > curl -L -g -X DELETE 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/BACS/contract/callback' -H 'apiKey: {apiKey}' get: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The entity for which to receive callback BACS messages. enum: - bulkpayment - customer - contract - payment - schedule in: path name: entity required: true type: string responses: "200": description: OK examples: application/json: Message: "https://my.website.com/webhook" application/xml: >- https://my.website.com/webhook "401": description: Unauthorised - API not enabled or API key incorrect examples: application/json: Message: API not enabled application/xml: |- API not enabled7 "404": description: Not found - Client code incorrect examples: application/json: ErrorCode: 7 Message: API not enabled application/xml: >- API not enabled7 "405": description: API key not provided examples: application/json: Message: The requested resource does not support http method 'POST'. application/xml: >- The requested resource does not support http method 'POST'. tags: - Return Endpoints description: Returns the assigned callback URL for the specified entity. summary: Get the callback URL for the given return endpoint x-codeSamples: - lang: C# source: > var get = new Get(settings); string response = get.CallbackUrl("contract"); - lang: Python source: > client = eazysdk.EazySDK() response = client.get.callback_url("contract") - lang: Java source: > Get get = new Get(settings); String response = get.callbackUrl("contract"); - lang: cURL source: > curl -L -g -X GET 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/BACS/contract/callback' -H 'apiKey: {apiKey}' post: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The entity for which to receive callback BACS messages. enum: - bulkpayment - customer - contract - payment - schedule in: path name: entity required: true type: string - description: New value for the callback URL. format: url in: query name: url required: true type: string responses: "200": description: OK examples: application/json: Message: Callback URL assigned. application/xml: >- Callback URL assigned. tags: - Return Endpoints description: Sets the callback URL for the specified entity. summary: Sets the callback URL for the given return endpoint x-codeSamples: - lang: C# source: > var post = new Post(settings); string request = post.CallbackUrl("contract", "https://my.website.com/webhook"); - lang: Python source: > client = eazysdk.EazySDK() request = client.post.callback_url(entity="contract", callback_url="https://my.website.com/webhook") - lang: Java source: > Post post = new Post(settings); String request = post.callbackUrl("contract", "https://my.website.com/webhook"); - lang: cURL source: > curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/BACS/contract/callback?url=https://my.website.com/webhook' -H 'apiKey: {apiKey}' "/client/{clientCode}/info": get: produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string responses: "200": description: OK schema: properties: CustomerEmailMandatory: type: boolean description: Whether or not the `email` parameter is required when adding new customer records. examples: application/json: CustomerEmailMandatory: true tags: - Client Info description: Retrieve configuration info about your DDCMS client. summary: Retrieve configuration info about your DDCMS client. "/client/{clientCode}/payments": post: produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: Example JSON payload format. in: body name: body required: true schema: $ref: "#/definitions/ClientListPaymentsRequest" responses: "200": description: OK - Paginated list of payments returned. Empty Data array if no matches. Sorted by createdAt descending. schema: properties: Pagination: type: object properties: Page: description: Page number for the pagination. type: number PageSize: description: Number of payment records to return per page. type: number TotalPages: description: Total number of pages returned by the search. type: number TotalRecords: description: Total number of payment records returned by the search. type: number Data: type: array items: $ref: "#/definitions/Payment" "400": description: Bad Request - {specific error message} e.g. invalid status/type value, pageSize exceeds configured maximum. "403": description: Forbidden - This contract cannot be used in API. When contract is protected. "500": description: Internal Server Error - An unexpected error occurred while processing the request. tags: - Client Info description: List all payments registered against your DDCMS client. summary: List all payments registered against your DDCMS client. "/client/{clientCode}/bulk/payments": post: consumes: - application/json - application/xml produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: > The payments to be processed. in: body name: body required: true schema: $ref: "#/definitions/BulkPaymentRequest" example: Payments: - amount: 1.1 comment: "Up to 256 characters, optional" contract: GUID date: "YYYY-MM-DDT00:00:00.000" isCredit: false - amount: 1.1 comment: "Up to 256 characters, optional" contract: GUID date: "YYYY-MM-DDT00:00:00.000" isCredit: false type: object responses: "200": description: OK schema: properties: FailureCount: type: number description: Number of payment requests that failed to push to the queue. Failures: type: array items: $ref: "#/definitions/BulkPayment" description: Array of payment requests that failed to push to the queue. IsSuccessfull: type: boolean description: Returns `true` if all requests were successfully submitted to the queue for processing, otherwise `false`. Duration: type: string description: The length of time it took to submit the payments. Message: type: string description: Returns `All payments are in queue for process` if Failures is empty, otherwise returns `Not all payments are in queue, please resend failures at a later time`. examples: application/json: FailureCount: 0 Failures: [] IsSuccessfull: true Message: All payments are in queue for process application/xml: > 0 true All payments are in queue for process "400": description: Bad request - no payments examples: application/json: ErrorCode: 2 Detail: No payments found in request Message: Parameter arguments incorrect application/xml: | 2 No payments found in request Parameter arguments incorrect tags: - Bulk Adding Payments summary: Sends a list of payment requests to a queue to be processed in bulk. x-codeSamples: - lang: cURL sample: > curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/bulk/payments' -H 'apiKey: {apiKey}' -H 'Content-Type: application/json' --data-raw '{ "Payments": [ { "contract": "1802e1dd-a657-428c-b8d0-ba162fc76203", "amount": 9.99, "date": "2019-08-01T00:00:00.000", "comment": "New payment", "isCredit": false } ] }' "/client/{clientCode}/contract/{contractId}/amount": patch: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID that you wish to amend. format: guid in: path name: contractId required: true type: string - description: The new amount to be taken. in: query multipleOf: 0.01 name: amount required: true type: number - description: A comment to explain the reason for the change of amount. in: query maxLength: 255 name: comment required: true type: string responses: "200": description: OK examples: application/json: Message: Contract updated application/xml: > Contract updated "400": description: Bad Request examples: application/json: Detail: Amount should be different than old contract amount ErrorCode: 3 Message: Validation error application/xml: | Validation error 3 Amount should be different than old contract amount tags: - Contract Amendment description: Amends an existing contract amount in the database. summary: Changing the Amount x-codeSamples: - lang: C# name: C# (EazySDK) source: > var patch = new Patch(settings); string request = patch.ContractAmount("1802e1dd-a657-428c-b8d0-ba162fc76203", "9.99", "Change contract amount"); - lang: Python name: Python (EazySDK) source: > client = eazysdk.EazySDK() request = client.patch.contract_amount('36bb4f4f-9a7f-4ead-82dc-9295c6fb9e8b', 10.50, 'A comment') - lang: Java name: Java (EazySDK) source: > Patch patch = new Patch(settings); String request = patch.contractAmount("1802e1dd-a657-428c-b8d0-ba162fc76203", "9.99", "Change contract amount"); - lang: cURL source: > curl -L -g -X PATCH 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/amount?amount=9.99&comment=Change contract amount' -H 'apiKey: {apiKey}' "/client/{clientCode}/contract/{contractId}/annual": patch: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID that you wish to amend. format: guid in: path name: contractId required: true type: string - description: > The new day of the month on which payments are to be taken. **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 string `Last day of the Month`. Payments will be collected on the next available instance of the payment day, which will be a **minimum** of 5 working days in the future. Any payment already scheduled in the next 5 working days *will still be collected*. enum: - "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" - Last Day of the Month in: query name: monthDay required: true type: string - description: The new month in the year on which the payments are to be taken. in: query maximum: 12 minimum: 1 name: month required: true type: integer - description: A comment to explain the reason for the change of day. in: query maxLength: 255 name: comment required: true type: string - description: > If you wish to take the next payment to be a different amount (e.g. pro rata because the number of days between payments will deb different) then pass the amount using this parameter. Ensure that `patchNextPayment` is set to `true` if you are using this. in: query multipleOf: 0.01 name: nextPaymentPatchAmount type: number - description: | Set to `true` if using `nextPaymentPatchAmount` or `false` if not. in: query name: patchNextPayment required: true type: boolean responses: "200": description: OK examples: application/json: Message: Contract updated application/xml: > Contract updated "400": description: Bad request - invalid day examples: application/json: Message: Month day is invalid for this contract application/xml: | Month day is invalid for this contract tags: - Contract Amendment description: Amends an existing contract payment date in the database. summary: Changing the Date (Annual Schedules) x-codeSamples: - lang: C# name: C# (EazySDK) source: > var patch = new Patch(settings); string request = patch.ContractDayAnnually("1802e1dd-a657-428c-b8d0-ba162fc76203", "15", "1", "Change day", false); - lang: Python name: Python (EazySDK) source: | contract_date_annually('36bb4f4f-9a7f-4ead-82dc-9295c6fb9e8b', 15, 6, 'A comment', False) - lang: Java name: Java (EazySDK) source: > Patch patch = new Patch(settings); String request = patch.contractDayAnnually("1802e1dd-a657-428c-b8d0-ba162fc76203", "15", "1", "Change day", false); - lang: cURL source: > curl -L -g -X PATCH 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/annual?monthDay=15&month=1&comment=Change day&patchNextPayment=false' -H 'apiKey: {apiKey}' "/client/{clientCode}/contract/{contractId}/archive": post: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID that you wish to archive. format: guid in: path name: contractId required: true type: string responses: "200": description: OK examples: application/json: Message: Contract archived application/xml: > Contract archived "403": description: Forbidden - contract is protected examples: application/json: Message: API not enabled application/xml: | API not enabled "404": description: Contract not found examples: application/json: Message: Contract not found application/xml: | Contract not found tags: - Archiving a Contract description: > **NOTE:** It is not possible to “unarchive” a contract once the archive process has been initiated. summary: > Cancels the direct debit, writes off any outstanding arrears balance, cancels future payments and sets the contract status to “archived”. x-codeSamples: - lang: C# name: C# (EazySDK) source: > var post = new Post(settings); string request = post.ArchiveContract("1802e1dd-a657-428c-b8d0-ba162fc76203"); - lang: Python name: Python (EazySDK) source: > client = eazysdk.EazySDK() request = client.post.archive_contract('42217d45-cf22-4430-ab02-acc1f8a2d020') - lang: Java name: Java (EazySDK) source: > Post post = new Post(settings); String request = post.archiveContract("1802e1dd-a657-428c-b8d0-ba162fc76203"); - lang: cURL source: > curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/archive' -H 'apiKey: {apiKey}' "/client/{clientCode}/contract/{contractId}/cancel": post: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID that you wish to cancel the direct debit on. format: guid in: path name: contractId required: true type: string responses: "200": description: OK examples: application/json: Message: Contract cancelled application/xml: > Contract cancelled "403": description: Forbidden - contract is protected examples: application/json: Message: Contract cannot be accessed application/xml: | Contract cannot be accessed "404": description: Contract not found examples: application/json: Message: Contract not found application/xml: | Contract not found tags: - Cancelling the Direct Debit (Does not cancel payment creation) description: > Future payments will be created within our system, but automatically marked as unpaid. summary: Changes the status of the Direct Debit to “Cancelled”. x-codeSamples: - lang: C# name: C# (EazySDK) source: > var post = new Post(settings); string request = post.CancelDirectDebit("1802e1dd-a657-428c-b8d0-ba162fc76203"); - lang: Python name: Python (EazySDK) source: > client = eazysdk.EazySDK() request = client.post.cancel_direct_debit('42217d45-cf22-4430-ab02-acc1f8a2d020') - lang: Java name: Java (EazySDK) source: > Post post = new Post(settings); String request = post.cancelDirectDebit("1802e1dd-a657-428c-b8d0-ba162fc76203"); - lang: cURL source: > curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/cancel' -H 'apiKey: {apiKey}' "/client/{clientCode}/contract/{contractId}/monthly": patch: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID that you wish to amend. format: guid in: path name: contractId required: true type: string - description: > The new day of the month on which payments are to be taken. **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 string `Last day of the Month`. Payments will be collected on the next available instance of the payment day, which will be a **minimum** of 5 working days in the future. Any payment already scheduled in the next 5 working days *will still be collected*. enum: - "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" - Last Day of the Month in: query name: monthDay required: true type: string - description: A comment to explain the reason for the change of day. in: query maxLength: 255 name: comment required: true type: string - description: > If you wish to take the next payment to be a different amount (e.g. pro rata because the number of days between payments will deb different) then pass the amount using this parameter. Ensure that `patchNextPayment` is set to `true` if you are using this. in: query multipleOf: 0.01 name: nextPaymentPatchAmount type: number - description: | Set to `true` if using `nextPaymentPatchAmount` or `false` if not. in: query name: patchNextPayment required: true type: boolean responses: "200": description: OK examples: application/json: Message: Contract updated application/xml: > Contract updated "400": description: Bad request - invalid day examples: application/json: Message: Month day is invalid for this contract application/xml: | Month day is invalid for this contract tags: - Contract Amendment description: Amends an existing contract payment date in the database. summary: Changing the Date (Monthly Schedules) x-codeSamples: - lang: C# name: C# (EazySDK) source: > var patch = new Patch(settings); string request = patch.ContractDayMonthly("1802e1dd-a657-428c-b8d0-ba162fc76203", "15", "Change day", false); - lang: Python name: Python (EazySDK) source: > client = eazysdk.EazySDK() request = client.patch.contract_date_monthly('36bb4f4f-9a7f-4ead-82dc-9295c6fb9e8b', 15, 'A comment', False) - lang: Java name: Java (EazySDK) source: > Patch patch = new Patch(settings); String request = patch.contractDayMonthly("1802e1dd-a657-428c-b8d0-ba162fc76203", "15", "Change day", false); - lang: cURL source: > curl -L -g -X PATCH 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/monthly?monthDay=15&comment=Change day&patchNextPayment=false' -H 'apiKey: {apiKey}' "/client/{clientCode}/contract/{contractId}/payment": get: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID that you wish to query. format: guid in: path name: contractId required: true type: string - description: > The number of payments (rows) you wish to be returned in the response. **Note:** Payments are always returned ordered by `Date` descending, i.e. the most recent payment will be the first item returned. in: query maximum: 100 minimum: 1 name: rows required: true type: integer responses: "200": description: OK examples: application/json: 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 application/xml: | 36bb4f4f-9a7f-4ead-82dc-9295c6fb9e8b Pending false true 15.99 2017-05-15T00:00:00 0 This is a test BACS schema: properties: Payments: items: $ref: "#/definitions/Payment" type: array type: object "403": description: Forbidden - contract is protected examples: application/json: Message: Contract cannot be accessed application/xml: | Contract cannot be accessed "404": description: Contract not found examples: application/json: Message: Contract not found application/xml: | Contract not found tags: - Adding/Querying Payments summary: | Queries the database and returns details of payments related to the specified contract. x-codeSamples: - lang: C# name: C# (EazySDK) source: > var get = new Get(settings); string response = get.Payments("2b62a358-9a1a-4c71-9450-e419e393dcd1"); - lang: Python name: Python (EazySDK) source: > client = eazysdk.EazySDK() response = client.get.payments('ab09362d-f88e-4ee8-be85-e27e1a6ce06a') - lang: Java name: Java (EazySDK) source: > Get get = new Get(settings); String response = get.payments("2b62a358-9a1a-4c71-9450-e419e393dcd1"); - lang: cURL source: > curl -L -g -X GET 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/payment' -H 'apiKey: {apiKey}' post: consumes: - application/json - application/xml produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID that you wish to query. format: guid in: path name: contractId required: true type: string - description: The amount to be collected. in: query multipleOf: 0.01 name: amount type: number - description: > The date on which the payment should be collected. This **must** be at least 5 **working** days in the future, on a permitted date and not before the start date set when creating the contract. **Format: `YYYY-MM-DDT00:00:00.000`** format: date-time in: query name: date type: string - description: > A comment relating to the payment (which can be recalled using the GET method). in: query maxLength: 200 name: comment type: string - description: > If you have an own SUN and you have agreed by prior arrangement with your account manager that you may issue credits, pass `true` with this parameter to issue a credit to the customer. in: query name: isCredit type: boolean - description: > Example JSON/XML payload format. in: body name: body schema: example: Amount: 10.00 Comment: "A comment." Date: "2019-08-01T00:00:00.000" IsCredit: false type: object xml: name: "PaymentRequest" responses: "200": description: OK examples: application/json: Amount: 15.99 Contract: b3c17b6f-9ad2-4fa3-9a33-8a8f6813ab1f DueDate: "2017-05-15T00:00:00.000Z" Id: 1b2ac277-5f1f-424a-b55f-323d5bcef8f6 application/xml: > b3c17b6f-9ad2-4fa3-9a33-8a8f6813ab1f 15.99 2017-05-15T00:00:00 36bb4f4f-9a7f-4ead-82dc-9295c6fb9e8b schema: properties: Amount: description: The amount of the payment. multipleOf: 0.01 type: number Contract: description: > The GUID of the contract to which the payment has been applied. format: guid type: string DueDate: description: The due date (date of collection) of the payment. format: date-time type: string Error: description: "If any error occurs, a message will appear here." type: string Id: description: > The GUID of the payment. We suggest that you save this so that you can easily change or query the payment in future. If you are using pushed return data, this will be included in any payload delivered concerning the payment. format: guid type: string Message: description: > If any additional message from the system is generated, it will appear here (usually null). type: string type: object "400": description: Bad request - invalid payment amount examples: application/json: Message: Amount must be greater than zero application/xml: | Amount must be greater than zero "403": description: Forbidden - contract is protected examples: application/json: Message: Contract cannot be accessed application/xml: | Contract cannot be accessed "404": description: Contract not found examples: application/json: Message: Contract not found application/xml: | Contract not found tags: - Adding/Querying Payments summary: Adds a payment to the database to the contract specified in the URL. x-codeSamples: - lang: C# name: C# (EazySDK) source: > var post = new Post(settings); string request = post.Payment("1802e1dd-a657-428c-b8d0-ba162fc76203", "10.00", "2019-08-01", "A comment"); - lang: Python name: Python (EazySDK) source: > client = eazysdk.EazySDK() request = client.post.payment('42217d45-cf22-4430-ab02-acc1f8a2d020', '10.00', '2019-05-07', 'A new payment') - lang: Java name: Java (EazySDK) source: > Post post = new Post(settings); String request = post.payment("1802e1dd-a657-428c-b8d0-ba162fc76203", "10.00", "2019-08-01", "A comment"); - lang: cURL source: > 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}' "/client/{clientCode}/contract/{contractId}/payment/{paymentId}": delete: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: > The contract GUID on which the payment you are amending has been lodged. format: guid in: path name: contractId required: true type: string - description: | The payment GUID of the payment you wish to amend. format: guid in: path name: paymentId required: true type: string - description: A comment that can be returned when querying the payment. in: query maxLength: 200 name: comment required: true type: string responses: "200": description: OK examples: application/json: Message: Payment deleted application/xml: > Payment deleted "400": description: Bad request - missing comment examples: application/json: Message: Comment must not be empty application/xml: | Comment must not be empty "403": description: Forbidden - payment contract is protected examples: application/json: Message: Payment cannot be accessed application/xml: | Payment cannot be accessed "404": description: Payment not found examples: application/json: Message: Payment not found application/xml: | Payment not found tags: - Payment Manipulation summary: >- Deletes an existing payment from the database (providing it has not yet been submitted to BACS). x-codeSamples: - lang: C# name: C# (EazySDK) source: > var delete = new Delete(settings); string request = delete.Payment("2b62a358-9a1a-4c71-9450-e419e393dcd1", "750f142f-1608-464a-8e34-4b322e703c2c", "A comment"); - lang: Python name: Python (EazySDK) source: > client = eazysdk.EazySDK() request = client.delete.payment('2b62a358-9a1a-4c71-9450-e419e393dcd1', '750f142f-1608-464a-8e34-4b322e703c2c', 'A comment') - lang: Java name: Java (EazySDK) source: > Delete delete = new Delete(settings); String request = delete.payment("2b62a358-9a1a-4c71-9450-e419e393dcd1", "750f142f-1608-464a-8e34-4b322e703c2c", "A comment"); - lang: cURL source: > curl -L -g -X DELETE 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/payment/{paymentId}?comment=A comment' -H 'apiKey: {apiKey}' get: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: > The contract GUID on which the payment you are amending has been lodged. format: guid in: path name: contractId required: true type: string - description: | The payment GUID of the payment you wish to amend. format: guid in: path name: paymentId required: true type: string responses: "200": description: OK examples: application/json: 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 application/xml: | 36bb4f4f-9a7f-4ead-82dc-9295c6fb9e8b Pending false true 15.99 2017-05-15T00:00:00 0 This is a test BACS "403": description: Forbidden - payment contract is protected examples: application/json: Message: Payment cannot be accessed application/xml: | Payment cannot be accessed "404": description: Payment not found examples: application/json: Message: Payment not found application/xml: | Payment not found tags: - Payment Manipulation summary: Queries the database for details of an existing payment. x-codeSamples: - lang: C# name: C# (EazySDK) source: > var get = new Get(settings); string response = get.PaymentsSingle("2b62a358-9a1a-4c71-9450-e419e393dcd1", "6917d51a-be83-424f-b0a6-31fbf9574a79"); - lang: Python name: Python (EazySDK) source: > client = eazysdk.EazySDK() response = client.get.payments_single('ab09362d-f88e-4ee8-be85-e27e1a6ce06a', '36bb4f4f-9a7f-4ead-82dc-9295c6fb9e8b') - lang: Java name: Java (EazySDK) source: > Get get = new Get(settings); String response = get.paymentsSingle("2b62a358-9a1a-4c71-9450-e419e393dcd1", "6917d51a-be83-424f-b0a6-31fbf9574a79"); - lang: cURL source: > curl -L -g -X GET 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/payment/{paymentId}' -H 'apiKey: {apiKey}' patch: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: > The contract GUID on which the payment you are amending has been lodged. format: guid in: path name: contractId required: true type: string - description: | The payment GUID of the payment you wish to amend. format: guid in: path name: paymentId required: true type: string - description: A comment that can be returned when querying the payment. in: query maxLength: 200 name: comment required: true type: string - description: The amount you wish to change the payment to. in: query multipleOf: 0.01 name: amount required: true type: number - description: | The date on which you require the payment to be taken. **Format: `YYYY-MM-DDT00:00:00.000`** format: date-time in: query name: date required: true type: string responses: "200": description: OK examples: application/json: Message: Payment updated application/xml: > Payment updated schema: $ref: "#/definitions/Payment" "400": description: Bad request - invalid arguments examples: application/json: Message: "An amount, comment or date must be passed" application/xml: | An amount, comment or date must be passed "403": description: Forbidden - payment contract is protected examples: application/json: Message: Payment cannot be accessed application/xml: | Payment cannot be accessed "404": description: Payment not found examples: application/json: Message: Payment not found application/xml: | Payment not found tags: - Payment Manipulation summary: Amends an existing payment in the database. x-codeSamples: - lang: C# name: C# (EazySDK) source: > var patch = new Patch(settings); string request = patch.Payment("2b62a358-9a1a-4c71-9450-e419e393dcd1", "a75f9829-2753-4f67-aafb-bb24aba27dd1", "10.00", "2019-08-01", "test comment"); - lang: Python name: Python (EazySDK) source: > client = eazysdk.EazySDK() response = client.patch.payment('36bb4f4f-9a7f-4ead-82dc-9295c6fb9e8b', '36bb4f4f-9a7f-4ead-82dc-9295c6fb9e8b', 10.50, '2019-06-04', 'A comment') - lang: Java name: Java (EazySDK) source: > Patch patch = new Patch(settings); String request = patch.payment("2b62a358-9a1a-4c71-9450-e419e393dcd1", "a75f9829-2753-4f67-aafb-bb24aba27dd1", "10.00", "2019-08-01", "test comment"); - lang: cURL source: > 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}' "/client/{clientCode}/contract/{contractId}/reactivate": post: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID that you wish to reactivate. format: guid in: path name: contractId required: true type: string responses: "200": description: OK examples: application/json: Message: Contract reactivated application/xml: > Contract reactivated "403": description: Forbidden - contract is protected examples: application/json: Message: Contract cannot be accessed application/xml: | Contract cannot be accessed "404": description: Contract not found examples: application/json: Message: Contract not found application/xml: | Contract not found tags: - Reactivating a Direct Debit summary: Reactivates the Direct Debit if it is in the ***Cancelled*** state. x-codeSamples: - lang: C# name: C# (EazySDK) source: > var post = new Post(settings); string request = post.ReactivateDirectDebit("1802e1dd-a657-428c-b8d0-ba162fc76203"); - lang: Python name: Python (EazySDK) source: > client = eazysdk.EazySDK() request = client.post.reactivate_direct_debit('42217d45-cf22-4430-ab02-acc1f8a2d020') - lang: Java name: Java (EazySDK) source: > Post post = new Post(settings); String request = post.reactivateDirectDebit("1802e1dd-a657-428c-b8d0-ba162fc76203"); - lang: cURL source: > curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/reactivate' -H 'apiKey: {apiKey}' "/client/{clientCode}/contract/{contractId}/reference": patch: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID that you wish to amend. format: guid in: path name: contractId required: true type: string - description: > If you have made arrangements with us to use a custom direct debit referencing scheme, pass the new custom direct debit using this parameter. The field may only contain alphanumeric data (`a-z`, `A-Z`, `0-9`) and certain special characters (hyphen `-` or solidus `/`). in: query maxLength: 18 name: newDDRef required: true type: string responses: "200": description: OK examples: application/json: Message: Contract reference updated application/xml: > Contract reference updated "403": description: Forbidden - account not authorised examples: application/json: Message: API not enabled application/xml: | API not enabled "404": description: Contract not found examples: application/json: Message: Contract not found application/xml: | Contract not found tags: - Contract Amendment description: | In general, our software will allocate a unique direct debit reference for every contract created within the system. For own SUN and FM SUN clients that have made prior arrangements with us, it is possible to change a reference number after the contract has been set up. Please note that using this facility will incur extra charges as new instructions will need to be sent to the bank via BACS. summary: Changing the Direct Debit Reference (for authorised users only) x-codeSamples: - lang: cURL source: > curl -L -g -X PATCH 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/reference?newDDRef=TEST-MT012345' -H 'apiKey: {apiKey}' "/client/{clientCode}/contract/{contractId}/restart": post: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID that you wish to restart. format: guid in: path name: contractId required: true type: string - description: > If 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. enum: - 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 - 99 in: query name: paymentDayInMonth type: integer - description: > 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**. in: query maximum: 12 minimum: 1 name: paymentMonthInYear type: integer - description: > Pass the way in which the contract should end using this parameter. If the contract is **ad-hoc,** *you must* pass `Until further notice`. enum: - Take certain number of debits - Until further notice - End on exact date in: query name: terminationType required: true type: string - description: > 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”. in: query maximum: 999 minimum: 0 name: numberOfDebits type: integer - description: > 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. in: query multipleOf: 0.01 name: initialAmount type: number - description: > 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. in: query multipleOf: 0.01 name: amount type: number - description: > 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. in: query multipleOf: 0.01 name: finalAmount type: number - description: > This 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`. enum: - Expire - Switch to Further Notice in: query name: atTheEnd required: true type: string - description: > If you wish to add an additional reference to the contract for you own use, this can be passed to using the `additionalReference` parameter. in: query maxLength: 200 name: additionalReference type: string responses: "200": description: OK examples: application/json: Message: Contract restarted application/xml: > Contract restarted "400": description: Bad request - invalid restart date examples: application/json: Message: | Start date must be greater than {minStartDate} application/xml: | Start date must be greater than {minStartDate} "403": description: Forbidden - contract is protected examples: application/json: Message: Contract cannot be accessed application/xml: | Contract cannot be accessed "404": description: Contract not found examples: application/json: Message: Contract not found application/xml: | Contract not found tags: - Restart a Contract summary: > Reactivates the Direct Debit if it is in the ***Expired*** state and payments have already come to an end. x-codeSamples: - lang: C# name: C# (EazySDK) source: > var post = new Post(settings); string request = post.RestartContract("1802e1dd-a657-428c-b8d0-ba162fc76203", "Until further notice", "Switch to further notice"); - lang: Python name: Python (EazySDK) source: | client = eazysdk.EazySDK() request = client.post.restart_contract( '42217d45-cf22-4430-ab02-acc1f8a2d020', 'Until further notice', 'Switch to further notice' ) - lang: Java name: Java (EazySDK) source: > Post post = new Post(settings); String request = post.restartContract().contract("1802e1dd-a657-428c-b8d0-ba162fc76203").terminationType("Until further notice").atTheEnd("Switch to further notice").query(); - lang: cURL source: > 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}' "/client/{clientCode}/contract/{contractId}/weekly": patch: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID that you wish to amend. format: guid in: path name: contractId required: true type: string - description: > The new day on which payments are to be taken. Must be passed as an integer: Payments will be collected on the next available instance of the payment day, which will be a **minimum** of 5 working days in the future. Any payment already scheduled in the next 5 working days will still be collected. in: query name: day required: true type: number minimum: 1 maximum: 5 - description: A comment to explain the reason for the change of day. in: query maxLength: 255 name: comment required: true type: string - description: > If you wish to take the next payment to be a different amount (e.g. pro rata because the number of days between payments will deb different) then pass the amount using this parameter. Ensure that `patchNextPayment` is set to `true` if you are using this. in: query multipleOf: 0.01 name: nextPaymentPatchAmount type: number - description: | Set to `true` if using `nextPaymentPatchAmount` or `false` if not. in: query name: patchNextPayment required: true type: boolean responses: "200": description: OK examples: application/json: Message: Contract updated application/xml: > Contract updated "400": description: Bad request - invalid day examples: application/json: Message: Day is invalid for this contract application/xml: | Day is invalid for this contract tags: - Contract Amendment description: Amends an existing contract payment date in the database. summary: Changing the Day (Weekly Schedules) x-codeSamples: - lang: C# name: C# (EazySDK) source: > var patch = new Patch(settings); string request = patch.ContractDayWeekly("1802e1dd-a657-428c-b8d0-ba162fc76203", "5", "Change to Friday", false); - lang: Python name: Python (EazySDK) source: > client = eazysdk.EazySDK() request = client.patch.contract_day_weekly('36bb4f4f-9a7f-4ead-82dc-9295c6fb9e8b', 5, 'Change to Friday', False) - lang: Java name: Java (EazySDK) source: > Patch patch = new Patch(settings); String request = patch.contractDayWeekly("1802e1dd-a657-428c-b8d0-ba162fc76203", "5", "Change to Friday", false); - lang: cURL source: > curl -L -g -X PATCH 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/weekly?day=5&comment=Change to Friday&patchNextPayment=false' -H 'apiKey: {apiKey}' "/client/{clientCode}/customer": get: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: | The number of customer records to return per page. If this parameter is omitted or `0` is passed in, no pagination will be used. in: query name: pageSize type: number - description: The current page of results you wish to view. in: query name: pageNumber type: number - description: | Default is `false`. If `true`, adds extra JSON metadata in the response to help callers using pagination. in: query name: includePagingDetail type: boolean - description: | Default is `true`. If `true`, includes an array of `Memos` for each customer record returned. If `false`, `Memos` will return `null` for every customer. in: query name: includeMemos type: boolean - description: The customer’s contact email address. in: query maxLength: 200 name: email type: string - description: The customer’s title (Mr/Mrs/Ms/Miss/Mx etc). in: query maxLength: 200 name: title type: string - description: | The date/time from which you want to find new customers added. **Format: `YYYY-MM-DDT00:00:00.000`** format: date-time in: query name: from type: string - description: | The date/time to which you want to find new customers added. **Format: `YYYY-MM-DDT00:00:00.000`** format: date-time in: query name: to type: string - description: | The customer’s date of birth. **Format: `YYYY-MM-DDT00:00:00.000`** format: date-time in: query name: dateOfBirth type: string - description: >- A **unique** reference number allocated by the client for this customer. in: query maxLength: 200 name: customerRef type: string - description: The customer's first name. in: query maxLength: 200 name: firstName type: string - description: The customer's surname. in: query maxLength: 200 name: surname type: string - description: The company name of the customer (if applicable). in: query maxLength: 200 name: companyName type: string - description: The customer's Post Code. in: query maxLength: 10 name: postCode type: string - description: > The customer's bank account number. This must be eight numerical characters with all leading zeros left intact. Examples include: `01065284`, `00000000`, `26280464`. Any non-numerical characters **must be removed** before passing the data to the API. in: query maxLength: 8 minLength: 8 name: accountNumber pattern: "[0-9]{8}" type: string - description: > The customer's bank sort code. This must be six numerical characters with all leading zeros left intact. Examples include: `089286` `100000` `600000`, `230580`. In the United Kingdom it is sometimes customary to insert dashes/hyphens between groups of two characters (e.g. `08-92-86`, `23-05-80`). Any hyphens, dashes or non-numerical characters **must be removed** before being passed to the API. in: query maxLength: 6 minLength: 6 name: bankSortCode pattern: "[0-9]{6}" type: string - description: > The name of the customer's bank account. This must be a maximum of eighteen alphanumeric characters `[0-9a-zA-Z ]`. A space is also allowed. Any special characters or punctuation such as ampersands, apostrophes, hyphens, slashes, backslashes, commas, full stops etc. **must be removed** before passing to the API. in: query maxLength: 18 name: accountHolderName pattern: "[0-9a-zA-Z ]{0, 18}" type: string - description: The customer's home telephone number. in: query maxLength: 200 name: homePhoneNumber type: string - description: The customer's work telephone number. in: query maxLength: 200 name: workPhoneNumber type: string - description: The customer's mobile telephone number. in: query maxLength: 200 name: mobilePhoneNumber type: string responses: "200": description: OK examples: application/json: AddressDetail: Line1: 1 Tebbit Mews Line2: Winchcombe Street Line3: Cheltenham PostCode: A1 1AA BankDetail: AccountHolderName: Access Paysuite AccountNumber: "01065285" BankSortCode: "309906" CompanyName: Access Paysuite CustomerRef: AE102890 DateAdded": "2017-04-12T13:22:48.800Z" DateOfBirth: "2017-01-01T00:00:00.000Z" Email: spam@eazycollect.co.uk FirstName: Matthew HomePhoneNumber: 01234567890 Id: c36ce83c-0064-4c1e-a157-cd4c70decf47 IsArchived: true Memos: [] Surname: Harris Title: Mr application/xml: >- c36ce83c-0064-4c1e-a157-cd4c70decf47 AE102890 true 2017-04-12T13:22:48.8 Mr Matthew Harris Access Paysuite 2017-01-01T00:00:00 01234567890 spam@eazycollect.co.uk 1 Tebbit Mews Winchcombe Street Cheltenham A1 1AA Access Paysuite 01065285 309906 schema: properties: Customers: description: Array of Customers matching the search criteria. type: array items: $ref: "#/definitions/Customer" Metadata: description: | Object of metadata useful for clients using pagination. Only included if `includePagingDetail=true` type: object $ref: "#/definitions/PagingMetadata" "404": description: Customer not found examples: application/json: Message: API not enabled application/xml: >- API not enabled7 tags: - Customer Manipulation description: | **NOTE:** The response from a GET method includes an `IsArchived` flag. On a newly created customer, this will show as `true` which is normal. The record will automatically change to `false` when an associated live Direct Debit (contract) is attached to it. summary: Queries the database for a set of customers. x-codeSamples: - lang: C# name: C# (EazySDK) source: | var get = new Get(settings); string response = get.Customers(); - lang: Python name: Python (EazySDK) source: | client = eazysdk.EazySDK() response = client.get.customers() - lang: Java name: Java (EazySDK) source: | Get get = new Get(settings); String response = get.customers(); - lang: cURL source: > curl -L -g -X GET 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/customer' -H 'apiKey: {apiKey}' post: consumes: - application/json - application/xml produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: | The customer’s contact email address. By default this field is required, but this can be disabled at your request. The `CustomerEmailMandatory` field in the Client Info response shows whether this field is mandatory. in: query maxLength: 200 name: email required: false type: string - description: The customer’s title (Mr/Mrs/Ms/Miss/Mx etc). in: query maxLength: 200 name: title required: true type: string - description: | The customer’s date of birth. **Format: `YYYY-MM-DDT00:00:00.000`** format: date-time in: query name: dateOfBirth type: string - description: >- A **unique** reference number allocated by the client for this customer. in: query maxLength: 200 name: customerRef required: true type: string - description: The customer's first name. in: query maxLength: 200 name: firstName required: false type: string - description: The customer's surname. in: query maxLength: 200 name: surname required: true type: string - description: The company name of the customer (if applicable). in: query maxLength: 200 name: companyName type: string - description: The customer's Post Code. in: query maxLength: 10 name: postCode required: true type: string - description: > The customer's bank account number. This must be eight numerical characters with all leading zeros left intact. Examples include: `01065284`, `00000000`, `26280464`. Any non-numerical characters **must be removed** before passing the data to the API. in: query maxLength: 8 minLength: 8 name: accountNumber pattern: "[0-9]{8}" required: true type: string - description: > The customer's bank sort code. This must be six numerical characters with all leading zeros left intact. Examples include: `089286` `100000` `600000`, `230580`. In the United Kingdom it is sometimes customary to insert dashes/hyphens between groups of two characters (e.g. `08-92-86`, `23-05-80`). Any hyphens, dashes or non-numerical characters **must be removed** before being passed to the API. in: query maxLength: 6 minLength: 6 name: bankSortCode pattern: "[0-9]{6}" required: true type: string - description: > The name of the customer's bank account. This must be a maximum of eighteen alphanumeric characters `[0-9a-zA-Z ]`. A space is also allowed. Any special characters or punctuation such as ampersands, apostrophes, hyphens, slashes, backslashes, commas, full stops etc. **must be removed** before passing to the API. in: query maxLength: 18 name: accountHolderName pattern: "[0-9a-zA-Z ]{0, 18}" required: true type: string - description: The customer's home telephone number. in: query maxLength: 200 name: homePhoneNumber type: string - description: The customer's work telephone number. in: query maxLength: 200 name: workPhoneNumber type: string - description: The customer's mobile telephone number. in: query maxLength: 200 name: mobilePhoneNumber type: string - description: Line one of the customer's postal address. in: query maxLength: 200 name: line1 required: true type: string - description: Line two of the customer's postal address. in: query maxLength: 200 name: line2 required: true type: string - description: Line three of the customer's postal address. in: query maxLength: 200 name: line3 type: string - description: Line four of the customer's postal address. in: query maxLength: 200 name: line4 type: string - description: >- If the customer has provided any middle initials, they can be added in this field. in: query maxLength: 200 name: initials type: string - description: >- Set the language of communications sent to this customer to English (`en-GB`) or Welsh (`cy-GB`). If omitted, this defaults to English. If Welsh support is not enabled for your organisation, submitting `cy-GB` returns a 400 error with the message: **"Welsh language not enabled for this client"**. in: query maxLength: 5 name: customerLocale type: string enum: - en-GB - cy-GB - description: Example JSON/XML payload. in: body name: body schema: example: Email: john.doe@test.com Title: Mr CustomerRef: "999999" FirstName: John Surname: Doe Line1: 1 Tebbit Mews Line2: Winchcombe Street PostCode: GL52 2NF AccountNumber: "12345678" BankSortCode: "123456" AccountHolderName: Mr John Doe xml: name: CustomerRequestDto type: object responses: "200": description: OK examples: application/json: CustomerRef: AE102888 Id: 12f5734a-bfc3-45f2-9edd-44d4a05cf751 application/xml: > AE102889 a1d86a0a-6806-408b-b5ce-1fae797cc142 schema: properties: Id: description: > The GUID of the customer record. You must save this to your database as it will be needed should you wish to update the customer record or create a Direct Debit (Contract). type: string customerRef: description: > The customer reference that you passed via the API into the system. type: string type: object "400": description: Bad request - email mandatory examples: application/json: ErrorCode: 2 Message: Customer email is mandatory for this client application/xml: > 2 Customer email is mandatory for this client schema: properties: Message: description: > If there are any problems with the record, these will be shown in the message field. type: string tags: - Customer Manipulation description: | ### Error Handling Errors are presented back in the JSON or XML response in human readable form. **Common Errors:** *Error:* “There is an existing Customer with the same Client and Customer ref in the database already.” *Explanation:* The customer reference must be unique; this indicates that a customer with the customerRef provided in the API call already exists *Resolution:* Check that the customer does not already exist; if not, you must use another unique customerRef. *Error:* Invalid Postcode. The postcode must have 5, 6 or 7 characters only *Explanation:* The postcode supplied is not in a correct UK format. *Resolution:* UK postcodes can be formed in the following ways: - A99 9AA - AA99 9AA - AA9A 9AA Where A is a capital letter \[A-Z\] and 9 is a number \[0-9\]. Please provide the postcode in one of the recognised formats. summary: Creates a customer in the database. x-codeSamples: - lang: C# name: C# (EazySDK) source: > var post = new Post(settings); string request = post.Customer("john.doe@test.com", "Mr", "999999", "John", "Doe", "1 Tebbit Mews", "GL52 2NF", "12345678", "123456", "Mr John Doe"); - lang: Python name: Python (EazySDK) source: > client = eazysdk.EazySDK() request = client.post.customer(email="john.doe@test.com", title="Mr", customer_reference="999999", first_name="John", surname="Doe", line1="1 Tebbit Mews", post_code="GL52 2NF", account_number="12345678", sort_code="123456", account_holder_name="Mr John Doe") - lang: Java name: Java (EazySDK) source: > Post post = new Post(settings); String request = post.customer().email("john.doe@test.com").title("Mr").customerReference("999999") .firstName("John").surname("Doe").line1("1 Tebbit Mews").postCode("GL52 2NF").accountNumber("12345678") .sortCode("123456").accountHolderName("Mr John Doe").query(); - lang: cURL source: > curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/customer?email=john.doe@test.com&title=Mr&customerRef=999999&firstName=John&surname=Doe&line1=1 Tebbit Mews&postCode=GL52 2NF&accountNumber=12345678&bankSortCode=123456&accountHolderName=Mr John Doe' -H 'apiKey: {apiKey}' "/client/{clientCode}/customer/{customerId}": get: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The GUID of the customer. in: path name: customerId required: true type: string format: guid responses: "200": description: OK examples: application/json: AddressDetail: Line1: 1 Tebbit Mews Line2: Winchcombe Street Line3: Cheltenham PostCode: A1 1AA BankDetail: AccountHolderName: Access Paysuite AccountNumber: "01065285" BankSortCode: "309906" CompanyName: Access Paysuite CustomerRef: AE102890 DateAdded": "2017-04-12T13:22:48.800Z" DateOfBirth: "2017-01-01T00:00:00.000Z" Email: spam@eazycollect.co.uk FirstName: Matthew HomePhoneNumber: 01234567890 Id: c36ce83c-0064-4c1e-a157-cd4c70decf47 IsArchived: true Memos: [] Surname: Harris Title: Mr application/xml: >- c36ce83c-0064-4c1e-a157-cd4c70decf47 AE102890 true 2017-04-12T13:22:48.8 Mr Matthew Harris Access Paysuite 2017-01-01T00:00:00 01234567890 spam@eazycollect.co.uk 1 Tebbit Mews Winchcombe Street Cheltenham A1 1AA Access Paysuite 01065285 309906 schema: $ref: "#/definitions/Customer" "404": description: Customer not found examples: application/json: Message: API not enabled application/xml: >- API not enabled7 tags: - Customer Manipulation description: | **NOTE:** The response from a GET method includes an `IsArchived` flag. On a newly created customer, this will show as `true` which is normal. The record will automatically change to `false` when an associated live Direct Debit (contract) is attached to it. summary: Queries the database for a single customer by ID. x-codeSamples: - lang: C# name: C# (EazySDK) source: | var get = new Get(settings); string response = get.Customers(); - lang: Python name: Python (EazySDK) source: | client = eazysdk.EazySDK() response = client.get.customers() - lang: Java name: Java (EazySDK) source: | Get get = new Get(settings); String response = get.customers(); - lang: cURL source: > curl -L -g -X GET 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/customer/c36ce83c-0064-4c1e-a157-cd4c70decf47' -H 'apiKey: {apiKey}' patch: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The GUID of the customer. in: path name: customerId required: true type: string - description: The customer’s contact email address. in: query maxLength: 200 name: email required: false type: string - description: The customer’s title (Mr/Mrs/Ms/Miss/Mx etc). in: query maxLength: 200 name: title required: false type: string - description: | The customer’s date of birth. **Format: `YYYY-MM-DDT00:00:00.000`** format: date-time in: query name: dateOfBirth type: string - description: >- A **unique** reference number allocated by the client for this customer. in: query maxLength: 200 name: customerRef required: false type: string - description: The customer's first name. in: query maxLength: 200 name: firstName required: false type: string - description: The customer's surname. in: query maxLength: 200 name: surname required: false type: string - description: The company name of the customer (if applicable). in: query maxLength: 200 name: companyName type: string - description: The customer's Post Code. in: query maxLength: 10 name: postCode required: false type: string - description: > The customer's bank account number. This must be eight numerical characters with all leading zeros left intact. Examples include: `01065284`, `00000000`, `26280464`. Any non-numerical characters **must be removed** before passing the data to the API. in: query maxLength: 8 minLength: 8 name: accountNumber pattern: "[0-9]{8}" required: false type: string - description: > The customer's bank sort code. This must be six numerical characters with all leading zeros left intact. Examples include: `089286` `100000` `600000`, `230580`. In the United Kingdom it is sometimes customary to insert dashes/hyphens between groups of two characters (e.g. `08-92-86`, `23-05-80`). Any hyphens, dashes or non-numerical characters **must be removed** before being passed to the API. in: query maxLength: 6 minLength: 6 name: bankSortCode pattern: "[0-9]{6}" required: false type: string - description: > The name of the customer's bank account. This must be a maximum of eighteen alphanumeric characters `[0-9a-zA-Z ]`. A space is also allowed. Any special characters or punctuation such as ampersands, apostrophes, hyphens, slashes, backslashes, commas, full stops etc. **must be removed** before passing to the API. in: query maxLength: 18 name: accountHolderName pattern: "[0-9a-zA-Z ]{0, 18}" required: false type: string - description: The customer's home telephone number. in: query maxLength: 200 name: homePhoneNumber type: string - description: The customer's work telephone number. in: query maxLength: 200 name: workPhoneNumber type: string - description: The customer's mobile telephone number. in: query maxLength: 200 name: mobilePhoneNumber type: string - description: Line one of the customer's postal address. in: query maxLength: 200 name: line1 required: false type: string - description: Line two of the customer's postal address. in: query maxLength: 200 name: line2 required: false type: string - description: Line three of the customer's postal address. in: query maxLength: 200 name: line3 type: string - description: Line four of the customer's postal address. in: query maxLength: 200 name: line4 type: string - description: >- If the customer has provided any middle initials, they can be added in this field. in: query maxLength: 200 name: initials type: string - description: >- Set the language of communications sent to this customer to English (`en-GB`) or Welsh (`cy-GB`). If omitted, this defaults to English. If Welsh support is not enabled for your organisation, submitting `cy-GB` returns a 400 error with the message: **"Welsh language not enabled for this client"**. in: query maxLength: 5 name: customerLocale type: string enum: - en-GB - cy-GB responses: "200": description: OK examples: application/json: Message: Customer updated application/xml: > Customer updated schema: properties: Message: type: string type: object tags: - Customer Manipulation description: | ### Error Handling Errors are presented back in the JSON or XML response in human readable form. **Common Errors:** *Error:* “There is an existing Customer with the same Client and Customer ref in the database already.” *Explanation:* The customer reference must be unique; this indicates that a customer with the customerRef provided in the API call already exists *Resolution:* Check that the customer does not already exist; if not, you must use another unique customerRef. *Error:* Invalid Postcode. The postcode must have 5, 6 or 7 characters only *Explanation:* The postcode supplied is not in a correct UK format. *Resolution:* UK postcodes can be formed in the following ways: - A99 9AA - AA99 9AA - AA9A 9AA Where A is a capital letter \[A-Z\] and 9 is a number \[0-9\]. Please provide the postcode in one of the recognised formats. summary: Updates (or partially updates) an existing customer in the database. x-codeSamples: - lang: C# name: C# (EazySDK) source: > var patch = new Patch(settings); string request = patch.Customer("dfca6da1-2490-4607-a256-c5799d2584e9", Email: "john.doe@test.com"); - lang: Python name: Python (EazySDK) source: > client = eazysdk.EazySDK() request = client.patch.customer("dfca6da1-2490-4607-a256-c5799d2584e9", email="john.doe@test.com") - lang: Java name: Java (EazySDK) source: > Post patch = new Patch(settings); String request = patch.customer("dfca6da1-2490-4607-a256-c5799d2584e9").email("john.doe@test.com").query(); - lang: cURL source: > curl -L -g -X PATCH 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/customer/dfca6da1-2490-4607-a256-c5799d2584e9?email=john.doe@test.com' -H 'apiKey: {apiKey}' "/client/{clientCode}/customer/{customerId}/edit": patch: consumes: - application/json produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The GUID of the customer. format: guid in: path name: customerId required: true type: string - description: >- The customer fields to update. Send only the fields you want to change. in: body name: body required: true schema: $ref: "#/definitions/UpdateCustomerJsonRequest" responses: "200": description: OK examples: application/json: Message: Customer updated schema: properties: Message: type: string type: object tags: - Customer Manipulation description: >- Updates, or partially updates, an existing customer record by sending a JSON body. Send only the fields you want to change. summary: Updates an existing customer using a JSON request body. x-codeSamples: - lang: cURL source: > curl -L -g -X PATCH 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/customer/dfca6da1-2490-4607-a256-c5799d2584e9/edit' -H 'Content-Type: application/json' -H 'apiKey: {apiKey}' -d '{"Email":"john.doe@test.com","FirstName":"John","Surname":"Doe"}' "/client/{clientCode}/question": post: produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: Label for the question. in: query maxLength: 500 name: label required: true type: string - description: Data type for answers to this question. in: query enum: - text - list - date name: type required: true type: string - description: Comma-separated list of possible answers for this question. Can only be used when type is `list`. in: query name: options required: false type: string pattern: "[A-Za-z0-9,]+" maxLength: 800 - description: A custom tag that can be assigned to this question. This tag does *not* need to be unique. in: query name: tags required: false type: string maxLength: 200 - description: Whether or not an answer is required for this question. in: query name: isMandatory required: true type: boolean - description: Example JSON payload. in: body name: body schema: example: label: Would you like us to send you offers by email? type: list options: "Yes,No" isMandatory: false responses: "200": description: OK examples: application/json: Id: "e45afe74-0217-43e1-8afc-0f60b887c691" Message: "Client custom question was added successfully" schema: properties: Id: description: > The GUID of the question. You must save this to your database as it will be needed when you add an answer. type: string Message: description: > Success message. type: string type: object "400": description: Bad request - options not provided for `list` question examples: application/json: ErrorCode: 3 Detail: "Please provide Options for the selected Type." Message: "Validation error" summary: Creates a new question. tags: - Customer Questions "/client/{clientCode}/question/{questionId}": patch: produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The ID of the question to update. in: path name: questionId required: true type: string format: guid - description: Label for the question. in: query maxLength: 500 name: label required: false type: string - description: Data type for answers to this question. in: query enum: - text - list - date name: type required: false type: string - description: Comma-separated list of possible answers for this question. Can only be used when type is `list`. in: query name: options required: false type: string pattern: "[A-Za-z0-9,]+" maxLength: 800 - description: Whether or not an answer is required for this question. in: query name: isMandatory required: false type: boolean - description: Example JSON payload. in: body name: body schema: example: label: Would you like us to send you offers by email? type: list options: "Yes,No" isMandatory: false responses: "200": description: OK examples: application/json: Message: "Client custom question updated" schema: properties: Id: description: > The GUID of the question. You must save this to your database as it will be needed when you add an answer. type: string Message: description: > Success message. type: string type: object "400": description: Bad request - options not provided for `list` question examples: application/json: ErrorCode: 3 Detail: "Please provide Options for the selected Type." Message: "Validation error" summary: Updates an existing question. tags: - Customer Questions "/client/{clientCode}/questions": get: produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string responses: "200": description: OK examples: application/json: Questions: - Id: "3836f9ea-bf95-495b-a87b-76012056ab3d" Label: "Enter your pet's name:" Type: Text Options: [""] Tags: "pet-appeal" IsMandatory: false - Id: "dec0153e-7e75-4666-9b90-08efb48cea0b" Label: "Would you like us to send you offers by email?" Type: List Options: [Yes, No] Tags: null IsMandatory: false schema: properties: Questions: description: Array of Questions. type: array items: $ref: "#/definitions/Question" type: object summary: Lists all questions created for the client. tags: - Customer Questions "/client/{clientCode}/customer/{customerId}/question/{questionId}/answer": post: produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: Customer to assign the answer to. in: path name: customerId required: true type: string format: guid - description: Question the answer relates to. in: path name: questionId required: true type: string format: guid - description: The answer to add. in: query required: true name: value type: string maxLength: 500 responses: "200": description: OK examples: application/json: Message: "Customer Answer added" "400": description: Bad request - answer exists examples: application/json: ErrorCode: 3 Detail: "There is an existing Customer answer with the same Customer and Question in the database already." Message: "Validation error" summary: Adds an answer for a customer. tags: - Customer Questions patch: produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: Customer to assign the answer to. in: path name: customerId required: true type: string format: guid - description: Question the answer relates to. in: path name: questionId required: true type: string format: guid - description: The answer to add. in: query required: true name: value type: string maxLength: 500 responses: "200": description: OK examples: application/json: Message: "Customer Answer updated" "400": description: Bad request - answer not in Options examples: application/json: ErrorCode: 3 Detail: "Please provide a valid response to this question. Possible responses are Yes,No" Message: "Validation error" "404": description: Answer not found examples: application/json: ErrorCode: 9 Detail: null Message: "Customer Answer not found" summary: Updates an existing customer answer. tags: - Customer Questions delete: produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: Customer to assign the answer to. in: path name: customerId required: true type: string format: guid - description: Question the answer relates to. in: path name: questionId required: true type: string format: guid responses: "200": description: OK examples: application/json: Message: "Customer Answer deleted" "404": description: Answer not found examples: application/json: ErrorCode: 9 Detail: null Message: "Customer Answer not found" summary: Deletes an existing customer answer. tags: - Customer Questions get: produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: Customer to assign the answer to. in: path name: customerId required: true type: string format: guid - description: Question the answer relates to. in: path name: questionId required: true type: string format: guid responses: "200": description: OK schema: $ref: "#/definitions/Answer" examples: application/json: Id: 37c1def5-e9e5-4be4-bd6a-bc8fb5f0cbc2 Product: null Customer: 66e88855-a07e-40d8-aff6-1fa7ace4dd1d CustomQuestion: ba8a6aef-756f-4945-b846-f8adaafb69df Answer: Yes "404": description: Answer not found examples: application/json: ErrorCode: 9 Detail: null Message: "Customer Answer not found" summary: Gets the answer for a particular customer and question. tags: - Customer Questions "/client/{clientCode}/paymentdate": get: produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string responses: "200": description: OK examples: application/json: NextFirstPaymentDate: "2022-08-22T00:00:00+01:00" NextSubsequentPaymentDate: "2022-08-19T00:00:00+01:00" schema: properties: NextFirstPaymentDate: description: The earliest contract start/first collection date currently allowed by your SUN. type: string format: datetime NextSubsequentPaymentDate: description: The earliest adhoc payment date for active contracts after first collection currently allowed by your SUN. type: string format: datetime type: object tags: - Payment Dates summary: Gets the earliest first and subsequent payment dates currently allowed. x-codeSamples: - lang: cURL source: > curl -L -g -X GET 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/paymentdate' -H 'apiKey: {apiKey}' "/client/{clientCode}/contract/{contractId}/futureSchedules": get: produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID that you wish to query. in: path name: contractId required: true type: string format: guid responses: "200": description: OK examples: application/json: StreamVersions: - Id: "e4dda449-4bf3-44fc-b8a6-29b3f90576f7" Status: "Future version" IsPatch: false StartDate: "2026-06-11T00:00:00" Frequency: "Monthly" Every: 1 PaymentDayInWeek: null PaymentDayInMonth: 2 PaymentMonthInYear: null InitialDate: null InitialAmount: 1.00 RegistrationFee: null ExtraInitialAmounts: "1" Amount: 1.00 FinalAmount: 1.00 IsGiftAid: false TerminationType: "End on exact date" TerminationDate: "2030-06-15T00:00:00" NumberOfDebits: null SearchInput: null TotalExpectedResults: 1 schema: properties: StreamVersions: description: Array of stream versions. type: array items: $ref: "#/definitions/StreamVersion" SearchInput: description: Search input. type: object TotalExpectedResults: description: Total expected results. type: integer type: object "400": description: Bad Request examples: application/json: Message: "Validation error" ErrorCode: 3 Detail: "" schema: properties: Message: description: Message. type: string ErrorCode: description: Error code. type: integer Detail: description: Detail. type: string "500": description: Internal Server Error examples: application/json: Message: "Internal server error" ErrorCode: 4 Detail: "" schema: properties: Message: description: Message. type: string ErrorCode: description: Error code. type: integer Detail: description: Detail. type: string tags: - Frequency Switching summary: Retrieves all future schedules (stream versions) for a given contract and stream. x-codeSamples: - lang: cURL source: > curl -L -g -X GET 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/futureSchedules' -H 'apiKey: {apiKey}' "/client/{clientCode}/contract/{contractId}/schedule": get: produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID that you wish to query. in: path name: contractId required: true type: string format: guid - description: The StreamVersion (schedule) GUID that you wish to query. in: query name: versionId required: true type: string format: guid responses: "200": description: OK examples: application/json: StreamVersion: Id: "c036d70c-6578-4608-acd2-78511acc02f0" Status: "Active version" IsPatch: false StartDate: "2025-01-15T00:00:00" Frequency: "Annually" Every: 1 PaymentDayInWeek: null PaymentDayInMonth: 15 PaymentMonthInYear: null InitialDate: null InitialAmount: null RegistrationFee: null ExtraInitialAmounts: null Amount: 400.00 FinalAmount: null IsGiftAid: false TerminationType: "End on exact date" TerminationDate: "2025-05-01T00:00:00" NumberOfDebits: null SearchInput: null TotalExpectedResults: 1 schema: properties: StreamVersion: $ref: "#/definitions/StreamVersion" SearchInput: description: Search input. type: object TotalExpectedResults: description: Total expected results. type: integer type: object "400": description: Bad Request examples: application/json: Message: "Validation error" ErrorCode: 3 Detail: "" schema: properties: Message: description: Message. type: string ErrorCode: description: Error code. type: integer Detail: description: Detail. type: string "500": description: Internal Server Error examples: application/json: Message: "Internal server error" ErrorCode: 4 Detail: "" schema: properties: Message: description: Message. type: string ErrorCode: description: Error code. type: integer Detail: description: Detail. type: string tags: - Frequency Switching summary: Retrieves details of a specific contract stream version (schedule). x-codeSamples: - lang: cURL source: > curl -L -g -X GET 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/schedule?versionId={versionId}' -H 'apiKey: {apiKey}' "/client/{clientCode}/contract/{contractId}/deleteSchedule/{futureScheduleId}": delete: produces: - text parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID on which the future schedule has been applied to. in: path name: contractId required: true type: string format: guid - description: The StreamVersion (schedule) GUID that you wish to delete. in: path name: futureScheduleId required: true type: string format: guid responses: "200": description: OK examples: text: Schedule successfully deleted. "400": description: Bad Request examples: application/json: Message: "Validation error" ErrorCode: 3 Detail: "" schema: properties: Message: description: Message. type: string ErrorCode: description: Error code. type: integer Detail: description: Detail. type: string "500": description: Internal Server Error examples: application/json: Message: "Internal server error" ErrorCode: 4 Detail: "" schema: properties: Message: description: Message. type: string ErrorCode: description: Error code. type: integer Detail: description: Detail. type: string tags: - Frequency Switching summary: Deletes a future contract schedule (stream version) by its ID. x-codeSamples: - lang: cURL source: > curl -L -g -X DELETE 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/deleteSchedule/{futureScheduleId}' -H 'apiKey: {apiKey}' "/client/{clientCode}/contract/{contractId}/editSchedule/{futureScheduleId}": patch: produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID that you wish to amend. in: path name: contractId required: true type: string format: guid - description: The StreamVersion (schedule) GUID that you wish to amend. in: path name: futureScheduleId required: true type: string format: guid - description: Effective date of change. in: query name: startDate required: true type: string format: datetime - description: Schedule ID from available schedules. in: query name: scheduleId required: false type: string format: guid - description: Schedule name from available schedules. in: query name: scheduleName required: false type: string - description: If the schedule is set to take regular payments, this parameter allows you to skip periods (e.g. every 2 months, every 4 weeks etc). This field is only mandatory if the schedule is not an ad-hoc schedule. in: query name: every required: false type: integer - description: > If the schedule is for regular payments, then the day on which you wish the first payment should be passed with this parameter. This field is only mandatory if the schedule is **not** an ad-hoc schedule. This field is only mandatory if the schedule is **annual** or **monthly**. **NOTE:** You may only select: - days **1** to **28** - **98**, which represents `Last working day of the Month` - **99**, which represents `Last day of the Month` equal with value 99. *You may not* select days 29, 30 or 31 of the month; choosing 29, 30 or 31 will result in payments being skipped in months that do not contain that date. in: query name: paymentDayInMonth required: false type: integer - description: > 1 -> Monday 2 -> Tuesday 3 -> Wednesday 4 -> Thursday 5 -> Friday If the schedule is for regular payments and has a weekly frequency, pass the day of the week that you wish payments to be collected via this parameter. This field is only mandatory if the schedule is **not** an ad-hoc schedule. This field is only mandatory if the schedule is **weekly**. in: query name: paymentDayInWeek required: false type: integer - description: > If the schedule 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 schedule is **not** an ad-hoc schedule. This field is only mandatory if the schedule is **annual** or **monthly**. in: query name: paymentMonthInYear required: false type: integer - description: Different first payment date. in: query name: initialDate required: false type: string format: datetime - description: > If this is a schedule 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 schedule, or where the first amount is the same as the regular amount. in: query name: initialAmount required: false type: number format: decimal - description: | If there are extra charges to be collected with the first payment (e.g. a gym joining fee/registration fee) then these can be added separately with this parameter. Do not pass the parameter if there are no extra amounts, and this must not be used if the schedule is an ad-hoc payment schedule. in: query name: extraInitialAmounts required: false type: string - description: > If the schedule is for regular payments, then the regular payment amount should be passed using this parameter. Do not pass this parameter if the schedule is an ad-hoc schedule. This field is only mandatory if the schedule is **not** an ad-hoc schedule. in: query name: amount required: false type: number format: decimal - description: > If this is a schedule 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 schedules, or where the final amount is the same as the regular amount. in: query name: finalAmount required: false type: number format: decimal - description: > Pass the way in which the schedule should end using this parameter. If the schedule is **ad-hoc,** *you must* pass `Until further notice`. enum: - Take certain number of debits - Until further notice - End on exact date in: query name: terminationType required: false type: string - description: > If the `terminationType` is `End on Exact Date` then the termination date should be passed using this. **Format: `YYYY-MM-DDT00:00:00.000`** in: query name: terminationDate required: false type: string format: datetime - description: > If this is a “Take certain Number of Debits” schedule 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”. in: query name: numberOfPayments required: false type: integer - description: > Pass true if the payments to be collected are to be subject to a gift aid claim, false if not (pass false if the client is not a charity). in: query name: isGiftAid required: false type: boolean - description: Example JSON payload. in: body name: body schema: example: Start: "2025-07-01T00:00:00Z" ScheduleId: "guid-value" ScheduleName: "string" Every: 1 PaymentDayInMonth: 1 PaymentDayInWeek: 1 PaymentMonthInWeek: 1 InitialDate: "2025-07-01T00:00:00Z" InitialAmount: 100.0 ExtraInitialAmounts: "string" Amount: 50.0 FinalAmount: 0.0 TerminationType: "string" TerminationDate: "2026-07-01T00:00:00Z" NumberOfDebits: 12 IsGiftAid: false responses: "200": description: OK examples: application/json: Message: "Contract schedule was edited successfully." schema: properties: Message: description: Message. type: string type: object "400": description: Bad Request examples: application/json: Message: "Validation error" ErrorCode: 3 Detail: "" schema: properties: Message: description: Message. type: string ErrorCode: description: Error code. type: integer Detail: description: Detail. type: string "500": description: Internal Server Error examples: application/json: Message: "Internal server error" ErrorCode: 4 Detail: "" schema: properties: Message: description: Message. type: string ErrorCode: description: Error code. type: integer Detail: description: Detail. type: string tags: - Frequency Switching summary: Edits an existing future contract schedule. x-codeSamples: - lang: cURL source: > curl -L -g -X PATCH 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/editSchedule/{futureScheduleId}?startDate=2025-07-01T00:00:00Z&scheduleId=guid-value&scheduleName=string&every=1&paymentDayInMonth=1&paymentDayInWeek=1&paymentMonthInYear=1&initialDate=2025-07-01T00:00:00Z&initialAmount=100.0&extraInitialAmounts=string&amount=50.0&finalAmount=0.0&terminationType=string&terminationDate=2026-07-01T00:00:00Z&numberOfPayments=12&isGiftAid=false' -H 'apiKey: {apiKey}' "/client/{clientCode}/contract/{contractId}/newSchedule": post: produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID that you wish to add a new future schedule to. in: path name: contractId required: true type: string format: guid - description: Effective date of change. in: query name: startDate required: true type: string format: datetime - description: Schedule ID from available schedules. in: query name: scheduleId required: false type: string format: guid - description: Schedule name from available schedules. in: query name: scheduleName required: false type: string - description: > If the schedule is set to take regular payments, this parameter allows you to skip periods (e.g. every 2 months, every 4 weeks etc). This field is only mandatory if the schedule is **not** an ad-hoc schedule. in: query name: every required: false type: integer - description: > If the schedule is for regular payments, then the day on which you wish the first payment should be passed with this parameter. This field is only mandatory if the schedule is **not** an ad-hoc schedule. This field is only mandatory if the schedule is **annual** or **monthly**. **NOTE:** You may only select: - days **1** to **28** - **98**, which represents `Last working day of the Month` - **99**, which represents `Last day of the Month` equal with value 99. *You may not* select days 29, 30 or 31 of the month; choosing 29, 30 or 31 will result in payments being skipped in months that do not contain that date. enum: - 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 - 98 - 99 in: query name: paymentDayInMonth required: false type: integer - description: > 1 -> Monday 2 -> Tuesday 3 -> Wednesday 4 -> Thursday 5 -> Friday If the schedule is for regular payments and has a weekly frequency, pass the day of the week that you wish payments to be collected via this parameter. This field is only mandatory if the schedule is **not** an ad-hoc schedule. This field is only mandatory if the schedule is **weekly**. in: query name: paymentDayInWeek required: false type: integer - description: > If the schedule 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 schedule is **not** an ad-hoc schedule. This field is only mandatory if the schedule is **annual** or **monthly**. in: query name: paymentMonthInYear required: false type: integer - description: Different first payment date. in: query name: initialDate required: false type: string format: datetime - description: > If this is a schedule 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 schedules, or where the first amount is the same as the regular amount. in: query name: initialAmount required: false type: number format: decimal - description: | If there are extra charges to be collected with the first payment (e.g. a gym joining fee/registration fee) then these can be added separately with this parameter. Do not pass the parameter if there are no extra amounts, and this must not be used if the schedule is an ad-hoc payment schedule. in: query name: extraInitialAmounts required: false type: string - description: > If the schedule is for regular payments, then the regular payment amount should be passed using this parameter. Do not pass this parameter if the schedule is an ad-hoc schedule. This field is only mandatory if the schedule is **not** an ad-hoc schedule. in: query name: amount required: false type: number format: decimal - description: > If this is a schedule 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 schedules, or where the final amount is the same as the regular amount. in: query name: finalAmount required: false type: number format: decimal - description: > Pass the way in which the schedule should end using this parameter. If the schedule is **ad-hoc,** *you must* pass `Until further notice`. enum: - Take certain number of debits - Until further notice - End on exact date in: query name: terminationType required: false type: string - description: > If the `terminationType` is `End on Exact Date` then the termination date should be passed using this. **Format: `YYYY-MM-DDT00:00:00.000`** in: query name: terminationDate required: false type: string format: datetime - description: > If this is a “Take certain Number of Debits” schedule 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”. in: query maximum: 999 minimum: 0 name: numberOfPayments required: false type: integer - description: > Pass true if the payments to be collected are to be subject to a gift aid claim, false if not (pass false if the client is not a charity). in: query name: isGiftAid required: false type: boolean - description: Example JSON payload. in: body name: body schema: example: Start: "2025-07-01T00:00:00Z" ScheduleId: "guid-value" ScheduleName: "string" Every: 1 PaymentDayInMonth: 1 PaymentDayInWeek: 1 PaymentMonthInWeek: 1 InitialDate: "2025-07-01T00:00:00Z" InitialAmount: 100.0 ExtraInitialAmounts: "string" Amount: 50.0 FinalAmount: 0.0 TerminationType: "string" TerminationDate: "2026-07-01T00:00:00Z" NumberOfDebits: 12 IsGiftAid: false responses: "200": description: OK examples: application/json: NewScheduleId: "guid-value" schema: properties: NewScheduleId: description: New schedule ID. type: string format: guid type: object "400": description: Bad Request examples: application/json: Message: "Validation error" ErrorCode: 3 Detail: "" schema: properties: Message: description: Message. type: string ErrorCode: description: Error code. type: integer Detail: description: Detail. type: string "500": description: Internal Server Error examples: application/json: Message: "Internal server error" ErrorCode: 4 Detail: "" schema: properties: Message: description: Message. type: string ErrorCode: description: Error code. type: integer Detail: description: Detail. type: string tags: - Frequency Switching summary: Creates a new future contract schedule. x-codeSamples: - lang: cURL source: > curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/newSchedule?startDate=2025-07-01T00:00:00Z&scheduleId=guid-value&scheduleName=string&every=1&paymentDayInMonth=1&paymentDayInWeek=1&paymentMonthInYear=1&initialDate=2025-07-01T00:00:00Z&initialAmount=100.0&extraInitialAmounts=string&amount=50.0&finalAmount=0.0&terminationType=string&terminationDate=2026-07-01T00:00:00Z&numberOfPayments=12&isGiftAid=false' -H 'apiKey: {apiKey}' "/client/{clientCode}/contract/{contractId}/cancelSchedule": post: produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID that you want to cancel the schedule for. in: path name: contractId required: true type: string format: guid responses: "200": description: OK examples: application/json: Message: "Contract schedule was cancelled successfully." schema: properties: Message: description: Message. type: string type: object "400": description: Bad Request examples: application/json: Message: "Validation error" ErrorCode: 3 Detail: "" schema: properties: Message: description: Message. type: string ErrorCode: description: Error code. type: integer Detail: description: Detail. type: string type: object "403": description: Forbidden examples: application/json: Message: "API not enabled" ErrorCode: 7 Detail: "This contract cannot be used in API" schema: properties: Message: description: Message. type: string ErrorCode: description: Error code. type: integer Detail: description: Detail. type: string type: object "404": description: Not Found examples: application/json: Message: "Contract not found" ErrorCode: 0 schema: properties: Message: description: Message. type: string ErrorCode: description: Error code. type: integer type: object "500": description: Internal Server Error examples: application/json: Message: "Internal server error" ErrorCode: 4 Detail: "" schema: properties: Message: description: Message. type: string ErrorCode: description: Error code. type: integer Detail: description: Detail. type: string type: object tags: - Frequency Switching summary: Cancels the schedule of a contract. x-codeSamples: - lang: cURL source: > curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/cancelSchedule' -H 'apiKey: {apiKey}' "/client/{clientCode}/contract/{contractId}/restartSchedule": post: produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID that you want to restart the schedule for. in: path name: contractId required: true type: string format: guid - description: An optional comment. in: query name: comment required: false type: string responses: "200": description: OK examples: application/json: Message: "Contract schedule was restarted successfully." schema: properties: Message: description: Message. type: string type: object "400": description: Bad Request examples: application/json: Message: "Validation error" ErrorCode: 3 Detail: "" schema: properties: Message: description: Message. type: string ErrorCode: description: Error code. type: integer Detail: description: Detail. type: string type: object "403": description: Forbidden examples: application/json: Message: "API not enabled" ErrorCode: 7 Detail: "This contract cannot be used in API" schema: properties: Message: description: Message. type: string ErrorCode: description: Error code. type: integer Detail: description: Detail. type: string type: object "404": description: Not Found examples: application/json: Message: "Contract not found" ErrorCode: 0 schema: properties: Message: description: Message. type: string ErrorCode: description: Error code. type: integer type: object "500": description: Internal Server Error examples: application/json: Message: "Internal server error" ErrorCode: 4 Detail: "" schema: properties: Message: description: Message. type: string ErrorCode: description: Error code. type: integer Detail: description: Detail. type: string type: object tags: - Frequency Switching summary: Restarts the schedule of a contract. x-codeSamples: - lang: cURL source: > curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/restartSchedule' -H 'apiKey: {apiKey}' "/client/{clientCode}/customer/{customerId}/contract": get: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The GUID of the customer (if the customer already exists). format: guid in: path name: customerId required: true type: string responses: "200": description: OK examples: application/json: Contracts: - Amount: 1 AtTheEnd: Expire Description: | Collect an initial £1.00 followed by 9 payments of £1.00 on 15th of the month ending on 25th April 2017 DirectDebitReference: LUISCT-MT000325 Every: 1 ExtraInitialAmounts: "" Id: 7aa8cef6-ec95-47a7-9ced-4aa0938559ab InitialAmount: 1 IsGiftAid: true NumberOfDebits: 10 PaymentDayInMonth: "15" PaymentMonthInYear: 7 ScheduleName: DD Dates 1/15 - Fixed Start: "2016-07-15T00:00:00.000Z" Status: Active StatusExplanation: N/A TerminationType: Take certain number of debits CustomerId: 19283a22-7442-4c92-b035-8fa7f5e6a9a0 application/xml: | 19283a22-7442-4c92-b035-8fa7f5e6a9a0 7aa8cef6-ec95-47a7-9ced-4aa0938559ab LUISCT-MT000325 DD Dates 1/15 - Fixed Collect an initial £1.00 followed by 9 payments of £1.00 on 15th of the month ending on 25th April 2017 7 15 2016-07-15T00:00:00 Take certain number of debits 10 1.00 1.00 1 true Expire Active N/A schema: properties: Contracts: description: Array of contracts for the given customer. items: $ref: "#/definitions/Contract" type: array CustomerId: description: Database GUID for the given customer. type: string format: guid type: object tags: - Contract Querying and Creation summary: Queries the database for a contract or set of contracts. x-codeSamples: - lang: C# name: C# (EazySDK) source: > var get = new Get(settings); string response = get.Contracts("310a826b-d095-48e7-a55a-19dba82c566f"); - lang: Python name: Python (EazySDK) source: > client = eazysdk.EazySDK() response = client.get.contracts("310a826b-d095-48e7-a55a-19dba82c566f") - lang: Java name: Java (EazySDK) source: > Get get = new Get(settings); String response = get.contracts("310a826b-d095-48e7-a55a-19dba82c566f"); - lang: cURL source: > curl -L -g -X GET 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/customer/{customerId}/contract' -H 'apiKey: {apiKey}' post: consumes: - application/json - application/xml produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The GUID of the customer (if the customer already exists). format: guid in: path name: customerId required: true type: string - description: The name of the schedule to be used when creating a contract. You must include either this or the `scheduleId` parameter. in: query maxLength: 200 name: scheduleName required: true type: string - description: The database GUID to be used when creating a contract. You must include either this or the `scheduleName` parameter. in: query format: guid name: scheduleId required: true type: string - description: > The start date of the contract. This **must** be at least 10 **working** days in the future, on a permitted date and not after the anticipated first payment date. If this is a regular schedule, use the same date as the first payment date. Only up to 364 days in advance. **Format: `YYYY-MM-DDT00:00:00.000`** format: date-time in: query name: start required: true type: string - description: > 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”. in: query maximum: 999 minimum: 0 name: numberOfDebits type: integer - description: > If the contract is set to take regular payments, this parameter allows you to skip periods (e.g. every 2 months, every 4 weeks etc). This field is only mandatory if the contract is **not** an ad-hoc contract. in: query name: every type: integer - description: > Pass true if the payments to be collected are to be subject to a gift aid claim, false if not (pass false if the client is not a charity). in: query name: isGiftAid required: true type: boolean - description: > 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. in: query multipleOf: 0.01 name: initialAmount type: number - description: | If there are extra charges to be collected with the first payment (e.g. a gym joining fee/registration fee) then these can be added separately with this parameter. Do not pass the parameter if there are no extra amounts, and this must not be used if the contract is an ad-hoc payment contract. in: query multipleOf: 0.01 name: extraInitialAmounts type: number - description: > 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. in: query multipleOf: 0.01 name: amount type: number - description: > 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. in: query multipleOf: 0.01 name: finalAmount type: number - description: > 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**. in: query maximum: 12 minimum: 1 name: paymentMonthInYear type: integer - description: > If the contract is for regular payments, then the day on 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**. **NOTE:** You may only select: - days **1** to **28** - **98**, which represents `Last working day of the Month` - **99**, which represents `Last day of the Month` equal with value 99. *You may not* select days 29, 30 or 31 of the month; choosing 29, 30 or 31 will result in payments being skipped in months that do not contain that date. enum: - 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 - 98 - 99 in: query name: paymentDayInMonth type: integer - description: > 1 -> Monday 2 -> Tuesday 3 -> Wednesday 4 -> Thursday 5 -> Friday If the contract is for regular payments and has a weekly frequency, pass the day of the week that you wish payments to be collected via 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 **weekly**. in: query maximum: 5 minimum: 1 name: paymentDayInWeek type: integer - description: > Pass the way in which the contract should end using this parameter. If the contract is **ad-hoc,** *you must* pass `Until further notice`. enum: - Take certain number of debits - Until further notice - End on exact date in: query name: terminationType required: true type: string - description: > This 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`. enum: - Expire - Switch to Further Notice in: query name: atTheEnd required: true type: string - description: > If the `terminationType` is `End on Exact Date` then the termination date should be passed using this. **Format: `YYYY-MM-DDT00:00:00.000`** format: date-time in: query name: terminationDate type: string - description: > If you wish to add an additional reference to the contract for you own use, this can be passed to using the `additionalReference` parameter. in: query maxLength: 200 name: additionalReference type: string - description: > **THIS PARAMETER SHOULD ONLY BE USED IF YOU HAVE BEEN INSTRUCTED TO DO SO** If you have made arrangements with us to use a custom direct debit referencing scheme, pass the custom direct debit using this parameter. The field may only contain alphanumeric data (`a-z`, `A-Z`, `0-9`) and certain special characters (whitespace, ampersand `&`, hyphen `-`, solidus `/` or full stop `.`). in: query maxLength: 18 name: customDirectDebitRef type: string - description: > Example JSON/XML payload. in: body name: body schema: example: ScheduleName: adhoc_monthly_free Start: "2019-08-01T00:00:00.000" IsGiftAid: false TerminationType: Until further notice AtTheEnd: Switch to further notice type: object xml: name: ContractRequestDto responses: "200": description: OK examples: application/json: DirectDebitRef: LUISCT-MT000341 Id: e39940cc-9917-4b9e-8da4-5da4866862f1 application/xml: > LUISCT-MT000340 f98c6339-6cdf-4ea6-8523-ea2bd17aedb7 schema: properties: Id: description: > The GUID of the contract record. You must save this to your database as it will be needed should you wish to update the contract or create ad-hoc payments using the payments or bulk payments call. type: string Message: description: This will be `null`. type: object directDebitRef: description: > This is the Direct Debit Reference that will be quoted to the customer’s bank when collecting funds. Some banks will show this reference on the customer’s statement, although this is not guaranteed. type: string type: object "400": description: Bad request - invalid schedule name examples: application/json: Message: > {scheduleName} is not given to any schedule of any service as a name application/xml: | {scheduleName} is not given to any schedule of any service as a name tags: - Contract Querying and Creation description: > For ad-hoc contracts, you will only need to pass `scheduleName`, `start`, `terminationType`, `atTheEnd` and `isGiftAid`. ### Contract Statuses Upon creation, a Contract Status will read "Active". While a newly created contract is awaiting its first collection, it is inadvisable to attempt to make changes to the contract or to push ad-hoc payments to the contract as payments may be missed or marked unpaid without an attempt to collect being made. We recommend allowing the lead times that apply to your configuration to elapse before making changes to the contract or pushing ad-hoc payments into the system. A contract can be manifested in one of two ways: | Status | Description | ------ | --------------------------------------------- | **Active** | The contract is active and will either be producing payments if it is a scheduled contract, or able to accept ad-hoc payments if it is an ad-hoc contract. | **Inactive** | The contract has been cancelled and is no longer active. It cannot produce or accept payments, scheduled or otherwise. For more information on a contract's status, the `StatusExplanation` field can provide a more detailed explanation. This field is free text and we recommend that it is stored and displayed to the end user as necessary. ### Timeframes You should also be aware that you must allow a minimum number of clear working days between setting up a contract and collecting the first payment, and a minimum number of clear working days between pushing a second or subsequent ad-hoc payment and its collection date on an active contract. The number of days required is configured per client and is not the same for all clients, so you should refer to the lead times that apply to your own configuration. A working day means a banking day in the United Kingdom which is Mondays to Fridays and excludes public and bank holidays. A list of public and bank holidays can be found here: . A date checker is also provided on our website: . While the above timeframes are the minimum required, we strongly recommend building yourself a day or two of contingency into your processes so that you have time to rectify any problems that may be encountered. We are unable under any circumstances to accept instructions for payments or new contracts after the appropriate cut off dates. summary: Creates a contract in the database. x-codeSamples: - lang: C# name: C# (EazySDK) source: > var post = new Post(settings); string request = post.contract("310a826b-d095-48e7-a55a-19dba82c566f", "adhoc_monthly_free", "2019-08-01", false, "Until further notice", "Switch to further notice"); - lang: Python name: Python (EazySDK) source: > client = eazysdk.EazySDK() request = client.post.contract('42217d45-cf22-4430-ab02-acc1f8a2d020', 'test_schedule', '2019-05-07', False, 'Until further notice', 'Switch to further notice', additional_reference='test_123') - lang: Java name: Java (EazySDK) source: > Post post = new Post(settings); String request = post.contract().customer("310a826b-d095-48e7-a55a-19dba82c566f") .scheduleName("adhoc_monthly_free").startDate("2019-08-01").giftAid(false) .terminationType("Until further notice").atTheEnd("Switch to further notice").query(); - lang: cURL source: > curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/customer/{customerId}/contract?scheduleName=adhoc_monthly_free&start=2019-08-01&isGiftAid=false&terminationType=Until further notice&atTheEnd=Switch to further notice' -H 'apiKey: {apiKey}' "/client/{clientCode}/schedules": get: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string responses: "200": description: OK examples: application/json: Services: - RefPrefix: AN RefProtocol: Auto-number RefTo: "null," Schedules: - AllowDifferentFirstPayment: true AllowDifferentLastPayment: false AllowFreeMonthDaySelection: false AllowFreeMonthSelection: true AllowFreeWeekDaySelection: true AtTheEnd: Switch to further notice DayOfWeek: Free DaysOfMonth: "15,24" Description: | Annually > Every 1 year > 15th, 24th of any month customer's choice) > First , then on a regular basis Every: 1 ExtraInitialPayments: "" Frequency: Annually IsExpiryDateReached: false IsNotScheduled: false IsSuspended: false MonthOfYear: Free Name: AN Dates 15/24 - Rolling RegistrationCharge: 0 ScheduleId: 7663e3a0-514c-4ec7-808e-05d27a85fa98 StartType: As soon as possible TerminationType: Until further notice Title: Annual Membership application/xml: > Annual Membership Auto-number AN null 7663e3a0-514c-4ec7-808e-05d27a85fa98 AN Dates 15/24 - Rolling Annually > Every 1 year > 15th, 24th of any month customer's choice) > First , then on a regular basis true false false true true Switch to further notice Free 15,24 1 Annually false false false Free 0 As soon as possible Until further notice tags: - Obtaining Available Schedules description: > The response is split into two parts as follows: 1. Services Services give some general set-up detail for the underlying payment schedules: - Title - RefProtocol - RefPrefix - RefFrom - RefTo 2. Schedules sit underneath Services and these are allocated to the customer in order to collect payments. The parameters returned are as follows: - ScheduleId - Name - Deacription - AllowDifferentFirstPayment - AllowDifferentLastPayment - AllowFreeMonthDaySelection - AllowFreeMonthSelection - AllowFreeWeekDaySelection - Amount - AtTheEnd - DayOfWeek - DaysOfMonth - Every - ExpectedNumberOfPayments - ExtraInitialPayments - FinalAmount - Frequency - InitialAmount - IsExpiryDateReached - IsNotScheduled - IsSuspended - MonthOfYear - RegistrationCharge - Start - StartType - TerminationDate - TerminationType summary: Queries the database for details of existing schedules. x-codeSamples: - lang: C# name: C# (EazySDK) source: | var get = new Get(settings); string response = get.Schedules(); - lang: Python name: Python (EazySDK) source: | client = eazysdk.EazySDK() response = client.get.schedules() - lang: Java name: Java (EazySDK) source: | Get get = new Get(); String response = get.schedules(); - lang: cURL source: > curl -L -g -X GET 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/schedules' -H 'apiKey: {apiKey}' "/client/{clientCode}/contract/{contractId}/patch/changeamount": post: consumes: - application/json - application/xml produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID on which to add the patch. format: guid in: path name: contractId required: true type: string - description: Start date of the patch. format: datetime in: query name: from required: true type: string - description: End date of the patch. format: datetime in: query name: to required: true type: string - description: Sets the contract's effective amount during the patch period. format: decimal in: query name: amount required: true type: number - description: Comment for the patch. in: query name: comment required: true type: string - description: > Example JSON/XML payload. in: body name: body schema: example: Comment: Price increase From: "2021-12-05T00:00:00" To: "2021-12-15T00:00:00" Amount: 9.99 type: object xml: name: PatchChangeAmountRequestDto responses: "200": description: OK examples: application/json: Message: New Patch added to contract "400": description: Bad Request - Overlapping patches examples: application/json: Detail: This Patch overlaps with an existing Patch for the same Contract. Please check dates. ErrorCode: 3 Message: Validation error "404": description: Contract not found examples: application/json: error: The requested resource is not found tags: - Patches summary: Adds a patch to change payment amount for a contract. "/client/{clientCode}/contract/{contractId}/patch/skip": post: consumes: - application/json - application/xml produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID on which to add the patch. format: guid in: path name: contractId required: true type: string - description: Start date of the patch. format: datetime in: query name: from required: true type: string - description: End date of the patch. format: datetime in: query name: to required: true type: string - description: Comment for the patch. in: query name: comment required: true type: string - description: > Example JSON/XML payload. in: body name: body schema: example: Comment: Payment pause From: "2021-12-05T00:00:00" To: "2021-12-15T00:00:00" type: object xml: name: PatchCollectionRequestDto responses: "200": description: OK examples: application/json: Message: New Patch added to contract "400": description: Bad Request - Overlapping patches examples: application/json: Detail: This Patch overlaps with an existing Patch for the same Contract. Please check dates. ErrorCode: 3 Message: Validation error "404": description: Contract not found examples: application/json: error: The requested resource is not found tags: - Patches summary: Adds a patch to skip collections for a contract. "/client/{clientCode}/contract/{contractId}/patch/freeze": post: consumes: - application/json - application/xml produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID on which to add the patch. format: guid in: path name: contractId required: true type: string - description: Start date of the patch. format: datetime in: query name: from required: true type: string - description: End date of the patch. format: datetime in: query name: to required: true type: string - description: Comment for the patch. in: query name: comment required: true type: string - description: > Example JSON/XML payload. in: body name: body schema: example: Comment: Payment pause From: "2021-12-05T00:00:00" To: "2021-12-15T00:00:00" type: object xml: name: PatchCollectionRequestDto responses: "200": description: OK examples: application/json: Message: New Patch added to contract "400": description: Bad Request - Overlapping patches examples: application/json: Detail: This Patch overlaps with an existing Patch for the same Contract. Please check dates. ErrorCode: 3 Message: Validation error "404": description: Contract not found examples: application/json: error: The requested resource is not found tags: - Patches summary: Adds a patch to freeze collections for a contract. "/client/{clientCode}/contract/{contractId}/patches": get: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID on which the patches have been applied to. format: guid in: path name: contractId required: true type: string responses: "200": description: OK examples: application/json: 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 schema: properties: Patches: description: Array of Patches applied to this contract. type: array items: $ref: "#/definitions/Patch" "404": description: Contract not found examples: application/json: error: The requested resource is not found tags: - Patches summary: Returns all patches applied to a given contract. "/client/{clientCode}/contract/{contractId}/patch/{patchId}": get: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID on which the patch has been applied to. format: guid in: path name: contractId required: true type: string - description: The patch GUID. format: guid in: path name: patchId required: true type: string responses: "200": description: OK examples: application/json: 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 schema: $ref: "#/definitions/Patch" "404": description: Contract/patch not found examples: application/json: ErrorCode: 0 Detail: null Message: Patch not found tags: - Patches summary: Gets details of a specific patch. patch: consumes: - application/json - application/xml produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID on which the patch has been applied to. format: guid in: path name: contractId required: true type: string - description: The patch GUID. format: guid in: path name: patchId required: true type: string - description: The new end date to set for this patch. format: datetime in: query name: to required: true type: string - description: A comment for this update. in: query name: comment required: true type: string - description: > Example JSON/XML payload. in: body name: body schema: example: To: "2021-12-15T00:00:00.000" Comment: Extend patch type: object xml: name: PatchUpdateRequestDto responses: "200": description: OK examples: application/json: Message: Patch updated "400": description: Bad Request - Invalid To date examples: application/json: ErrorCode: 3 Detail: To date should be greater than From Date. Please check patch dates Message: Validation error "404": description: Contract/patch not found examples: application/json: ErrorCode: 0 Detail: null Message: Patch not found tags: - Patches summary: Updates the end date of a patch. delete: produces: - application/json - application/xml parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract GUID on which the patch has been applied to. format: guid in: path name: contractId required: true type: string - description: The patch GUID. format: guid in: path name: patchId required: true type: string responses: "200": description: OK examples: application/json: Message: Patch deleted "404": description: Contract/patch not found examples: application/json: ErrorCode: 0 Detail: null Message: Patch not found tags: - Patches summary: Deletes a patch. "/client/{clientCode}/ddcmsdirect/import": post: consumes: - multipart/form-data produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: | The file to be imported. Must be in one of the supported formats: BACS Standard 18, BACS Standard 18 Payment Lines, SmartDebit Direct CSV, or BACS Active (EaziPay). in: formData name: file required: true type: file - description: | The file format type, which determines which structural validation rules are applied to the uploaded file. Must be one of the following values: - `bacs_standard_18` - BACS Standard 18 - `bacs_standard_18_payment_lines` - BACS Standard 18 Payment Lines - `smartdebit_direct_csv` - SmartDebit Direct CSV - `bacs_active_eazipay` - BACS Active (EaziPay) in: formData name: fileType required: true type: string enum: - bacs_standard_18 - bacs_standard_18_payment_lines - smartdebit_direct_csv - bacs_active_eazipay responses: 200: description: File imported successfully schema: properties: status: type: string description: Returns `success` when the file has been imported. fileId: type: string format: uuid description: | The unique idenitifer assigned to the imported file. You should save this for future reference. importedAt: type: string format: date-time description: The date/time at which the file was imported. message: type: string description: A human-readable message confirming the import. fileStatus: type: string description: The current status of the file. Will be `Queued for validation` on a successful import. nextSteps: type: string description: Guidance on what to do next after a successful import. type: object examples: application/json: status: success fileId: 3fa85f64-5717-4562-b3fc-2c963f66afa6 importedAt: "2024-01-20T15:30:00Z" message: File imported successfully fileStatus: Queued for validation nextSteps: >- File is queued for validation. Check DDCMS Direct UI for validation results and any required actions such as SUN assignment or processing date selection. 400: description: | Bad request. This can occur for several reasons: - **Missing `fileType` parameter:** The `fileType` form field was not included in the request. - **Invalid `fileType` value:** The `fileType` value is not one of the supported file types. - **Missing or empty `file`:** The `file` form field was not included or the file is empty. - **Request not `multipart/form-data`:** The request `Content-Type` is not `multipart/form-data`. - **Structural validation failure:** The file was parsed but failed structural/format validation checks. schema: properties: status: type: string description: | Returns `error` for parameter issues, or `validation_failed` for structural validation features. message: type: string description: A human-readable description of the error. errors: type: array description: | Only present when `status` is `validation_failed`. An array of structural validation errors found in the file. items: type: object properties: category: type: string description: The category of the error (e.g. `structural_validation`, `file_format`). message: type: string description: A human-readable description of the specific validation error. errorType: type: string description: Only present when `status` is `validation_failed`. Returns `structural`. supportedFileTypes: type: array items: type: string description: | Only present when the error is caused by an invalid `fileType` value. Lists the supported file type keys. type: object examples: Missing fileType parameter: status: error message: fileType parameter is required Invalid fileType value: status: error message: >- Invalid fileType value. Must be one of the supported file types. supportedFileTypes: - bacs_standard_18 - bacs_standard_18_payment_lines - smartdebit_direct_csv - bacs_active_eazipay Missing or empty file: status: error message: file is required and must not be empty Request not multipart: status: error message: Request must be multipart/form-data Structural validation failure: status: validation_failed message: File structural validation failed errors: - category: structural_validation message: >- Invalid BACS Standard 18 file structure: Missing HDR2 header record - category: structural_validation message: File does not match selected format type errorType: structural 403: description: Forbidden - DDCMS Direct feature not enabled for this client schema: properties: status: type: string message: type: string type: object examples: application/json: status: error message: DDCMS Direct feature not enabled for this client 413: description: Request Entity Too Large - the uploaded file exceeds the maximum allowed size of 137000000 bytes (130 MB) schema: properties: status: type: string message: type: string maxFileSizeBytes: type: integer description: The maximum file size allowed, in bytes (137000000). type: object examples: application/json: status: error message: File exceeds the maximum allowed size maxFileSizeBytes: 137000000 500: description: | Internal Server Error. This may occur if: - The API user is not configured in the system. - An unexpected error occurred during processing. schema: properties: status: type: string message: type: string type: object examples: application/json: status: error message: An internal server error occurred tags: - DDCMS Direct File Import summary: Imports a BACS payment file via the API for processing through DDCMS Direct. description: | Imports a file into DDCMS Direct for processing through the existing approval workflows. The file undergoes initial structural validation based on the specified `fileType`. If validation passes, the file is stored and queued for further validation. **Prerequisites:** - The client must have the DDCMS Direct feature enabled. - The request must be sent as `multipart/form-data`. - Both `file` and `fileType` form fields are required. **Upload Attribution:** Files uploaded via this endpoint are recorded as "Uploaded by: API User". The file will appear in the DDCMS Direct UI and on the home screen with "API User" attribution. When a user subsequently interacts with the file, the attribution transfers to that user to ensure correct approval workflows. **After a Successful Import:** The file will have status "Queued for validation". Check the DDCMS Direct UI for validation results and any required actions such as SUN assignment or processing date selection. security: - ApiKeyAuth: [] x-codeSamples: - lang: cURL source: | curl -L -g -X POST \ 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/ddcmsdirect/import' \ -H 'apiKey: {apiKey}' \ -F 'file=@/path/to/payment-file.txt' \ -F 'fileType=bacs_standard_18' - lang: C# source: | using (var client = new HttpClient()) { client.DefaultRequestHeaders.Add("apiKey", "{apiKey}"); using (var content = new MultipartFormDataContent()) { var fileContent = new ByteArrayContent(File.ReadAllBytes("/path/to/payment-file.txt")); fileContent.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); content.Add(fileContent, "file", "payment-file.txt"); content.Add(new StringContent("bacs_standard_18"), "fileType"); var response = await client.PostAsync( "https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/ddcmsdirect/import", content); var result = await response.Content.ReadAsStringAsync(); } } - lang: Python source: | import requests url = "https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/ddcmsdirect/import" headers = {"apiKey": "{apiKey}"} files = {"file": open("/path/to/payment-file.txt", "rb")} data = {"fileType": "bacs_standard_18"} response = requests.post(url, headers=headers, files=files, data=data) print(response.json()) - lang: Java source: | HttpClient client = HttpClient.newHttpClient(); Path filePath = Path.of("/path/to/payment-file.txt"); String boundary = UUID.randomUUID().toString(); String body = "--" + boundary + "\r\n" + "Content-Disposition: form-data; name=\"fileType\"\r\n\r\n" + "bacs_standard_18\r\n" + "--" + boundary + "\r\n" + "Content-Disposition: form-data; name=\"file\"; filename=\"payment-file.txt\"\r\n" + "Content-Type: application/octet-stream\r\n\r\n" + Files.readString(filePath) + "\r\n" + "--" + boundary + "--"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/ddcmsdirect/import")) .header("apiKey", "{apiKey}") .header("Content-Type", "multipart/form-data; boundary=" + boundary) .POST(HttpRequest.BodyPublishers.ofString(body)) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); "/client/{clientCode}/unpaidPaymentRetrySettings": get: produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string responses: "200": description: OK schema: $ref: "#/definitions/UnpaidPaymentRetrySettings" examples: application/json: AllowRetryFailedPayments: true RetryPaymentsDelayDays: 10 FailedPaymentRetries: 2 tags: - Configurable Represents summary: Returns the current retry configuration for your client. description: Returns the current retry configuration for your client. x-codeSamples: - lang: cURL source: > curl -L -g -X GET 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/unpaidPaymentRetrySettings' -H 'apiKey: {apiKey}' patch: consumes: - application/json produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The updated retry settings for your client. in: body name: body required: true schema: $ref: "#/definitions/UpdateUnpaidPaymentRetrySettingsRequest" responses: "200": description: OK - Returns the updated retry settings. schema: $ref: "#/definitions/UnpaidPaymentRetrySettings" examples: application/json: AllowRetryFailedPayments: true RetryPaymentsDelayDays: 10 FailedPaymentRetries: 2 tags: - Configurable Represents summary: Updates the retry configuration for your client. description: Updates the retry configuration for your client. x-codeSamples: - lang: cURL source: > curl -L -g -X PATCH 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/unpaidPaymentRetrySettings' -H 'apiKey: {apiKey}' -H 'Content-Type: application/json' --data-raw '{ "AllowRetryFailedPayments": true, "RetryPaymentsDelayDays": 10, "FailedPaymentRetries": 2 }' "/client/{clientCode}/contract/{contractId}/payment/{paymentId}/retry": post: consumes: - application/json produces: - application/json parameters: - description: The client code provided in your welcome email. in: path maxLength: 6 name: clientCode required: true type: string - description: The contract ID for the payment. format: guid in: path name: contractId required: true type: string - description: The payment ID to represent. format: guid in: path name: paymentId required: true type: string - description: The date the re-presented payment should be collected. in: body name: body required: true schema: $ref: "#/definitions/ManuallyRepresentPaymentRequest" responses: "200": description: OK "400": description: >- Bad Request - payment not eligible, processing date is not a valid working day, date exceeds Bacs limit, or required fields are missing. "401": description: Unauthorised - invalid or missing API key. "403": description: Forbidden - the payment belongs to a different client. "404": description: Not Found - payment or contract not found. tags: - Configurable Represents summary: Triggers a re-presentation for a specific failed payment. description: > Triggers a re-presentation for a specific failed payment. The payment must be eligible: within 1 calendar month of the original payment date, the Direct Debit Instruction must be active, and the payment must not already be in a Pending or Paid status. x-codeSamples: - lang: cURL source: > curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/contract/{contractId}/payment/{paymentId}/retry' -H 'apiKey: {apiKey}' -H 'Content-Type: application/json' --data-raw '{ "ProcessingDate": "2026-06-21T00:00:00.000Z" }' definitions: AddressDetail: description: Address of the customer. type: object properties: Line1: description: Line 1 of the customer's address. type: string Line2: description: Line 2 of the customer's address. type: string Line3: description: Line 3 of the customer's address. type: string Line4: description: Line 4 of the customer's address. type: string PostCode: description: The customer's registered postcode. type: string Answer: description: Answer to a custom question. type: object properties: Id: description: Unique ID for the answer. type: string format: guid Product: description: If the question is a ServiceCustomQuestion, returns the service the question belongs to. Otherwise, returns `null`. type: string format: guid Customer: description: Unique ID for the customer. type: string format: guid CustomQuestion: description: Unique ID for the question the answer is for. type: string format: guid Answer: description: Actual value of the answer. type: string BankDetail: description: Details of the customer's bank account. type: object properties: AccountHolderName: description: Name on the account. type: string AccountNumber: description: The eight-digit account number. type: string BankSortCode: description: The six-digit bank sort code. type: string BulkPayment: description: Single ad-hoc payment request used in bulk adding payments. type: object properties: amount: description: The amount to be collected. multipleOf: 0.01 type: number comment: description: > A comment relating to the payment (which can be recalled using the GET method). maxLength: 200 type: string contract: description: >- The contract GUID that you wish to collect a payment against. format: guid type: string date: description: > The date on which the payment should be collected. This **must** be at least 5 **working** days in the future, on a permitted date and not before the start date set when creating the contract. **Format: `YYYY-MM-DDT00:00:00.000`** format: date-time type: string isCredit: description: > If you have an own SUN and you have agreed by prior arrangement with your account manager that you may issue credits, pass `true` with this parameter to issue a credit to the customer. If omitted, this will be a debit. type: boolean required: - amount - contract - date BulkPaymentRequest: description: Payload for the bulk adding payments request. type: object properties: Payments: description: Array of payments to be inserted in bulk. type: array items: $ref: "#/definitions/BulkPayment" CallbackEntities: description: The entity for which to receive callback BACS messages. enum: - bulkpayment - customer - contract - payment - schedule type: string ClientListPaymentsRequest: description: Payload for the `/client/{clientCode}/payments` endpoint. type: object properties: PageNumber: description: Page number for the pagination. type: number default: 1 PageSize: description: Number of payment records to return per page. type: number default: 100 ContractId: description: Unique ID for a particular contract you want to list payments for. type: string format: uuid CustomerId: description: | Unique ID for a particular customer you want to list payments for. **Note:** this will be ignored if `ContractId` is also provided. type: string format: uuid IsCredit: description: | Set to `true` to only return credit payments. Set to `false` to only return debit payments. type: boolean IsScheduled: description: | Set to `true` to only return payments generated by DDCMS on a regular/fixed schedule. Set to `false` to only return ad-hoc payments. type: boolean Status: description: Set to only return payments with a particular status. type: string enum: - Indemnity Claimed - Paid - Pending - Represented - Unpaid - withdrawn Type: description: Set to only return payments of a particular type. type: string enum: - Credit - Final - First Time - Regular - Retry CollectionDateFrom: description: Earliest `Due` date to return payments for. type: string format: date-time CollectionDateTo: description: Latest `Due` date to return payments for. type: string format: date-time CreatedAfter: description: Earliest `DateAdded` date to return payments for. type: string format: date-time CreatedBefore: description: Latest `DateAdded` date to return payments for. type: string format: date-time Contract: properties: Amount: description: If the contract is for regular payments, then the regular payment amount is returned in this parameter. type: number AtTheEnd: description: This parameter decides what will happen when the contract ends. enum: - Expire - Switch to Further Notice type: string Description: description: A description of the contract. This can include number of payments, payment amount, end date etc. type: string DirectDebitReference: description: The bank reference for the contract. type: string Every: description: If the contract is set to take regular payments, this parameter shows the frequency of payments generated (e.g. every 2 months, every 4 weeks etc). type: integer ExtraInitialAmounts: description: If there are extra charges to be collected with the first payment (e.g. a gym joining fee/registration fee) then these are shown separately with this parameter. type: number Id: description: The DDCMS database GUID for this contract. format: guid type: string InitialAmount: description: If this is a contract for regular payments and the first payment is different to the regular payments, then the first payment amount is passed with this parameter. type: number IsGiftAid: description: Whether or not payments for the contract are subject to a gift aid claim. type: boolean NumberOfDebits: description: If this is a “Take Certain Number of Debits” contract then the number of debits to be taken are returned in this parameter. type: integer PaymentDayInMonth: description: If the contract is for regular payments, then the day on which the first payment is taken is returned with this parameter. type: string enum: - 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 - Last Day of the Month PaymentMonthInYear: description: If the contract is for regular payments then the month in which the first payment is taken is returned with this parameter. maximum: 12 minimum: 1 type: integer ScheduleName: description: The name of the schedule the contract was setup against. type: string Start: description: The start date of the contact. format: date-time type: string Status: description: The current status of the contract. type: string enum: - Inactive - Expired - Cancelled - Pause - Suspended - Cancellation Pending - Active - Creation Pending StatusExplanation: description: Provides an explanation for the most recent status update for the contract. type: string TerminationType: description: How this contract will end. type: string enum: - Take certain number of debits - Until further notice - End of exact date Customer: properties: AddressDetail: $ref: "#/definitions/AddressDetail" BankDetail: $ref: "#/definitions/BankDetail" CompanyName: description: The customer's registered company. type: string CustomerRef: description: The unique customer reference. type: string DateAdded: description: Datetime for when this customer was created in the database. type: string format: datetime DateOfBirth: description: The customer's date of birth. type: string format: datetime Email: description: The customer's email address. type: string format: email FirstName: description: First name of the customer. type: string HomePhoneNumber: description: The customer's home phone number. type: string Id: description: The GUID for this customer object. type: string format: guid IsArchived: description: Returns true if all of the customer's contracts are archived, otherwise false. type: boolean Memos: description: Memos for this customer. When calling `GET /customer` with `includeMemos=false`, this will be `null`. type: array items: $ref: "#/definitions/CustomerMemo" MobilePhoneNumber: description: The customer's mobile phone number. type: string Surname: description: Last name of the customer. type: string Title: description: The customer's preferred title. type: string enum: [Mrs, Mr, Miss, Ms, Dr, Sir, Lord, Lady, Prof., Rev., Master, Mx] WorkPhoneNumber: description: The customer's work phone number. type: string type: object CustomerMemo: description: Memo attached to a customer's contract. type: object properties: At: description: Datetime for when the memo was added. type: string format: datetime Body: description: HTML body of the memo. type: string ContractRef: description: Direct Debit reference for the contract the memo was assigned to. type: string ManuallyRepresentPaymentRequest: description: Request body for manually triggering a re-presentation for a specific failed payment. type: object required: - ProcessingDate properties: ProcessingDate: description: >- The date the re-presented payment should be collected. Must be a working day within 1 calendar month of the original payment date. type: string format: date-time PagingMetadata: description: Object providing useful metadata for clients calling an endpoint with pagination. type: object properties: TotalPages: description: Total count of pages. type: number TotalRecords: description: Count of records with current filter. type: number PageSize: description: Number of records returned per page. type: number PageNumber: description: Current page. type: number Patch: properties: Amount: description: If type is `Change amount`, defines the effective contract amount during this patch. format: decimal type: number Comment: description: A user-defined comment for this patch. type: string DateAdded: description: Date-time this patch was added in the system. format: datetime type: string DateFrom: description: Start date for the patch. format: datetime type: string DateTo: description: End date for the patch. format: datetime type: string Id: description: The GUID for this patch object. format: guid type: string Type: description: Type of patch. enum: - Change amount - Freeze collect (leave contract as is) - Skip collection (adjusts contract) type: string Payment: properties: Amount: description: The amount of the payment. type: number Comment: description: | The comment passed when the payment was added; a ReasonMessage may be appended to the end of this. type: string Date: description: The due date of the payment. format: date-time type: string Id: description: > The GUID of the payment. We suggest that you save this so that you can easily change or query the payment in future. If you are using pushed return data, this will be included in any payload delivered concerning the payment. format: guid type: string IsAdhoc: description: | If this is an adhoc payment, this will show as `true`, else if it is a scheduled payment, it will shows as `false`. type: boolean IsCredit: description: > If the payment is a credit to the customer, this will show as `true`, else it will show as `false`. type: boolean ReasonCode: description: > The BACS reason code of the payment if the payment has been returned unpaid. The possible reasons are: - 0: Refer to payer. - 1: Instruction cancelled. - 2: Payer deceased. - 3: Account transferred. - 4: Advance notice disputed. - 5: No account/Wrong account type. - 6: No instruction. - 7: Amount differs. - 8: Amount not yet due. For further details on the meanings of these codes, and the associated action required, please see our separate booklet. maximum: 8 minimum: 0 type: integer ReasonMessage: description: Plain text explanation of the ReasonCode. type: string Status: description: > The status of the payment. This can be: - Paid - We have received the payment from the customer (\*\*see below) - Pending – The payment has been queued to be sent to the bank for collection. - Represented – The payment has been returned by the bank **unpaid**, and the system has created a new transaction to try and collect the amount again. - Unpaid – The payment has been returned by the bank unpaid and **will not** be sent again to the bank for collection. - Withdrawn – The payment was at the point of being sent to the bank for collection, but was withdrawn by Access Paysuite at the last minute. The payment has not been collected. - Indemnity Claimed – The customer has approached their bank for a refund which is being/has been processed. \*\* BACS works by exception; that is to say that payments are assumed to be paid unless we hear from the bank otherwise. As such, payments remain in the `Pending` state up until the point they are submitted to the bank for collection (3 – 4 working days before the collection date). Upon submission, the payment status changes to `Paid` although the actual status of the payment is not known until 1-2 working days after the due date. Because of this, we recommend that you do not update your system with the payment status until 2-3 working days after the Due Date. It is also important to note that BACS only works on banking days (Monday to Friday excluding bank and public holidays). For that reason, if a payment Due Date is on a weekend or a public holiday, the collection will take place on the next banking day. For example, a payment due on Saturday, 15th April 2017 will actually collect on Tuesday 18th April 2017 (the Monday being Easter Monday which is a bank holiday in the UK). Again, this needs to be factored in to when you check the status of payments; in the above example, it would be prudent to wait until late in the afternoon of 20th April 2017 or better 21st April 2017 to ensure that all unpaid messages have been received from the bank and processed. enum: - Paid - Pending - Represented - Unpaid - Withdrawn - Indemnity Claimed type: string Type: description: | The type of payment (BACS being a bank processed payment, Manual being something manually added via the UI. type: string type: object Question: properties: Id: description: Unique ID for this question. We recommend you keep a record of this as it's required for adding answers. type: string format: guid Label: description: Label for the question. type: string Type: description: Data type for answers to this question. type: string enum: - text - list - date Options: description: Comma-separated list of possible answers for this question. Can only be used when type is `list`. type: array items: type: string Tags: description: | A custom tag that was assigned to this question. If the question was created from an eDD page, this will be populated with the end of the URL to the page. For example, if the question was added on `https://secure.edirectdebit.co.uk/Example/DD-Signups`, the Tags would be `DD-Signups`. type: string IsMandatory: description: Whether or not an answer is required for this question. type: boolean StreamVersion: properties: Id: description: The stream version identifier. type: string format: guid Status: description: Status. type: string IsPatch: description: Is patch. type: boolean StartDate: description: Start date. type: string format: datetime Frequency: description: Frequency. type: string Every: description: Every. type: integer PaymentDayInWeek: description: Payment day in week. type: integer PaymentDayInMonth: description: Payment day in month. type: integer PaymentMonthInYear: description: Payment month in year. type: integer InitialDate: description: Initial date. type: string format: datetime InitialAmount: description: Initial amount. type: number format: decimal RegistrationFee: description: Registration fee. type: number format: decimal ExtraInitialAmounts: description: Extra initial amounts. type: string Amount: description: Amount. type: number format: decimal FinalAmount: description: Final amount. type: number format: decimal IsGiftAid: description: Is gift aid. type: boolean TerminationType: description: Termination type. type: string TerminationDate: description: Termination date. type: string format: datetime NumberOfDebits: description: Number of debits. type: integer UnpaidPaymentRetrySettings: description: Retry configuration for unpaid (failed) payments for a client. type: object properties: AllowRetryFailedPayments: description: Whether Configurable Represents is enabled for your organisation. type: boolean RetryPaymentsDelayDays: description: Number of working days configured between a failed payment and its re-presentation. type: integer FailedPaymentRetries: description: Maximum number of retry attempts configured (1-3). type: integer UpdateCustomerJsonRequest: description: >- Request body for updating (or partially updating) an existing customer via JSON. Send only the fields you want to change. type: object properties: Email: description: The customer's contact email address. type: string maxLength: 200 Title: description: The customer's title (Mr/Mrs/Ms/Miss/Mx etc). type: string maxLength: 200 DateOfBirth: description: | The customer's date of birth. **Format: `YYYY-MM-DDT00:00:00.000`** type: string format: date-time CustomerRef: description: >- A unique reference number allocated by the client for this customer. type: string maxLength: 200 FirstName: description: The customer's first name. type: string maxLength: 200 Surname: description: The customer's surname. type: string maxLength: 200 CompanyName: description: The company name of the customer (if applicable). type: string maxLength: 200 PostCode: description: The customer's Post Code. type: string maxLength: 10 AccountNumber: description: > The customer's bank account number. This must be eight numerical characters with all leading zeros left intact. Examples include: `01065284`, `00000000`, `26280464`. Any non-numerical characters **must be removed** before passing the data to the API. type: string maxLength: 8 minLength: 8 pattern: "[0-9]{8}" BankSortCode: description: > The customer's bank sort code. This must be six numerical characters with all leading zeros left intact. Examples include: `089286` `100000` `600000`, `230580`. In the United Kingdom it is sometimes customary to insert dashes/hyphens between groups of two characters (e.g. `08-92-86`, `23-05-80`). Any hyphens, dashes or non-numerical characters **must be removed** before being passed to the API. type: string maxLength: 6 minLength: 6 pattern: "[0-9]{6}" AccountHolderName: description: > The name of the customer's bank account. This must be a maximum of eighteen alphanumeric characters `[0-9a-zA-Z ]`. A space is also allowed. Any special characters or punctuation such as ampersands, apostrophes, hyphens, slashes, backslashes, commas, full stops etc. **must be removed** before passing to the API. type: string maxLength: 18 pattern: "[0-9a-zA-Z ]{0, 18}" HomePhoneNumber: description: The customer's home telephone number. type: string maxLength: 200 WorkPhoneNumber: description: The customer's work telephone number. type: string maxLength: 200 MobilePhoneNumber: description: The customer's mobile telephone number. type: string maxLength: 200 Line1: description: Line one of the customer's postal address. type: string maxLength: 200 Line2: description: Line two of the customer's postal address. type: string maxLength: 200 Line3: description: Line three of the customer's postal address. type: string maxLength: 200 Line4: description: Line four of the customer's postal address. type: string maxLength: 200 Initials: description: >- If the customer has provided any middle initials, they can be added in this field. type: string maxLength: 200 CustomerLocale: description: >- Set the language of communications sent to this customer to English (`en-GB`) or Welsh (`cy-GB`). If omitted, this defaults to English. If Welsh support is not enabled for your organisation, submitting `cy-GB` returns a 400 error with the message: **"Welsh language not enabled for this client"**. type: string maxLength: 5 enum: - en-GB - cy-GB UpdateUnpaidPaymentRetrySettingsRequest: description: Request body for updating the retry configuration for a client. type: object required: - AllowRetryFailedPayments properties: AllowRetryFailedPayments: description: Set to `true` to enable Configurable Represents, `false` to disable. type: boolean RetryPaymentsDelayDays: description: >- Working days between a failed payment and re-presentation. Minimum = your look-forward days setting; maximum = 20. Required when `AllowRetryFailedPayments` is `true`. type: integer FailedPaymentRetries: description: >- Maximum retry attempts. Range: 1-3. Required when `AllowRetryFailedPayments` is `true`. type: integer securityDefinitions: ApiKeyAuth: in: header name: apiKey type: apiKey security: - ApiKeyAuth: [] tags: - description: > Return data is passed to endpoints of your choice by setting the URL that data should be posted to using the API. Data is returned to three separate endpoints based on the entity described, as explained in the table below. Each callback can be set to pass data to the same endpoint. You should contact us at support@accesspaysuite.com to advise whether you require return information in XML or JSON format; the default is JSON. | Entity | Payload | | ------ | ------- | | bulkpayment | Notification of success/failure to process a bulk payment request - see 'Bulk Adding Payments' section for more info. | customer | Notification of customer changes due to BACS notifications | contract | Notification of contract changes due to BACS notifications | payment | Notification of payment status (Unpaid/Indemnity Claimed) changes due to BACS notifications | schedule | Notification of change, addition or deletion of a contract schedule name: Return Endpoints - description: Retrieve configuration info about your DDCMS client. name: Client Info - description: > A customer record captures the personal and banking details of the person or organisation that you wish to collect funds from. A customer record needs to be created before a Direct Debit (contract) record can be created to collect payments. There can be multiple Direct Debits (contracts) attached to a customer record. **Important: You are required to perform a modulus check on bank account numbers and sort codes before they are passed to the API. We can offer a bank checking API on a pay-per-use basis – please contact our Sales Department on `01206 675847` for further details on pricing. Failure to modulus check data is likely to cause problems in processing your payments. ** name: Customer Manipulation - description: Add custom fields to your customer data. name: Customer Questions - description: | Although our documentation advises in most cases to lodge ad-hoc collections at least 5 working days before collection, and new contracts at least 10 working days before first collection, DDCMS can handle collections with these periods reduced to 3 and 5 working days respectively - depending on your SUN. If you're testing on our playpen server, please send an email to us if you wish to reduce the period dates on your test account. If you're a live customer and wish to discuss the possibility of reducing your SUN delay periods, please raise a support case. name: Payment Dates - description: | A contract record represents the Direct Debit associated with a customer record. There are two forms of contract record: - **Ad-hoc:** This is where a Direct Debit is created at the bank for the customer, but no payments are requested unless you specifically input payments via the Payments or Bulk Payments API call. - **Scheduled:** In this mode, a schedule for payments is stated at the outset and the system will create the relevant payments in the database approximately five working days before the payments become due. Schedules can usually be weekly or monthly, however the frequencies available will be communicated to you when the API details are provided. Customers can have multiple contracts attached to them in order that they may have multiple payment streams being collected simultaneously. name: Contract Querying and Creation - description: | Changing the payment amount or date on a scheduled contract can be achieved by using one of the following calls. You will need to select the correct call for the type of contract that you are amending. For example, changing the date on a monthly contract will need a monthly call. We have only shown the responses from one of the calls as all of the calls respond in the same manner. One example of an error is shown, however you should be prepared to accept different errors and handle them as exceptions during the testing stage. name: Contract Amendment - description: | Managing frequencies on a future scheduled contract can be achieved using the Frequency Switching API endpoints below. These endpoints allow for dynamic adjustments to future contract schedules, including retrieving, creating, editing, or deleting future schedules. By selecting the appropriate endpoint for the required action, users can efficiently manage payment frequencies, ensuring automated and accurate handling of future contract schedules without manual intervention. name: Frequency Switching - description: | It is important to understand that there are two parts to a contract; the schedule which creates payments and the Direct Debit which collects those payments. By running the following call against the contract, the Direct Debit is cancelled which will stop the system from sending **scheduled** payments to the bank for collection. They will still be created within the system, however they will not be sent to the bank and will contribute to customer arrears. **NOTE:** This function will **not** affect ad-hoc payments which will be sent regardless of the direct debit status. To prevent ad-hoc payments from being sent to the bank, they must *be deleted individually*. name: Cancelling the Direct Debit (Does not cancel payment creation) - description: | Archiving a contract achieves four things: - It cancels the direct debit. - Writes off any arrears that is outstanding on the contract. - Cancels any future scheduled payments (it does not cancel ad-hoc payments). - Sets the contract status to “archived”. name: Archiving a Contract - description: | Reactivating a Direct Debit takes a contract that is in the cancelled state and changes it to “Pending to Activate”. This sends a new instruction to the bank to re-set up the direct debit. A “new 0N” charge will be made for reactivating a direct debit. name: Reactivating a Direct Debit - description: | 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. name: Restart a Contract - name: Patches description: > 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 amount` - `Freeze 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. - name: Adding/Querying Payments - description: > We will send the payment creation API responses to your configured 'bulk payments' webhook - please see the Return Endpoints section for setting this. name: Bulk Adding Payments - name: Payment Manipulation - name: Obtaining Available Schedules - description: > Import BACS payment files via the API for processing through DDCMS Direct. The client must have the DDCMS Direct feature enabled. name: DDCMS Direct File Import - description: > Configurable Represents lets you control how failed Direct Debit payments are automatically retried, and lets you manually trigger a re-presentation for a specific failed payment. These three endpoints allow you to retrieve and update your retry settings, and to trigger a re-presentation for a specific payment programmatically. name: Configurable Represents - description: > If you have provided us with a return endpoint using the `Return Endpoint` call, data will be posted back to you either in XML or JSON as required. The default is JSON – if you need XML return information, please let us know. We also have the option for you to set custom headers that'll be sent for every notification from DDCMS to your endpoints - please raise a support case if this is something you require, telling us the header name and value to send. ### Object Change Return Information #### Example JSON Payload This is for an ADDACS change – where a customer has cancelled their Direct Debit with the bank. ```json { "NewStatus": "Cancelled", "Id": "ac190e35-2fa7-162c-8505-18702c186a43", "ChangeDate": "2017-05-09T10:20:10", "Entity": "contract", "ChangeType": "BACS", "Source": "ADDACS", "ReportCode": "1", "ReportMessage": "Contract Cancelled because of ADDACS code 1 (Instruction Cancelled)", "Comment": "Auto-updated by BACS file" } ``` #### Example XML Payload This is for an ARUDD change when a customer’s payment has been returned unpaid by the bank. ```xml Unpaid f6dc0f34-1a71-4493-a0af-2f0993f36dc5 2017-05-09T12:17:50 payment BACS ARUDD 0 The payment marked as 'Unpaid' because of ARUDD code 0 (Refer to Payer) Auto-updated by BACS file ``` #### Output Parameters: | **Parameter** | **Description** | ------------- | --------------- | AccountName | If the Entity type is customer, the customers name as it appears on their bank account. | AccountNumber | If the Entity type is customer, the customers bank account number. | SortCode | If the Entity type is customer, the bank sort code of the customer. | NewStatus | This is the new status of the object. For payments, this can be:
Represented
Pending
Paid
Unpaid
Withdrawn
Indemnity Claimed

For contracts:
Expired
Cancelled
Pause
Suspended
Cancellation Pending
Active
Creation Pending
| Id | The GUID of the object being reported on. | ChangeDate | The date/time that the change took place. | Entity | The entity type: either payment, contract or customer. | ChangeType | BACS or Manual depending on how the change came about. | Source | ADDACS, ARUDD, DDIC or Manual depending on the source if the change. | ReportCode | If the change came from a BACS report (ADDACS, ARUDD or DDIC) the reason code will appear in this field. It will be null in the case of a manual change. | ReportMessage | Plain text explanation of the change. We recommend this is logged at your end for reference. | Comment | If any comment was input by a user during a manual change, it will appear here. ### Object Change Report Codes The following is a list of all potential BACS Report codes we can send to your webhooks. For more information please see [our Guide to BACS Reporting and Transaction Codes](https://access-support.force.com/Support/s/article/Access-PaySuite-DDCMS-Guide-to-BACS-Reporting-and-Associated-Transaction-Codes) | **Source** | **Entity** | **ReportCode** | **ReportMessage** | ---------- | ---------- | -------------- | ----------------- | AUDDIS | Contract | 1 | Instruction Cancelled by Payer | AUDDIS | Contract | 2 | Payer Deceased | AUDDIS | Contract | 3 | Account Transferred to a new Bank or Building Society | AUDDIS | Contract | 5 | No Account | AUDDIS | \- | 6 | No Instruction | AUDDIS | Contract | B | Account Closed | AUDDIS | Customer | C | Account Transferred to a Different Branch of Bank/Building Society | AUDDIS | Contract | F | Invalid Account Type | AUDDIS | Contract | G | Bank will not accept Direct Debits on Account | AUDDIS | Contract | H | Instruction has Expired | AUDDIS | Contract | I | Payer Reference is not Unique | AUDDIS | Contract | K | Instruction Cancelled by Paying Back | ADDACS | Contract | 0 | Instruction Cancelled - Refer to Payer | ADDACS | Contract | 1 | Instruction Cancelled | ADDACS | Contract | 2 | Payer Deceased | ADDACS | Customer | 3 | Account transferred to new Bank or Building Society | ADDACS | Contract | B | Account Closed | ADDACS | Customer | C | Account transferred to a different branch of Bank or Building Society | ADDACS | Contract | D | Advance Notice Disputed | ADDACS | Customer | E | Instruction Amended | ADDACS | Contract | R | Instruction Reinstated | ARUDD | Payment | 0 | Refer to Payer | ARUDD | Payment | 1 | Instruction Cancelled | ARUDD | Payment | 2 | Payer Deceased | ARUDD | Payment | 3 | Account Transferred | ARUDD | Payment | 4 | Advance Notice Disputed | ARUDD | Payment | 5 | No Account | ARUDD | Payment | 6 | No Instruction | ARUDD | Payment | 7 | Amount Differs | ARUDD | Payment | 8 | Amount Not Yet Due | ARUDD | Payment | 9 | Presentation Overdue | ARUDD | Payment | A | Service User Differs | ARUDD | Payment | B | Account Closed | DDIC | Contract | 1 | The amount and/or date of the Direct Debit differs from the Advance Notice | DDIC | Contract | 2 | No advance notice was received by the payer or the amount quoted is disputed by the payer | DDIC | Contract | 3 | DDI cancellation by the paying bank | DDIC | Contract | 4 | Payer has cancelled the DDI direct with the Service User | DDIC | Contract | 5 | Payer disputes having given authority | DDIC | Contract | 6 | Signature on DDI is fraudulent or not in accordance with the account authorised signature(s) held by the paying bank | DDIC | Contract | 7 | An indemnity claim has been raised at the Service User's request | DDIC | Contract | 8 | Payer does not recognise Service User collecting Direct Debit ### New Payment Generated Notification Information This notification is submitted to your payments webhook whenever DDCMS generates a new payment on either a fixed or rolling regular schedule. This does *NOT* send information on payments submitted on an adhoc schedule. Currently the callback URL for these notifications cannot be changed via the API - if you wish to setup or amend the callback for New Payment Generated notifications, please raise a support case. #### Example JSON Payload ```json { "CustomerId": "8e8880dc-d36a-500e-9757-dcdab7418f8a", "CustomerRef": null, "ContractId": "bca883a2-e939-44ff-b3f0-9823°00dd388", "DirectDebitRef": "ABC-XY009999", "DateAdded": "2021-02-19T11:22:26.7662254+00:00", "DateDue": "2021-03-01T00:00:00", "Amount": 49.7, "Comments": null, "Id": "59cde7d8-1a81-4da3-b04f-10e71020ed74", "Entity": "payment", "CreateType": "BACS", "Source": null, "Status": "Pending" } ``` ### New eDD Signup Notification Information This notification is submitted when a contract is created from a payer completing registration on an Access Payments eDD page linked to your DDCMS client account. This does *NOT* send information on contracts added via the POST /contract endpoint, or added manually in the DDCMS portal. This is *ONLY* for contracts added via eDD. Currently the callback URL for these notifications cannot be changed via the API - if you wish to setup or amend the callback for New eDD Signups, please raise a support case. ```json { "CustomerId": "e4e9bdad-4370-4072-ad4f-77454a42d839", "AdditionalRef": "My Additional Ref", "DirectDebitReference": "ABC-XY123456", "ScheduleName": "Monthly", "Description": "Monthly > Every 1 month > Day chosen by customer starting on any month (customer's choice) > Until further notice > Switch to further notice", "PaymentMonthInYear": 4, "PaymentDayInMonth": 15, "PaymentDayInWeek": null, "Start": "2023-04-15T00:00:00", "TerminationDate": null, "TerminationType": "Until further notice", "NumberOfDebits": null, "InitialAmount": null, "ExtraInitialAmounts": "", "Amount": 15, "FinalAmount": null, "Every": 1, "IsGiftAid": true, "AtTheEnd": "Switch to further notice", "Status": "Creation Pending", "StatusExplanation": "", "Id": "6062addf-768c-40d6-af08-e8e4e32d7c80", "Entity": "contract", "CreateType": "API", "Source": null } ``` ### Bulk Payment Insert Return Information This is what the API returns from a bulk payment insert - see the *Bulk Adding Payments* section for more info. #### Example XML Payload - Successful Insert ```xml 07024c7a-c31c-46c1-8e0e-8fcff640b35c 15.99 2017-06-01T00:00:00 1522c59f-87dc-4b31-9931-a6083776f670 Successful Payment Example false ``` #### Example XML Payload - Error ```xml 07024c7a-c31c-46c1-8e0e-8fcff640b35c 15.99 2017-06-01T00:00:00 00000000-0000-0000-0000-000000000000 Contract not found - Invalid Contract Id Failed Payment Example false ``` #### Example JSON Payload - Successful Insert ```json { "Contract":"07024c7a-c31c-46c1-8e0e-8fcff640b35c", "Amount":15.99, "DueDate":"2017-06-01T00:00:00", "Id":"23bc8558-51cd-4c4e-b223-260010c69d38", "Error": null, "Comment": "Successful Payment Example", "IsCredit": false, "Message": null } ``` #### Example JSON Payload - Error ```json { "Contract":"07024c7a-c31c-46c1-8e0e-8fcff640b35c", "Amount":15.99, "DueDate":"2017-06-01T00:00:00", "Id": "00000000-0000-0000-0000-000000000000", "Error": "Contract not found - Invalid Contract Id", "Comment": "Failed Payment Example", "IsCredit": false, "Message": null } ``` #### Output Parameters: | Parameter | Description | --------- | ----------- | Contract | The Contract GUID that the payment has been added to. | Amount | The amount of the payment. | DueDate | The due date of the payment. | Id | The payment GUID that you should keep a record of. If the request fails, this will be `00000000-0000-0000-0000-000000000000` | Error | Any validation errors will appear here. | Comment | The custom comment passed in for this payment request. | IsCredit | Whether the payment is a credit (`True`) or debit (`False`) collection. | Message | Any validation messages or warnings will appear here. ### Schedule Change Return Information The payload is sent to the configured 'Schedule Change' callback URL when a schedule's settings are changed, a new schedule is created or a schedule is completely deleted. #### Example JSON Payload ```json { "Entity": "schedule", "Id": "94821c14-8ba3-483f-a9db-02af004d9938", "Schedule": { "ScheduleId": "94821c14-8ba3-483f-a9db-02af004d9938", "Name": "yyy", "Description": "Weekly > Every 1 week > Week day chosen by customer starting on any month (customer's choice) > First , then on a regular basis", "AllowDifferentFirstPayment": false, "AllowDifferentLastPayment": false, "AllowFreeMonthDaySelection": true, "AllowFreeMonthSelection": true, "AllowFreeWeekDaySelection": true, "Amount": null, "AtTheEnd": "Expire", "DayOfWeek": "Free", "DaysOfMonth": "Free", "Every": 1, "ExpectedNumberOfPayments": null, "ExtraInitialPayments": "", "FinalAmount": null, "Frequency": "Weekly", "InitialAmount": null, "IsExpiryDateReached": false, "IsNotScheduled": false, "IsSuspended": false, "MonthOfYear": "Free", "RegistrationCharge": 0.0, "Start": null, "StartType": "As soon as possible", "TerminationDate": null, "TerminationType": "Until further notice" }, "ParentService": { "Title": "Default Service", "RefProtocol": "Auto-number", "RefPrefix": "DEF", "RefFrom": null, "RefTo": null, "Schedules": null }, "ParentClient": { "Id": "da550c70-b879-4e89-b918-00f8ecb4d703", "Name": "The Waffle Factory", "ClientPrefix": "WF" }, "ChangeDate": "2021-08-12T08:04:38", "OperationTypeVal": 1, "OperationType": "Create" } ``` #### Output Parameters: | Parameter | Description | --------- | ----------- | Entity | Returns 'schedule'. | Id | The schedule's database GUID. | Schedule | Details of the affected schedule - see the *Obtaining Available Schedules* section for more info. | Parent Service | Details of the service which the schedule belongs to - see the *Obtaining Available Schedules* section for more info. | Parent Client | Details of the client account the schedule belongs to.
**Id** - GUID of the client account.
**Name** - The client's name
**Client Prefix** - The client code used for API operations. | Change Date | Date-time for when the action took place. | Operation Type Val | Integer value for the OperationType enum. | Operation Type | Action performed on the schedule - can be **Create**, **Update** or **Delete**. name: Return endpoints x-components: {}