Skip to content

List Invoices

Request URL

POST /public/merchant/invoice/list

Description

After authenticating the merchant through your existing front-end merchant portal UI and requesting a merchant JSON Web Token through the `/payment-link/merchant/get-token` endpoint, you may make a call to this endpoint in order to allow the merchant corresponding to the provided 'x-connectfi-jwtoken' header to list the details of previously uploaded invoice file(s) specified by the given properties. This action can also be facilitated through the Payment Link Iframe script when embedded into your existing front-end merchant portal UI.

Schema

Property table for public/merchant/invoice/list

Property Description Required Schema
cFiInvoiceId The ID of the invoice in connectFi No {
  "type": "string",
  "pattern": "^[0-9a-zA-Z_]+$",
  "minLength": 1,
  "maxLength": 36,
  "$id": "common-id"
}
cFiTransactionId The transaction ID in the connectFi system Yes {
  "type": "string",
  "pattern": "^[0-9a-zA-Z_]+$",
  "minLength": 1,
  "maxLength": 36,
  "$id": "common-id"
}

Request Body

{
  "cFiInvoiceId": "TcwgOjo16D0pNKQsqKjp7",
  "cFiTransactionId": "yJ6pRvSIsp26qbbLgMVX3"
}

Snippet Examples

javascript

const axios = require('axios');
const data = {
  "cFiInvoiceId": "TcwgOjo16D0pNKQsqKjp7",
  "cFiTransactionId": "yJ6pRvSIsp26qbbLgMVX3"
};
const config = {
  method: 'POST',
  url: '${CONNECTFI_BASE_URL}/public/merchant/invoice/list',
  headers: {
    'Content-Type': "application/json",
    'x-connectfi-jwtoken': "A long random string token received from /payment-link/merchant/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/public/merchant/invoice/list" --data "{  \"cFiInvoiceId\":\"TcwgOjo16D0pNKQsqKjp7\", \"cFiTransactionId\":\"yJ6pRvSIsp26qbbLgMVX3\"}" --header "Content-Type: application/json" --header "x-connectfi-jwtoken: A long random string token received from /payment-link/merchant/get-token request" 

Successful Response Examples

200 SUCCESSFUL RESPONSE

HEADERS

Header Value
Content-Type application/json
x-connectfi-jwtoken A long random string token received from /payment-link/merchant/get-token request

REQUEST BODY

{
  "cFiInvoiceId": "TcwgOjo16D0pNKQsqKjp7",
  "cFiTransactionId": "yJ6pRvSIsp26qbbLgMVX3"
}

RESPONSE BODY

{
    "code": "0",
    "data": [
        {
            "cFiInvoiceId": "TcwgOjo16D0pNKQsqKjp7",
            "cFiMerchantId": "2Bc0QW0VYJe7VhTyXXEYNQ",
            "fileName": "Document Example.pdf",
            "size": 33319,
            "cFiTransactionId": "yJ6pRvSIsp26qbbLgMVX3",
            "path": "public/merchant/invoice/file/TcwgOjo16D0pNKQsqKjp7/?x-connectfi-jwtoken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjRmlNZXJjaGFudElkIjoiMkJjMFFXMFZZSmU3VmhUeVhYRVlOUSIsImNGaUFnZ3JlZ2F0b3JJZCI6ImV2b2x2ZSIsImlhdCI6MTcyMjQyMjUyMywiZXhwIjoxNzIyNDI2MTIzfQ.dYH8iXqQQ9HFfKGOR2OCQdrXLEgUXyJE-nPz1jWT50Y"
        }
    ],
    "requestId": "c59790c04f2a11ef92543a54d404e711"
}

200 SUCCESSFUL RESPONSE - NO MATCHES

HEADERS

Header Value
Content-Type application/json
x-connectfi-jwtoken A long random string token received from /payment-link/merchant/get-token request

REQUEST BODY

{
  "cFiTransactionId": "yJ6pRvSIsp26qbbLgMVX3"
}

RESPONSE BODY

{
    "code": "0",
    "data": [],
    "requestId": "3ba1128054aa11efb9c8eca582d34911"
}