Skip to content

List Merchants

Request URL

POST /payment-link/merchant/list

Description

This endpoint will allow you (the client/platform) to retrieve a list of all merchants that you have created that satisfy the specified criteria.

Schema

Property table for payment-link/merchant/list

Property Description Required Schema
cFiMerchantId The ID of the Merchant in connectFi No {
  "type": "string",
  "pattern": "^[0-9a-zA-Z_]+$",
  "minLength": 1,
  "maxLength": 36,
  "$id": "common-id"
}
reference An external alphanumeric reference ID for the entity in your system No {
  "type": "string",
  "pattern": "^[0-9a-zA-Z]+$",
  "minLength": 1,
  "maxLength": 32,
  "$id": "common-reference"
}
cFiMerchantIds An array of connectFi Merchant IDs No array of {
  "type": "string"
}
isArchived true if archived No {
  "type": "boolean",
  "nullable": true
}
name Name No {
  "type": "string",
  "nullable": true
}
availablePaymentType The types of payments that are accepted No array of {
  "type": "string",
  "nullable": true,
  "enum": [ "card", "ach" ]
}
numberOfRecords The maximum number of desired records to return No {
  "type": "number",
  "nullable": true
}
skipRecords The number of records to skip when returning results No {
  "type": "number",
  "nullable": true
}

Request Body

{
  "cFiMerchantId": "2Bc0QW0VYJe7VhTyXXEYNQ",
  "cFiMerchantIds": [],
  "isArchived": false,
  "name": "Merchant1",
  "reference": "1",
  "availablePaymentType": [
            "ach",
            "card"
        ],
  "numberOfRecords": 10,
  "skipRecords": 0
}

Snippet Examples

javascript

const axios = require('axios');
const data = {
  "cFiMerchantId": "2Bc0QW0VYJe7VhTyXXEYNQ",
  "cFiMerchantIds": [],
  "isArchived": false,
  "name": "Merchant1",
  "reference": "1",
  "availablePaymentType": [
            "ach",
            "card"
        ],
  "numberOfRecords": 10,
  "skipRecords": 0
};
const config = {
  method: 'POST',
  url: '${CONNECTFI_BASE_URL}/payment-link/merchant/list',
  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/payment-link/merchant/list" --data "{  \"cFiMerchantId\":\"2Bc0QW0VYJe7VhTyXXEYNQ\", \"cFiMerchantIds\":[], \"isArchived\":false, \"name\":\"Merchant1\", \"reference\":\"1\", \"availablePaymentType\":[            \"ach\",           \"card\"        ], \"numberOfRecords\":10, \"skipRecords\":0}" --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

HEADERS

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

REQUEST BODY

{
  "cFiMerchantId": "2Bc0QW0VYJe7VhTyXXEYNQ",
  "cFiMerchantIds": [],
  "isArchived": false,
  "name": "Merchant1",
  "reference": "1",
  "availablePaymentType": [
            "ach",
            "card"
        ],
  "numberOfRecords": 10,
  "skipRecords": 0
}

RESPONSE BODY

{
    "code": "0",
    "data": {
        "items": [
            {
                "name": "Merchant1",
                "isArchived": false,
                "email": "def123.test@email.test",
                "phone": "5555555555",
                "address": "1346 Pleasant Ave",
                "city": "New York",
                "stateCode": "NY",
                "postalCode": "12345",
                "availablePaymentType": [
                    "ach",
                    "card"
                ],
                "usePlaid": true,
                "reference": "1",
                "cFiAggregatorId": "CLIENTID",
                "cFiMerchantId": "2Bc0QW0VYJe7VhTyXXEYNQ",
                "dtsCreatedAt": "2024-07-30T13:22:20.560Z",
                "dtsUpdatedAt": "2024-07-30T13:28:46.084Z",
                "logos": [],
                "daysToPaymentExpired": 30
            }
        ],
        "total": {
            "skipRecords": 0,
            "numberOfRecords": 1,
            "more": false
        }
    },
    "requestId": "8ba544b04e7c11efac39cdb5e869de12"
}

200 SUCCESS RESPONSE - NO MATCHES

HEADERS

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

REQUEST BODY

{
  "isArchived": true,
  "numberOfRecords": 10,
  "skipRecords": 0
}

RESPONSE BODY

{
    "code": "0",
    "data": {
        "items": [],
        "total": {
            "skipRecords": 0,
            "numberOfRecords": 0,
            "more": false
        }
    },
    "requestId": "f7264ab0540b11efacdc860d03bdc411"
}

200 SUCCESSFUL RESPONSE - NO FILTER

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": {
        "items": [
            {
                "name": "Merchant1",
                "isArchived": false,
                "email": "def123.test@email.test",
                "phone": "5555555555",
                "address": "1346 Pleasant Ave",
                "city": "New York",
                "stateCode": "NY",
                "postalCode": "12345",
                "availablePaymentType": [
                    "ach",
                    "card"
                ],
                "usePlaid": true,
                "reference": "1",
                "cFiAggregatorId": "CLIENTID",
                "cFiMerchantId": "2Bc0QW0VYJe7VhTyXXEYNQ",
                "dtsCreatedAt": "2024-07-30T13:22:20.560Z",
                "dtsUpdatedAt": "2024-07-30T13:28:46.084Z",
                "logos": [],
                "daysToPaymentExpired": 30
            },
            {
                "name": "Merchant2",
                "isArchived": false,
                "email": "ghi456.test@email.test",
                "phone": "5556667777",
                "address": "7890 Pleasant Ave",
                "city": "New York",
                "stateCode": "NY",
                "postalCode": "12345",
                "availablePaymentType": [
                    "ach",
                    "card"
                ],
                "usePlaid": true,
                "reference": "2",
                "cFiAggregatorId": "CLIENTID",
                "cFiMerchantId": "dR2gf2duf74j8frGFH5t7",
                "dtsCreatedAt": "2024-07-30T13:22:20.560Z",
                "dtsUpdatedAt": "2024-07-30T13:28:46.084Z",
                "logos": [],
                "daysToPaymentExpired": 30
            }
            // rest of the unfiltered payment link list
        ],
        "total": {
            "skipRecords": 0,
            "numberOfRecords": 23,
            "more": false
        }
    },
    "requestId": "8ba544b04e7c11efac39cdb5e869de12"
}