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
}
query parameters:
{
- label
- type
- options
- tags
- isMandatory
}
request body:
shared schema
directDebit/question{
- label
- type
- options
- isMandatory
}
Responses
200OK
response body:
{
- Id
- Message
}
400Bad RequestBad request - options not provided for list question
Example — query parameters
Endpoint
POST /client/{clientCode}/questioncURL
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}/questionRequest 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
- questionId
}
query parameters:
{
- label
- type
- options
- isMandatory
}
request body:
shared schema
directDebit/question{
- label
- type
- options
- isMandatory
}
Responses
200OK
response body:
{
- Id
- 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
}
Responses
200OK
response body:
{
- Questions [ {
- Id
- Label
- Type
- Options
- Tags
- IsMandatory
} ]
}
Example request
Endpoint
GET /client/{clientCode}/questionscURL
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
- customerId
- questionId
}
query parameters:
{
- value
}
request body:
{} — This call takes no request body — send an empty JSON object.
Responses
200OK
response body:
{
- Message
}
400Bad RequestBad request - answer exists
Example request
Endpoint
POST /client/{clientCode}/customer/{customerId}/question/{questionId}/answerRequest 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
- customerId
- questionId
}
query parameters:
{
- value
}
request body:
{} — This call takes no request body — send an empty JSON object.
Responses
200OK
response body:
{
- Message
}
400Bad RequestBad request - answer not in Options
404Not FoundAnswer not found
Example request
Endpoint
PATCH /client/{clientCode}/customer/{customerId}/question/{questionId}/answerRequest 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
- customerId
- questionId
}
Responses
200OK
response body:
{
- Message
}
404Not FoundAnswer not found
Example request
Endpoint
DELETE /client/{clientCode}/customer/{customerId}/question/{questionId}/answercURL
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
- customerId
- questionId
}
Responses
200OK
response body:
{
- Id
- Product
- Customer
- CustomQuestion
- Answer
}
404Not FoundAnswer not found
Example request
Endpoint
GET /client/{clientCode}/customer/{customerId}/question/{questionId}/answercURL
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"
}