Skip to content

Upload Merchant Logo

Request URL

POST /payment-link/merchant/:cFiMerchantId/logo/upload/:type

Description

This endpoint will allow you (the client/platform) to upload a logo image to be associated with the specified merchant. Uploaded images must be a supported image format. The type of logo image can be specified through the ":type" path parameter, such as "light", "dark", "big", "small", etc. Multiple logos may be uploaded for the same Merchant.

Request Body

File should be uploaded as multipart/form-data.

Snippet Examples

javascript

const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const fileStream = fs.createReadStream('./file/path/fileName.jpg');
const form = new FormData();
form.append('file', fileStream, 'fileName.jpg');
const data = form;
const config = {
  method: 'POST',
  url: '${CONNECTFI_BASE_URL}/payment-link/merchant/:cFiMerchantId/logo/upload/:type',
  headers: {
    ...form.getHeaders(),
    '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/:cFiMerchantId/logo/upload/:type" --form "file=@./file/path/fileName.jpg" --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 multipart/form-data
x-connectfi-token A long random string token received from /auth/get-token request

PARAMETERS

Parameter Description Value
cFiMerchantId 2Bc0QW0VYJe7VhTyXXEYNQ
type light1

REQUEST BODY

none

RESPONSE BODY

{
    "code": "0",
    "data": {
        "logoId": "1DpCjl6uBEyNLmnGNepALE"
    },
    "requestId": "35b03c104e7f11efac39cdb5e869de12"
}