Skip to content

Query Transactions

Request URL

POST /acquiring/transactions-query

Description

The status of up to 20 pull transactions may be requested at a time. The requested transactions are identified either by an array of connectFi transaction IDs ("cFiTransactionIds") or by an array of external system "references". The array that you include may not be an empty array.

The system will return only the pull transactions 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 "сFiTransactionIds" 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 "сFiTransactionIds" array or the "references" array), an error will be thrown even if the IDs are not unique. For example, if the cFiTransactionId "CLIENTID_6UkLq66HEN6IMj4fNl6hgM" is listed 21 times in the request array, the request will fail even though technically only one unique ID was requested.

Either "cFiTransactionIds": [...] 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 acquiring/transactions-query

Property Description Required Schema
cFiTransactionIds Array of transaction IDs from the connectFi system obtained when each transaction was initialized Yes array of {
  "type": "string",
  "pattern": "^[0-9a-zA-Z_]+$",
  "minLength": 1,
  "maxLength": 36,
  "description": "common-id"
}

Property table for schema 2 for acquiring/transactions-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,
  "description": "common-reference"
}

Request Body

{
    "cFiTransactionIds": [
        "CLIENTID_6C1dj5cgIHVRAZBRFKJ5ES"
    ]
}

Snippet Examples

javascript

const axios = require('axios');
const data = {
    "cFiTransactionIds": [
        "CLIENTID_6C1dj5cgIHVRAZBRFKJ5ES"
    ]
};
const config = {
  method: 'POST',
  url: '${CONNECTFI_BASE_URL}/acquiring/transactions-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/acquiring/transactions-query" --data "{    \"cFiTransactionIds\":[        \"CLIENTID_6C1dj5cgIHVRAZBRFKJ5ES\"    ]}" --header "Content-Type: application/json" --header "x-connectfi-token: A long random string token received from /auth/get-token request" 

Successful Response Examples

200 ACQUIRING/TRANSACTIONS-QUERY SUCCESSFUL RESPONSE USING CFITRANSACTIONIDS

HEADERS

Header Value
Content-Type application/json
x-connectfi-token A long random string token received from /auth/get-token request

REQUEST BODY

{
    "cFiTransactionIds": [
        "CLIENTID_6C1dj5cgIHVRAZBRFKJ5ES"
    ]
}

RESPONSE BODY

{
    "code": "0",
    "data": [
        {
            "reference": "exrnl2TnId2600",
            "cFiTransactionId": "CLIENTID_6C1dj5cgIHVRAZBRFKJ5ES",
            "dtsCreated": "2023-11-02T10:37:40.910Z",
            "status": "Complete",
            "network": "Visa",
            "networkRC": "00"
        }
    ],
    "requestId": "1f9b6d60796d11eeb5658f28ab5fe311"
}

200 ACQUIRING/TRANSACTIONS-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

{
    "references": ["exrnl2TnId2600"]
}

RESPONSE BODY

{
    "code": "0",
    "data": [
        {
            "reference": "exrnl2TnId2600",
            "cFiTransactionId": "CLIENTID_6C1dj5cgIHVRAZBRFKJ5ES",
            "dtsCreated": "2023-11-02T10:37:40.910Z",
            "status": "Complete",
            "network": "Visa",
            "networkRC": "00",
            "reversalStatus": "Reversed",
            "reversal": {
                "networkRC": "00"
            }
        }
    ],
    "requestId": "62c7b70094f811eea89d7100487c0512"
}

200 ACQUIRING/TRANSACTIONS-QUERY SUCCESSFUL RESPONSE NO RECOGNIZED IDS

HEADERS

Header Value
Content-Type application/json
x-connectfi-token A long random string token received from /auth/get-token request

REQUEST BODY

{
    "cFiTransactionIds": [ "unknownId" ]
}

RESPONSE BODY

{
    "code": "0",
    "data": [],
    "requestId": "d1027760796d11eeb5658f28ab5fe311"
}