Skip to content

Get Invoice

Request URL

GET /public/merchant/invoice/file/:cFiInvoiceId

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 view a previously uploaded invoice file specified by the given cFiInvoiceId as a path parameter. This action can also be facilitated through the Payment Link Iframe script when embedded into your existing front-end merchant portal UI.

Snippet Examples

javascript

const axios = require('axios');
const config = {
  method: 'GET',
  url: '${CONNECTFI_BASE_URL}/public/merchant/invoice/file/:cFiInvoiceId',
  headers: {
    'x-connectfi-jwtoken': "A long random string token received from /payment-link/merchant/get-token request"
  },
};

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/file/:cFiInvoiceId"  --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
x-connectfi-jwtoken A long random string token received from /payment-link/merchant/get-token request

PARAMETERS

Parameter Description Value
cFiInvoiceId TcwgOjo16D0pNKQsqKjp7

REQUEST BODY

none

RESPONSE BODY

//Invoice file will appear as a media type response