Skip to content

Account to Account

Request URL

POST /transfer/acc2acc

Description

This endpoint transfers funds between two accounts belonging to the same user. The accounts are identified in the request body. It does not matter if the accounts are in different back offices, currencies, banks, or time zones.

The transaction does not necessarily happen right away. Instead it goes into a queue for asynchronous execution. If configured to delay, the queue allows cancelling unexecuted transactions by calling the undo method.

Schema

Property table for schema 1 for transfer/acc2acc

Property Description Required Schema
srcAcc srcAcc Yes {
  "type": "string"
}
dstAcc dstAcc Yes {
  "type": "string"
}
amount Amount Yes {
  "type": "string"
}
currency 3-letter ISO alphabetic code to identify the currency Yes {
  "type": "string",
  "pattern": "^[A-Z]{3}$"
}
narrative A brief description No {
  "type": "string",
  "nullable": true
}
narrativeDebit A brief description, used if transaction is debit No {
  "type": "string",
  "nullable": true
}
narrativeCredit A brief description, used if transaction is credit No {
  "type": "string",
  "nullable": true
}

Property table for schema 2 for transfer/acc2acc

Property Description Required Schema
sourceAFiAccountId ampliFi ID of source account Yes {
  "type": "string"
}
destinationAFiAccountId destinationAFiAccountId Yes {
  "type": "string"
}
amount Amount Yes {
  "type": "string"
}
currency 3-letter ISO alphabetic code to identify the currency Yes {
  "type": "string",
  "pattern": "^[A-Z]{3}$"
}
narrative A brief description No {
  "type": "string",
  "nullable": true
}
narrativeDebit A brief description, used if transaction is debit No {
  "type": "string",
  "nullable": true
}
narrativeCredit A brief description, used if transaction is credit No {
  "type": "string",
  "nullable": true
}

Property table for schema 3 for transfer/acc2acc

Property Description Required Schema
srcAcc srcAcc Yes {
  "type": "string"
}
destinationAFiAccountId destinationAFiAccountId Yes {
  "type": "string"
}
amount Amount Yes {
  "type": "string"
}
currency 3-letter ISO alphabetic code to identify the currency Yes {
  "type": "string",
  "pattern": "^[A-Z]{3}$"
}
narrative A brief description No {
  "type": "string",
  "nullable": true
}
narrativeDebit A brief description, used if transaction is debit No {
  "type": "string",
  "nullable": true
}
narrativeCredit A brief description, used if transaction is credit No {
  "type": "string",
  "nullable": true
}

Property table for schema 4 for transfer/acc2acc

Property Description Required Schema
sourceAFiAccountId ampliFi ID of source account Yes {
  "type": "string"
}
dstAcc dstAcc Yes {
  "type": "string"
}
amount Amount Yes {
  "type": "string"
}
currency 3-letter ISO alphabetic code to identify the currency Yes {
  "type": "string",
  "pattern": "^[A-Z]{3}$"
}
narrative A brief description No {
  "type": "string",
  "nullable": true
}
narrativeDebit A brief description, used if transaction is debit No {
  "type": "string",
  "nullable": true
}
narrativeCredit A brief description, used if transaction is credit No {
  "type": "string",
  "nullable": true
}

Request Body

{
  "sourceAFiAccountId": "qwegal8kgtmysmels",
  "destinationAFiAccountId": "qwegalgmnr8njtinq",
  "amount": 0.01,
  "currency": "USD",
  "narrative": "Test"
}

Snippet Examples

javascript

const axios = require('axios');
const data = {
  "sourceAFiAccountId": "qwegal8kgtmysmels",
  "destinationAFiAccountId": "qwegalgmnr8njtinq",
  "amount": 0.01,
  "currency": "USD",
  "narrative": "Test"
}
;
const config = {
  method: 'POST',
  url: '${AMPLIFI_BASE_URL}/transfer/acc2acc',
  headers: {
    'Content-Type': "application/json",
    'token': "A long random string token received from /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 "AMPLIFI_BASE_URL/transfer/acc2acc" --data "{  \"sourceAFiAccountId\":\"qwegal8kgtmysmels\", \"destinationAFiAccountId\":\"qwegalgmnr8njtinq\", \"amount\":0.01, \"currency\":\"USD\", \"narrative\":\"Test\"}" --header "Content-Type: application/json" --header "token: A long random string token received from /token request" 

Successful Response Examples

200 TRANSFER/ACC2ACC SUCCESSFUL RESPONSE QUEUING TRANSFER

HEADERS

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

REQUEST BODY

{
  "sourceAFiAccountId": "qwegal8kgtmysmels",
  "destinationAFiAccountId": "qwegalgmnr8njtinq",
  "amount": 0.01,
  "currency": "USD",
  "narrative": "Test"
}

RESPONSE BODY

{
    "success": true,
    "text": "queued the funds transfer",
    "undo": {
        "id": "ajhut",
        "isActionable": false,
        "dtsQueued": "2023-12-18T13:44:46.919Z",
        "dtsExpiry": "2023-12-19T17:31:26.920Z"
    }
}