Skip to content

Set Payment Status

Request URL

POST /payment-link/payment/set-status

Description

This endpoint will allow you (the client/platform) to set the status of a specified payment link. The current status and the requested status of the payment link must be either "Error", "SentToPay", "Completed", "Settled", "Returned", or "Declined". The manualStatus property default is 'true' and will lock the status of the specified payment, preventing non-manual status updates. To allow non-manual status updates, set manualStatus: false.

Schema

Property table for payment-link/payment/set-status

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"
}
status Status Yes {
  "type": "string",
  "enum": [ "Initiated", "Sent", "Cancelled",
"Rejected", "Error", "Expired", "Processing",
"SentToPay", "Completed", "Settled",
"Returned", "Declined" ]
}
description Description Yes {
  "type": "string",
  "pattern": "^((?![<>]).)*$",
  "minLength": 0,
  "maxLength": 100,
  "nullable": true,
  "$id": "common-commonStr100"
}
manualStatus true if status is set manually No {
  "type": "boolean",
  "nullable": true
}

Request Body

{
  "cFiTransactionId": "29ljhq5Apu1YfdtU3wN7yx",
  "status": "SentToPay",
  "description": "Set to SentToPay",
  "manualStatus": true
}

Snippet Examples

javascript

const axios = require('axios');
const data = {
  "cFiTransactionId": "29ljhq5Apu1YfdtU3wN7yx",
  "status": "SentToPay",
  "description": "Set to SentToPay",
  "manualStatus": true
};
const config = {
  method: 'POST',
  url: '${CONNECTFI_BASE_URL}/payment-link/payment/set-status',
  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/payment/set-status" --data "{  \"cFiTransactionId\":\"29ljhq5Apu1YfdtU3wN7yx\", \"status\":\"SentToPay\", \"description\":\"Set to SentToPay\", \"manualStatus\":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

{
  "cFiTransactionId": "29ljhq5Apu1YfdtU3wN7yx",
  "status": "SentToPay",
  "description": "Set to SentToPay",
  "manualStatus": true
}

RESPONSE BODY

{
    "code": "0",
    "data": {
        "cFiTransactionId": "29ljhq5Apu1YfdtU3wN7yx",
        "cFiAggregatorId": "CLIENTID",
        "cFiMerchantId": "2Bc0QW0VYJe7VhTyXXEYNQ",
        "payerName": "Doe John",
        "invoiceNumber": "11125",
        "amount": 1.5,
        "currency": "USD",
        "dueDate": "2024-08-29",
        "description": "test description",
        "status": "SentToPay",
        "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-31T11:51:51.929Z",
                "dtsUpdatedAt": "2024-07-31T11:51:51.929Z"
            },
            {
                "initiatorId": "2Bc0QW0VYJe7VhTyXXEYNQ",
                "initiatorType": "merchant",
                "status": "Sent",
                "dtsCreatedAt": "2024-07-31T11:52:47.482Z",
                "dtsUpdatedAt": "2024-07-31T11:52:47.482Z"
            },
            {
                "initiatorType": "public",
                "status": "Processing",
                "dtsCreatedAt": "2024-07-31T12:30:40.679Z",
                "dtsUpdatedAt": "2024-07-31T12:30:40.679Z"
            },
            {
                "initiatorType": "process",
                "status": "SentToPay",
                "dtsCreatedAt": "2024-07-31T16:30:44.936Z",
                "dtsUpdatedAt": "2024-07-31T16:30:44.936Z"
            },
            {
                "login": "CLIENTID",
                "description": "Set to SentToPay",
                "initiatorId": "1HTczC2VSZcJ3BB5pKr09Y",
                "initiatorType": "user",
                "status": "SentToPay",
                "dtsCreatedAt": "2024-08-05T12:32:58.937Z",
                "dtsUpdatedAt": "2024-08-05T12:32:58.937Z"
            }
        ],
        "dtsCreatedAt": "2024-07-31T11:51:51.929Z",
        "dtsUpdatedAt": "2024-08-05T12:32:58.937Z",
        "dtsExpiredAt": "2024-08-30T11:52:47.482Z",
        "link": "4ukiJfoAzD3DCCfdYxNDRh39PfwiKBdqv2JXi33DP3fH228FArivIStaEZc6oG6WII",
        "url": "google.com/payment/4ukiJfoAzD3DCCfdYxNDRh39PfwiKBdqv2JXi33DP3fH228FArivIStaEZc6oG6WII",
        "ach": {
            "payment": {
                "reference": "29ljhq5Apu1YfdtU3wN7yx",
                "effectiveEntryDate": "2024-08-01",
                "companyEntryDescription": "PURCHASE",
                "standardEntryClassCode": "PPD",
                "individualName": "John Doe",
                "routingNumber": "011401533",
                "DFIAccountNumber": "1111222233330000",
                "accountType": "Checking",
                "transactionType": "Credit",
                "amount": 1.5,
                "currency": "USD",
                "webhookUrl": "https://connectfi-payment-link-public.paygears.net/api/public/webhook/ach",
                "clientCode": "CLIENTID"
            },
            "result": {
                "cFiTransactionId": "CLIENTID_1QohoAA3Pm56kZkcXxxv3Q",
                "reference": "29ljhq5Apu1YfdtU3wN7yx",
                "cFiAggregatorId": "CLIENTID",
                "status": "Sent",
                "dtsCreatedAt": "2024-07-31T16:30:45.460Z",
                "dtsSent": "2024-07-31T16:54:47.877Z",
                "effectiveEntryDate": "2024-08-01",
                "individualName": "John Doe",
                "routingNumber": "011401533",
                "amount": 1.5,
                "currency": "USD",
                "DFIAccountNumber": "1111222233330000"
            }
        },
        "dtsSentToPayAt": "2024-07-31T15:35:40.568Z",
        "paymentType": "ach",
        "manualStatus": true,
        "cFiMerchantRef": "1"
    },
    "requestId": "d92c0c60532611efacdc860d03bdc411"
}