Skip to content

Send Payment Link

Request URL

POST /public/merchant/payment/send

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 send an existing payment link, specified by the "cFiTransactionId" property, for payment. This action can also be facilitated through the Payment Link Iframe script when embedded into your existing front-end merchant portal UI.

By default, the payment link will be automatically sent via email to the customer through our system. Alternatively, you can speak to a support representative to request payment link details via webhook instead. If you choose to receive the "Sent" payment link details via webhook, an email will not be automatically delivered to the customer upon sending. Instead, the payment link details will be sent to you via your configured webhook URL, along with generated payment page HTML code as a string. You may use the provided payment page HTML when sending the customer email from your system, or you may create your own payment page using /public/customer endpoint requests.

Schema

Property table for public/merchant/payment/send

Property Description Required Schema
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

{
     "cFiTransactionId": "7l7TrL0ZukBQR4H4W2fsvT"
}

Snippet Examples

javascript

const axios = require('axios');
const data = {
     "cFiTransactionId": "7l7TrL0ZukBQR4H4W2fsvT"
};
const config = {
  method: 'POST',
  url: '${CONNECTFI_BASE_URL}/public/merchant/payment/send',
  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/payment/send" --data "{     \"cFiTransactionId\":\"7l7TrL0ZukBQR4H4W2fsvT\"}" --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

{
     "cFiTransactionId": "7l7TrL0ZukBQR4H4W2fsvT"
}

RESPONSE BODY

{
    "code": "0",
    "data": {
        "cFiTransactionId": "7l7TrL0ZukBQR4H4W2fsvT",
        "cFiAggregatorId": "CLIENTID",
        "cFiMerchantId": "2Bc0QW0VYJe7VhTyXXEYNQ",
        "payerName": "Doe John",
        "cFiMerchantRef": "1",
        "invoiceNumber": "11125",
        "amount": 1.5,
        "currency": "USD",
        "dtsExpiredAt": "2024-08-29T17:56:45.189Z",
        "dueDate": "2024-08-29",
        "description": "test description",
        "status": "Sent",
        "fields": [
            {
                "index": 1,
                "code": "firstName",
                "label": "First Name",
                "value": "John"
            },
            {
                "index": 2,
                "code": "lastName",
                "label": "Last Name",
                "value": "Doe"
            },
            {
                "index": 3,
                "code": "email",
                "label": "Email",
                "value": "customer_email@email.test"
            },
            {
                "index": 4,
                "code": "phone",
                "label": "Phone",
                "value": "15555555555"
            }
        ],
        "availablePaymentType": [
            "card",
            "ach"
        ],
        "statusChangeHistory": [
            {
                "initiatorId": "2Bc0QW0VYJe7VhTyXXEYNQ",
                "initiatorType": "merchant",
                "status": "Initiated",
                "dtsCreatedAt": "2024-07-30T17:55:44.024Z",
                "dtsUpdatedAt": "2024-07-30T17:55:44.024Z"
            },
            {
                "initiatorId": "2Bc0QW0VYJe7VhTyXXEYNQ",
                "initiatorType": "merchant",
                "status": "Sent",
                "dtsCreatedAt": "2024-07-30T17:56:45.190Z",
                "dtsUpdatedAt": "2024-07-30T17:56:45.190Z"
            }
        ],
        "dtsCreatedAt": "2024-07-30T17:55:44.024Z",
        "link": "3zjGoeyuHi1bPgCNgb2B1JERhfzLWU0SogPsgBG0nbb3d4RAHH2APVeyqldsOiH8C",
        "url": "google.com/payment/3zjGoeyuHi1bPgCNgb2B1JERhfzLWU0SogPsgBG0nbb3d4RAHH2APVeyqldsOiH8C"
    },
    "requestId": "1599d5d04e9d11ef92543a54d404e711"
}