Skip to content

Create Merchant

Request URL

POST /payment-link/merchant/create

Description

This endpoint allows you (the client/platform) to create a new merchant entity. This step is necessary in order to enable the merchant to create payment links for sending to customers.

Schema

Property table for payment-link/merchant/create

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"
}
reference An external alphanumeric reference ID for the entity in your system Yes {
  "type": "string",
  "pattern": "^[0-9a-zA-Z]+$",
  "minLength": 1,
  "maxLength": 32,
  "$id": "common-reference"
}

Request Body

{
  "reference": "1",
  "name": "Merchant1",
  "isArchived": false,
  "email": "abc.test@email.test",
  "phone": "5556667777",
  "address": "123 Main Street",
  "city": "Oklahoma City",
  "stateCode": "OK",
  "postalCode": "12345",
  "availablePaymentType": [
    "ach",
    "card"
  ],
  "usePlaid": true
}

Snippet Examples

javascript

const axios = require('axios');
const data = {
  "reference": "1",
  "name": "Merchant1",
  "isArchived": false,
  "email": "abc.test@email.test",
  "phone": "5556667777",
  "address": "123 Main Street",
  "city": "Oklahoma City",
  "stateCode": "OK",
  "postalCode": "12345",
  "availablePaymentType": [
    "ach",
    "card"
  ],
  "usePlaid": true
};
const config = {
  method: 'POST',
  url: '${CONNECTFI_BASE_URL}/payment-link/merchant/create',
  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/create" --data "{  \"reference\":\"1\", \"name\":\"Merchant1\", \"isArchived\":false, \"email\":\"abc.test@email.test\", \"phone\":\"5556667777\", \"address\":\"123 Main Street\", \"city\":\"Oklahoma City\", \"stateCode\":\"OK\", \"postalCode\":\"12345\", \"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

{
  "reference": "1",
  "name": "Merchant1",
  "isArchived": false,
  "email": "abc.test@email.test",
  "phone": "5556667777",
  "address": "123 Main Street",
  "city": "Oklahoma City",
  "stateCode": "OK",
  "postalCode": "12345",
  "availablePaymentType": [
    "ach",
    "card"
  ],
  "usePlaid": true
}

RESPONSE BODY

{
    "code": "0",
    "data": {
        "name": "Merchant1",
        "isArchived": false,
        "email": "abc.test@email.test",
        "phone": "5556667777",
        "address": "123 Main Street",
        "city": "Oklahoma City",
        "stateCode": "OK",
        "postalCode": "12345",
        "availablePaymentType": [
            "ach",
            "card"
        ],
        "usePlaid": true,
        "reference": "1",
        "cFiAggregatorId": "CLIENTID",
        "cFiMerchantId": "2Bc0QW0VYJe7VhTyXXEYNQ",
        "dtsCreatedAt": "2024-07-30T13:22:20.560Z",
        "dtsUpdatedAt": "2024-07-30T13:22:20.560Z",
        "logos": [],
        "daysToPaymentExpired": 30
    },
    "requestId": "bff470704e7611efac39cdb5e869de12"
}