Skip to content

Query Transactions

Request URL

POST /transfer-to/card/transactions-query

Description

The status of up to 20 push/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 push/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 transfer-to/card/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,
  "$id": "common-id"
}

Property table for schema 2 for transfer-to/card/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,
  "$id": "common-reference"
}

Request Body

{
    "cFiTransactionIds": [
        "CLIENTID_RWrsXBN7ICJcABIb58u9Y",
        "CLIENTID_5zo5ECvPGbmXo3FytHjEB4"
    ]
}

Snippet Examples

javascript

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

Successful Response Examples

200 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_RWrsXBN7ICJcABIb58u9Y",
        "CLIENTID_5zo5ECvPGbmXo3FytHjEB4"
    ]
}

RESPONSE BODY

{
    "code": "0",
    "data": [
        {
            "reference": "ext2TnId25900",
            "cFiTransactionId": "CLIENTID_5zo5ECvPGbmXo3FytHjEB4",
            "dtsCreated": "2023-11-02T11:05:21.428Z",
            "status": "Complete",
            "network": "Visa",
            "networkRC": "00"
        },
        {
            "reference": "externalTrnId0500",
            "cFiTransactionId": "CLIENTID_RWrsXBN7ICJcABIb58u9Y",
            "dtsCreated": "2023-11-02T11:08:11.798Z",
            "status": "Complete",
            "network": "Visa",
            "networkRC": "00"
        }
    ],
    "requestId": "a6ff20a0797011eeb5658f28ab5fe311"
}

200 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": [ "ext2TnId25900", "externalTrnId0500" ]
}

RESPONSE BODY

{
    "code": "0",
    "data": [
        {
            "reference": "ext2TnId25900",
            "cFiTransactionId": "CLIENTID_5zo5ECvPGbmXo3FytHjEB4",
            "dtsCreated": "2023-11-02T11:05:21.428Z",
            "status": "Complete",
            "network": "Visa",
            "networkRC": "00"
        },
        {
            "reference": "externalTrnId0500",
            "cFiTransactionId": "CLIENTID_RWrsXBN7ICJcABIb58u9Y",
            "dtsCreated": "2023-11-02T11:08:11.798Z",
            "status": "Complete",
            "network": "Visa",
            "networkRC": "00"
        }
    ],
    "requestId": "c0c3f5b0797011eeb5658f28ab5fe311"
}

200 SUCCESSFUL RESPONSE TRANSACTIONS 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

{
    "cFiTransactionIds": [
        "CLIENTID_RWrsXBN7ICJcABIb58u9Y2",
        "CLIENTID_5zo5ECvPGbmXo3FytHjEB43"
    ]
}

RESPONSE BODY

{
    "code": "0",
    "data": [],
    "requestId": "655b02b0951111eea89d7100487c0512"
}