Skip to content

Update Merchant

Request URL

POST /payment-link/merchant/update

Description

This endpoint allows you (the client/platform) to update allowed properties for existing merchants. The connectFi ID of the merchant is required and editable properties include the merchant name, email, phone, address, whether the merchant isArchived, the allowed payment types for the merchant, and whether Plaid may be used to link customer bank accounts for making payments.

Schema

Property table for payment-link/merchant/update

Property Description Required Schema
isArchived true if archived No {
  "nullable": true,
  "type": "boolean"
}
name Name No {
  "type": "string",
  "pattern": "^((?![<>]).)*$",
  "minLength": 0,
  "maxLength": 500,
  "nullable": true,
  "$id": "common-commonStr500"
}
email Email address No {
  "type": "string",
  "format": "email",
  "$id": "customer-email"
}
phone Phone No {
  "type": "string",
  "pattern": "^\d+$",
  "minLength": 6,
  "maxLength": 12,
  "$id": "customer-phoneNumber"
}
address Address details No {
  "type": "string",
  "pattern": "^((?![<>]).)*$",
  "minLength": 0,
  "maxLength": 100,
  "nullable": true,
  "$id": "common-commonStr100"
}
city City No {
  "type": "string",
  "pattern": "^((?![<>]).)*$",
  "minLength": 1,
  "maxLength": 50,
  "isNotOnlyWhitespace": true,
  "$id": "common-commonStr50Req"
}
stateCode State abbreviation code No {
  "type": "string",
  "enum": [ "AL", "AK", "AS", "AZ", "AR", "CA", "CO",
"CT", "DE", "DC", "FM", "FL", "GA", "GU", "HI",
"ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME",
"MH", "MD", "MA", "MI", "MN", "MS", "MO", "MT",
"NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND",
"MP", "OH", "OK", "OR", "PW", "PA", "PR", "RI",
"SC", "SD", "TN", "TX", "UT", "VT", "VI", "VA",
"WA", "WV", "WI", "WY" ],
  "$id": "customer-stateCode"
}
postalCode Postal code No {
  "type": "string",
  "pattern": "^[0-9a-zA-Z-]+$",
  "minLength": 5,
  "maxLength": 10,
  "$id": "customer-postalCode"
}
availablePaymentType The types of payments that are accepted No array of {
  "type": "string",
  "nullable": true,
  "enum": [ "card", "ach" ]
}
usePlaid true if Plaid can be used to link an account No {
  "nullable": true,
  "type": "boolean"
}
cFiMerchantId The ID of the Merchant in connectFi Yes {
  "type": "string",
  "pattern": "^[0-9a-zA-Z_]+$",
  "minLength": 1,
  "maxLength": 36,
  "$id": "common-id"
}

Request Body

{
  "cFiMerchantId": "2Bc0QW0VYJe7VhTyXXEYNQ",
  "name": "Merchant1",
  "email": "def123.test@email.test",
  "phone": "5555555555",
  "address": "1346 Pleasant Ave",
  "city": "New York",
  "stateCode": "NY",
  "postalCode": "12345",
  "isArchived": false,
  "availablePaymentType": [
    "ach",
    "card"
  ],
  "usePlaid": true
}

Snippet Examples

javascript

const axios = require('axios');
const data = {
  "cFiMerchantId": "2Bc0QW0VYJe7VhTyXXEYNQ",
  "name": "Merchant1",
  "email": "def123.test@email.test",
  "phone": "5555555555",
  "address": "1346 Pleasant Ave",
  "city": "New York",
  "stateCode": "NY",
  "postalCode": "12345",
  "isArchived": false,
  "availablePaymentType": [
    "ach",
    "card"
  ],
  "usePlaid": true
};
const config = {
  method: 'POST',
  url: '${CONNECTFI_BASE_URL}/payment-link/merchant/update',
  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/update" --data "{  \"cFiMerchantId\":\"2Bc0QW0VYJe7VhTyXXEYNQ\", \"name\":\"Merchant1\", \"email\":\"def123.test@email.test\", \"phone\":\"5555555555\", \"address\":\"1346 Pleasant Ave\", \"city\":\"New York\", \"stateCode\":\"NY\", \"postalCode\":\"12345\", \"isArchived\":false, \"availablePaymentType\":[    \"ach\",   \"card\"  ], \"usePlaid\":true}" --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",
  "name": "Merchant1",
  "email": "def123.test@email.test",
  "phone": "5555555555",
  "address": "1346 Pleasant Ave",
  "city": "New York",
  "stateCode": "NY",
  "postalCode": "12345",
  "isArchived": false,
  "availablePaymentType": [
    "ach",
    "card"
  ],
  "usePlaid": true
}

RESPONSE BODY

{
    "code": "0",
    "data": {
        "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
    },
    "requestId": "a5bee2c04e7711efac39cdb5e869de12"
}