Skip to content

ACH Refund

Request URL

POST /public/merchant/payment/ach/refund

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 request a full or partial refund of a previously settled ACH payment. In order to successfully request an ACH refund, the following criteria must be met.

  • The original payment must be in a "Settled" status.

  • The original payment must have an "ach" paymentType.

  • The currency must be a supported currency (i.e. "USD").

  • The sum of requested refunds for an ACH payment must not exceed the original parent payment amount.

Schema

Property table for public/merchant/payment/ach/refund

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"
}
amount Amount Yes {
  "type": "number",
  "exclusiveMinimum": 0,
  "amountPrecision": 2,
  "$id": "common-amount"
}
currency A three character ISO alphabetic code to identify the currency Yes {
  "type": "string",
  "maxLength": 3,
  "minLength": 3,
  "pattern": "^[A-Z]+$",
  "$id": "common-currency"
}

Request Body

{
    "cFiTransactionId": "1rqF1edFQWTNmliNcIbp29",
    "amount": 1.01,
    "currency": "USD"
  }

Snippet Examples

javascript

const axios = require('axios');
const data = {
    "cFiTransactionId": "1rqF1edFQWTNmliNcIbp29",
    "amount": 1.01,
    "currency": "USD"
  };
const config = {
  method: 'POST',
  url: '${CONNECTFI_BASE_URL}/public/merchant/payment/ach/refund',
  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/ach/refund" --data "{    \"cFiTransactionId\":\"1rqF1edFQWTNmliNcIbp29\",   \"amount\":1.01,   \"currency\":\"USD\"  }" --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": "1rqF1edFQWTNmliNcIbp29",
    "amount": 1.01,
    "currency": "USD"
  }

RESPONSE BODY

{
    "code": "0",
    "data": {
        "cFiTransactionId": "2RR2QHRIVjm3GfOJCOOmf7",
        "cFiAggregatorId": "CLIENTID",
        "cFiMerchantId": "6i2DdNk8CDfPFzwceE5hC2",
        "cFiParentId": "1rqF1edFQWTNmliNcIbp29",
        "status": "SentToPay",
        "statusChangeHistory": [
            {
                "initiatorId": "6i2DdNk8CDfPFzwceE5hC2",
                "initiatorType": "merchant",
                "status": "SentToPay",
                "dtsCreatedAt": "2024-10-25T17:05:42.782Z",
                "dtsUpdatedAt": "2024-10-25T17:05:42.782Z"
            }
        ],
        "paymentType": "ach",
        "ach": {
            "payment": {
                "reference": "2RR2QHRIVjm3GfOJCOOmf7",
                "effectiveEntryDate": "2024-10-28",
                "companyEntryDescription": "PURCHASE",
                "standardEntryClassCode": "PPD",
                "individualName": "Doe John",
                "routingNumber": "103112617",
                "DFIAccountNumber": "123456789",
                "accountType": "Checking",
                "transactionType": "Debit",
                "amount": 1.01,
                "currency": "USD",
                "webhookUrl": "https://connectfi-payment-link-public.paygears.net/api/public/webhook/ach"
            },
            "result": {
                "cFiTransactionId": "CLIENTID_2RTuaz88ibQoW2c0OeoCLU",
                "reference": "2RR2QHRIVjm3GfOJCOOmf7",
                "cFiAggregatorId": "CLIENTID",
                "status": "Initiated",
                "dtsCreatedAt": "2024-10-25T17:05:42.836Z",
                "effectiveEntryDate": "2024-10-28",
                "individualName": "Doe John",
                "routingNumber": "103112617",
                "amount": 1.01,
                "currency": "USD",
                "DFIAccountNumber": "123456789"
            }
        },
        "dtsCreatedAt": "2024-10-25T17:05:42.783Z",
        "dtsUpdatedAt": "2024-10-25T17:05:42.878Z"
    },
    "requestId": "5e3c67e092f311ef893705725acd1211"
}