Skip to content

Retract Wire

Request URL

POST /transfer-to/wire/retract-delayed

Description

If the response to a /transfer-to/wire request includes the "transactionDelayedCode" property and a status of "Initiated", then the wire transfer has been initiated in connectFi, but has not yet been moved to "Sent" because of the response received from the back office. These transactions are delayed, placed into the job queue, and retried automatically.

The /transfer-to/wire/retract-delayed endpoint allows you to retract, or cancel, a transaction that has been delayed. Transactions can only be retracted while they are in the "Initiated" status and have not been locked for retry. Once the transaction has been locked for resending, it may not be cancelled.

Possible transactionDelayedCodes are listed below.

transactionDelayedCode Description Back Office Status
Nightly_Updates Function is not available during Nightly Updates. This wire was attempted during the back office nightly maintenance cycle. It will be saved and automatically retried unless cancelled through a /transfer-to/wire/retract-delayed request. 500
Amount_Exceeds_Balance The transaction amount exceeds the available balance in the sending account (insufficient funds available). An alert will be sent to the configured email address. Action should be taken by the account owner to ensure that the available balance is sufficient. It will be saved and automatically retried unless cancelled through a /transfer-to/wire/retract-delayed request. 409

Schema

Property table for transfer-to/wire/retract-delayed

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"
}
description Description Yes {
  "type": "string",
  "pattern": "^((?![<>]).)*$",
  "minLength": 0,
  "maxLength": 500,
  "nullable": true,
  "$id": "common-commonStr500"
}

Request Body

{
    "cFiTransactionId": "CLIENTID_14sQNXqI0ApeVNOPrfcpA5",
    "description": "Cancelling delayed transaction"
}

Snippet Examples

javascript

const axios = require('axios');
const data = {
    "cFiTransactionId": "CLIENTID_14sQNXqI0ApeVNOPrfcpA5",
    "description": "Cancelling delayed transaction"
}
;
const config = {
  method: 'POST',
  url: '${CONNECTFI_BASE_URL}/transfer-to/wire/retract-delayed',
  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/transfer-to/wire/retract-delayed" --data "{    \"cFiTransactionId\":\"CLIENTID_14sQNXqI0ApeVNOPrfcpA5\",   \"description\":\"Cancelling delayed transaction\"}" --header "Content-Type: application/json" --header "x-connectfi-token: A long random string token received from /auth/get-token request" 

Successful Response Examples

200 TRANSFER-TO/WIRE/RETRACT-DELAYED SUCCESSFUL RESPONSE CANCELLING AMOUNT_EXCEEDS_BALANCE TRANSFER

HEADERS

Header Value
Content-Type application/json
x-connectfi-token A long random string token received from /auth/get-token request

REQUEST BODY

{
    "cFiTransactionId": "CLIENTID_2d26B0bOi02esT3DRCHgBP",
    "description": "Cancelling delayed transaction"
}

RESPONSE BODY

{
    "code": "0",
    "data": {
        "status": "Cancelled",
        "amount": 16.97,
        "currency": "USD",
        "reference": "externalTrnId2175",
        "cFiTransactionId": "CLIENTID_2d26B0bOi02esT3DRCHgBP",
        "error": {
            "dtsError": "2024-02-16T19:12:12.000Z",
            "code": "extWire",
            "subCode": 409,
            "message": "Amount Exceeds Balance."
        },
        "dtsCreatedAt": "2024-02-16T19:12:10.259Z"
    },
    "requestId": "4f0b4710ccff11eebb061f991c0df212"
}

200 TRANSFER-TO/WIRE/RETRACT-DELAYED SUCCESSFUL RESPONSE CANCELLING NIGHTLY_UPDATES TRANSFER

HEADERS

Header Value
Content-Type application/json
x-connectfi-token A long random string token received from /auth/get-token request

REQUEST BODY

{
    "cFiTransactionId": "CLIENTID_sjxl064zIWBMnPtE3m0IF",
    "description": "Cancelling delayed transaction"
}

RESPONSE BODY

{
    "code": "0",
    "data": {
        "status": "Cancelled",
        "amount": 16.95,
        "currency": "USD",
        "reference": "externalTrnId2176",
        "cFiTransactionId": "CLIENTID_sjxl064zIWBMnPtE3m0IF",
        "error": {
            "dtsError": "2024-02-16T19:12:12.000Z",
            "code": "extWire",
            "subCode": 500,
            "message": "Function is not available during Nightly Updates"
        },
        "dtsCreatedAt": "2024-02-16T19:12:10.259Z"
    },
    "requestId": "4f0b4710ccff11eebb061f991c0df212"
}