Query Checks
Request URL
POST /check/query
Description
The status of up to 20 checks may be requested at a time (either using the "references" array or the "cFiCheckIds" array, but not both). The array that you include may not be an empty array.
The system will return only the checks it could locate. Unknown IDs will be ignored and if no IDs are recognized, an empty array is returned with success code "0".
If the same ID is requested multiple times in the "сFiCheckIds" or "references" array, the response will only return one object in the data array corresponding to that ID, regardless of how many times it was listed in the request array.
If more than 20 elements are listed in the request array (either "сFiCheckIds" array or the "references" array), an error will be thrown even if the IDs are not unique. For example, if the cFiCheckId "chk_DdwNMecgMe96AW0xRNOBO" is listed 21 times in the request array, the request will fail even though technically only one unique ID was requested.
Either "cFiCheckIds": [...] should be used or "references": [...], but not both. You cannot combine both types of IDs into a single request.
Schema
Property table for schema 1 for check/query
Property | Description | Required | Schema |
---|---|---|---|
cFiCheckIds | An array of check IDs from the connectFi system | Yes | array of { "type": "string", "pattern": "^[0-9a-zA-Z_]+$", "minLength": 1, "maxLength": 36, "$id": "common-id" } |
Property table for schema 2 for check/query
Property | Description | Required | Schema |
---|---|---|---|
references | An array of external references | Yes | array of { "type": "string", "pattern": "^[0-9a-zA-Z]+$", "minLength": 1, "maxLength": 32, "$id": "common-reference" } |
Request Body
Snippet Examples
javascript
const axios = require('axios');
const data = {
"cFiCheckIds": ["chk_10Yr0skuZ8NUX1wPG06MNA", "chk_6UxgKofyzcMWdSjbZlMMZs"]
};
const config = {
method: 'POST',
url: '${CONNECTFI_BASE_URL}/check/query',
headers: {
'Content-Type': "application/json",
'x-connectfi-token': "A long random string token received from /auth/get-token request"
},
data
};
let result;
try {
result = await axios.request(config);
if (result.status === 200) {
console.log(JSON.stringify(result.data));
}
} catch (err) {
console.log({
errCode: err.code,
responseStatus: err.response && err.response.status,
data: err.response && JSON.stringify(err.response.data)
});
}
cURL
curl --location "CONNECTFI_BASE_URL/check/query" --data "{ \"cFiCheckIds\":[\"chk_10Yr0skuZ8NUX1wPG06MNA\",\"chk_6UxgKofyzcMWdSjbZlMMZs\"]}" --header "Content-Type: application/json" --header "x-connectfi-token: A long random string token received from /auth/get-token request"
Successful Response Examples
200 CHECK/QUERY SUCCESSFUL RESPONSE USING CFICHECKIDS
HEADERS
Header | Value |
---|---|
Content-Type | application/json |
x-connectfi-token | A long random string token received from /auth/get-token request |
REQUEST BODY
RESPONSE BODY
{
"code": "0",
"data": [
{
"cFiCheckId": "chk_10Yr0skuZ8NUX1wPG06MNA",
"reference": "extChkRef702",
"serial": "90",
"amount": 1.01,
"currency": "USD",
"cFiAggregatorId": "CLIENTID",
"cFiCheckStatus": "Processing",
"initVoid": false,
"webhookUrl": "https://your_webhook_url/extChkRef702",
"dtsCreatedAt": "2023-11-02T11:22:38.822Z"
},
{
"cFiCheckId": "chk_6UxgKofyzcMWdSjbZlMMZs",
"reference": "extChkRef700",
"serial": "89",
"amount": 1.01,
"currency": "USD",
"cFiAggregatorId": "CLIENTID",
"cFiCheckStatus": "Processing",
"initVoid": false,
"webhookUrl": "https://your_webhook_url/extChkRef700",
"dtsCreatedAt": "2023-11-02T11:20:54.354Z"
}
],
"requestId": "405e0440797211eeb5658f28ab5fe311"
}
200 CHECK/QUERY SUCCESSFUL RESPONSE USING REFERENCES
HEADERS
Header | Value |
---|---|
Content-Type | application/json |
x-connectfi-token | A long random string token received from /auth/get-token request |
REQUEST BODY
RESPONSE BODY
{
"code": "0",
"data": [
{
"cFiCheckId": "chk_6UxgKofyzcMWdSjbZlMMZs",
"reference": "extChkRef700",
"serial": "89",
"amount": 1.01,
"currency": "USD",
"cFiAggregatorId": "CLIENTID",
"cFiCheckStatus": "Processing",
"initVoid": false,
"webhookUrl": "https://your_webhook_url/extChkRef700",
"dtsCreatedAt": "2023-11-02T11:20:54.354Z"
},
{
"cFiCheckId": "chk_10Yr0skuZ8NUX1wPG06MNA",
"reference": "extChkRef702",
"serial": "90",
"amount": 1.01,
"currency": "USD",
"cFiAggregatorId": "CLIENTID",
"cFiCheckStatus": "Processing",
"initVoid": false,
"webhookUrl": "https://your_webhook_url/extChkRef702",
"dtsCreatedAt": "2023-11-02T11:22:38.822Z"
}
],
"requestId": "595d1850797211eeb5658f28ab5fe311"
}
200 CHECK/QUERY SUCCESSFUL RESPONSE REQUESTED CHECKS DO NOT EXIST
HEADERS
Header | Value |
---|---|
Content-Type | application/json |
x-connectfi-token | A long random string token received from /auth/get-token request |
REQUEST BODY
RESPONSE BODY