Skip to content

Refund Details

Request URL

POST /public/merchant/payment/refund-details

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 retrieve the details of a payment link refund transaction, specified by the cFiTransactionId.

Schema

Property table for public/merchant/payment/refund-details

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": "2RR2QHRIVjm3GfOJCOOmf7"
}

Snippet Examples

javascript

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

RESPONSE BODY

{
    "code": "0",
    "data": {
        "cFiTransactionId": "2RR2QHRIVjm3GfOJCOOmf7",
        "cFiAggregatorId": "CLIENTID",
        "cFiMerchantId": "6i2DdNk8CDfPFzwceE5hC2",
        "cFiMerchantRef": "14",
        "cFiParentId": "1rqF1edFQWTNmliNcIbp29",
        "status": "SentToPay",
        "statusChangeHistory": [
            {
                "initiatorId": "6i2DdNk8CDfPFzwceE5hC2",
                "initiatorType": "merchant",
                "status": "SentToPay",
                "_id": "671bcfe60b60cb137e84293d",
                "dtsCreatedAt": "2024-10-25T17:05:42.782Z",
                "dtsUpdatedAt": "2024-10-25T17:05:42.782Z"
            }
        ],
        "dtsCreatedAt": "2024-10-25T17:05:42.783Z",
        "paymentType": "ach",
        "ach": {
            "payment": {
                "amount": 1.01,
                "currency": "USD"
            },
            "result": {
                "cFiTransactionId": "CLIENTID_2RTuaz88ibQoW2c0OeoCLU",
                "status": "Initiated",
                "effectiveEntryDate": "2024-10-28",
                "dtsCreatedAt": "2024-10-25T17:05:42.836Z"
            }
        }
    },
    "requestId": "6d88cf2092f511ef893705725acd1211"
}