Direct Debit

Customer Questions

Add custom fields to your customer data.

POST/client/{clientCode}/questionCreates a new question#
description:

Creates a new question

authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema directDebit/path/client
{
  • clientCode
    string (≤ 6 chars)MandatoryThe client code provided in your welcome email.
}
query parameters:
{
  • label
    string (≤ 200 chars)MandatoryLabel for the question.
  • type
    stringMandatoryPossible values: text, list, dateData type for answers to this question.
  • options
    string (≤ 800 chars)Comma-separated list of possible answers for this question. Can only be used when type is list.
  • tags
    string (≤ 200 chars)A custom tag that can be assigned to this question. This tag does not need to be unique.
  • isMandatory
    booleanMandatoryWhether or not an answer is required for this question.
}
request body:
shared schema directDebit/question
{
  • label
    string
  • type
    string
  • options
    string
  • isMandatory
    boolean
}

Responses

200OK
response body:
{
  • Id
    stringThe GUID of the question. You must save this to your database as it will be needed when you add an answer.
  • Message
    stringSuccess message.
}
400Bad RequestBad request - options not provided for list question
Example — query parameters
Endpoint
POST /client/{clientCode}/question
cURL
curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/question?label=Would+you+like+us+to+send+you+offers+by+email%3F&type=list&options=Yes%2CNo&isMandatory=false' \
  -H 'apiKey: {apiKey}'
Response
HTTP/1.1 200 OK

{
  "Id": "e45afe74-0217-43e1-8afc-0f60b887c691",
  "Message": "Client custom question was added successfully"
}
HTTP/1.1 400 Bad Request

{
  "ErrorCode": 3,
  "Detail": "Please provide Options for the selected Type.",
  "Message": "Validation error"
}
Example — request body
Endpoint
POST /client/{clientCode}/question
Request body
{
  "label": "Would you like us to send you offers by email?",
  "type": "list",
  "options": "Yes,No",
  "isMandatory": false
}
cURL
curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/question' \
  -H 'Content-Type: application/json' \
  -H 'apiKey: {apiKey}' \
  -d '{"label":"Would you like us to send you offers by email?","type":"list","options":"Yes,No","isMandatory":false}'
Response
HTTP/1.1 200 OK

{
  "Id": "e45afe74-0217-43e1-8afc-0f60b887c691",
  "Message": "Client custom question was added successfully"
}
HTTP/1.1 400 Bad Request

{
  "ErrorCode": 3,
  "Detail": "Please provide Options for the selected Type.",
  "Message": "Validation error"
}
PATCH/client/{clientCode}/question/{questionId}Updates an existing question#
description:

Updates an existing question

authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema directDebit/path/client-question
{
  • clientCode
    string (≤ 6 chars)MandatoryThe client code provided in your welcome email.
  • questionId
    string (guid)MandatoryThe ID of the question to update.
}
query parameters:
{
  • label
    string (≤ 200 chars)Label for the question.
  • type
    stringPossible values: text, list, dateData type for answers to this question.
  • options
    string (≤ 800 chars)Comma-separated list of possible answers for this question. Can only be used when type is list.
  • isMandatory
    booleanWhether or not an answer is required for this question.
}
request body:
shared schema directDebit/question
{
  • label
    string
  • type
    string
  • options
    string
  • isMandatory
    boolean
}

Responses

200OK
response body:
{
  • Id
    stringThe GUID of the question. You must save this to your database as it will be needed when you add an answer.
  • Message
    stringSuccess message.
}
400Bad RequestBad request - options not provided for list question
Example — query parameters
Endpoint
PATCH /client/{clientCode}/question/{questionId}
cURL
curl -L -g -X PATCH 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/question/{questionId}?label=Updated+question+label&type=list&options=Yes%2CNo&isMandatory=false' \
  -H 'apiKey: {apiKey}'
Response
HTTP/1.1 200 OK

{
  "Message": "Client custom question updated"
}
HTTP/1.1 400 Bad Request

{
  "ErrorCode": 3,
  "Detail": "Please provide Options for the selected Type.",
  "Message": "Validation error"
}
Example — request body
Endpoint
PATCH /client/{clientCode}/question/{questionId}
Request body
{
  "label": "Would you like us to send you offers by email?",
  "type": "list",
  "options": "Yes,No",
  "isMandatory": false
}
cURL
curl -L -g -X PATCH 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/question/{questionId}' \
  -H 'Content-Type: application/json' \
  -H 'apiKey: {apiKey}' \
  -d '{"label":"Would you like us to send you offers by email?","type":"list","options":"Yes,No","isMandatory":false}'
Response
HTTP/1.1 200 OK

{
  "Message": "Client custom question updated"
}
HTTP/1.1 400 Bad Request

{
  "ErrorCode": 3,
  "Detail": "Please provide Options for the selected Type.",
  "Message": "Validation error"
}
GET/client/{clientCode}/questionsLists all questions created for the client#
description:

Lists all questions created for the client

authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema directDebit/path/client
{
  • clientCode
    string (≤ 6 chars)MandatoryThe client code provided in your welcome email.
}

Responses

200OK
response body:
{
}
Example request
Endpoint
GET /client/{clientCode}/questions
cURL
curl -L -g -X GET 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/questions' \
  -H 'apiKey: {apiKey}'
Response
HTTP/1.1 200 OK

{
  "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": [
        true,
        false
      ],
      "Tags": null,
      "IsMandatory": false
    }
  ]
}
POST/client/{clientCode}/customer/{customerId}/question/{questionId}/answerAdds an answer for a customer#
description:

Adds an answer for a customer

authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema directDebit/path/client-customer-question
{
  • clientCode
    string (≤ 6 chars)MandatoryThe client code provided in your welcome email.
  • customerId
    string (guid)MandatoryCustomer to assign the answer to.
  • questionId
    string (guid)MandatoryQuestion the answer relates to.
}
query parameters:
{
  • value
    string (≤ 200 chars)MandatoryThe answer to add.
}
request body:

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

Responses

200OK
response body:
{
  • Message
    stringConfirmation message for the operation.
}
400Bad RequestBad request - answer exists
Example request
Endpoint
POST /client/{clientCode}/customer/{customerId}/question/{questionId}/answer
Request body
{}
cURL
curl -L -g -X POST 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/customer/{customerId}/question/{questionId}/answer?value=Yes' \
  -H 'apiKey: {apiKey}'
Response
HTTP/1.1 200 OK

{
  "Message": "Customer Answer added"
}
HTTP/1.1 400 Bad Request

{
  "ErrorCode": 3,
  "Detail": "There is an existing Customer answer with the same Customer and Question in the database already.",
  "Message": "Validation error"
}
PATCH/client/{clientCode}/customer/{customerId}/question/{questionId}/answerUpdates an existing customer answer#
description:

Updates an existing customer answer

authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema directDebit/path/client-customer-question
{
  • clientCode
    string (≤ 6 chars)MandatoryThe client code provided in your welcome email.
  • customerId
    string (guid)MandatoryCustomer to assign the answer to.
  • questionId
    string (guid)MandatoryQuestion the answer relates to.
}
query parameters:
{
  • value
    string (≤ 200 chars)MandatoryThe answer to add.
}
request body:

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

Responses

200OK
response body:
{
  • Message
    stringConfirmation message for the operation.
}
400Bad RequestBad request - answer not in Options
404Not FoundAnswer not found
Example request
Endpoint
PATCH /client/{clientCode}/customer/{customerId}/question/{questionId}/answer
Request body
{}
cURL
curl -L -g -X PATCH 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/customer/{customerId}/question/{questionId}/answer?value=No' \
  -H 'apiKey: {apiKey}'
Response
HTTP/1.1 200 OK

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

{
  "ErrorCode": 3,
  "Detail": "Please provide a valid response to this question.  Possible responses are Yes,No",
  "Message": "Validation error"
}
HTTP/1.1 404 Not Found

{
  "ErrorCode": 9,
  "Detail": null,
  "Message": "Customer Answer not found"
}
DELETE/client/{clientCode}/customer/{customerId}/question/{questionId}/answerDeletes an existing customer answer#
description:

Deletes an existing customer answer

authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema directDebit/path/client-customer-question
{
  • clientCode
    string (≤ 6 chars)MandatoryThe client code provided in your welcome email.
  • customerId
    string (guid)MandatoryCustomer to assign the answer to.
  • questionId
    string (guid)MandatoryQuestion the answer relates to.
}

Responses

200OK
response body:
{
  • Message
    stringConfirmation message for the operation.
}
404Not FoundAnswer not found
Example request
Endpoint
DELETE /client/{clientCode}/customer/{customerId}/question/{questionId}/answer
cURL
curl -L -g -X DELETE 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/customer/{customerId}/question/{questionId}/answer' \
  -H 'apiKey: {apiKey}'
Response
HTTP/1.1 200 OK

{
  "Message": "Customer Answer deleted"
}
HTTP/1.1 404 Not Found

{
  "ErrorCode": 9,
  "Detail": null,
  "Message": "Customer Answer not found"
}
GET/client/{clientCode}/customer/{customerId}/question/{questionId}/answerGets the answer for a particular customer and question#
description:

Gets the answer for a particular customer and question

authorization:ApiKeyAuth
content-type: application/json
path parameters:
shared schema directDebit/path/client-customer-question
{
  • clientCode
    string (≤ 6 chars)MandatoryThe client code provided in your welcome email.
  • customerId
    string (guid)MandatoryCustomer to assign the answer to.
  • questionId
    string (guid)MandatoryQuestion the answer relates to.
}

Responses

200OK
response body:
{
  • Id
    string (guid)Unique ID for the answer.
  • Product
    string (guid)If the question is a ServiceCustomQuestion, returns the service the question belongs to. Otherwise, returns null.
  • Customer
    string (guid)Unique ID for the customer.
  • CustomQuestion
    string (guid)Unique ID for the question the answer is for.
  • Answer
    stringActual value of the answer.
}
404Not FoundAnswer not found
Example request
Endpoint
GET /client/{clientCode}/customer/{customerId}/question/{questionId}/answer
cURL
curl -L -g -X GET 'https://ddcms.accesspaysuite.com/api/v3/client/{clientCode}/customer/{customerId}/question/{questionId}/answer' \
  -H 'apiKey: {apiKey}'
Response
HTTP/1.1 200 OK

{
  "Id": "37c1def5-e9e5-4be4-bd6a-bc8fb5f0cbc2",
  "Product": null,
  "Customer": "66e88855-a07e-40d8-aff6-1fa7ace4dd1d",
  "CustomQuestion": "ba8a6aef-756f-4945-b846-f8adaafb69df",
  "Answer": true
}
HTTP/1.1 404 Not Found

{
  "ErrorCode": 9,
  "Detail": null,
  "Message": "Customer Answer not found"
}