Push To External Account
Request URL
POST /externalaccount/push
Description
This method pushes a specified amount of money to the specified external account (from the account corresponding to AFiAccountId or the user's main account). The external account ID must be specified in the request body, along with the amount and currency.
The amount is deducted from the AFiAccountId account (or user's main account if not specified) and is deposited in the AFiExternalAccountId account. It may be subject to a pre-specified maximum and minimum. Optionally, the push may be labeled as recurring, to indicate that it is part of a repeating series.
The request will be presented for fulfillment to a suitable back office. If the external account is already linked to a back office, this will be used. Otherwise a back office will be selected if possible.
Schema
Property table for externalaccount/push
Property | Description | Required | Schema |
---|---|---|---|
amount | Amount | Yes | { "type": "number", "minimum": 0, "maximum": 1001 } |
currency | 3-letter ISO alphabetic code to identify the currency | Yes | { "type": "string", "enum": [ "USD" ] } |
AFiExternalAccountId | The external account ID in ampliFi | Yes | { "type": "string" } |
isRecurring | true if this transaction is recurring | No | { "type": "boolean", "default": false, "nullable": true } |
AFiEARequestId | The external account request ID in ampliFi | No | { "type": "string", "nullable": true } |
AFiAccountId | ampliFi ID for the account | No | { "type": "string", "nullable": true } |
account | Account details | No | account object |
Property table for account object
Property | Description | Required | Schema |
---|---|---|---|
AFiAccountId | ampliFi ID for the account | No | { "type": "string", "nullable": true } |
Request Body
{
"AFiExternalAccountId": "qweealasn0avuygieaupmevow",
"amount": 1.00,
"currency": "USD",
"isRecurring": false
}
Snippet Examples
javascript
const axios = require('axios');
const data = {
"AFiExternalAccountId": "qweealasn0avuygieaupmevow",
"amount": 1.00,
"currency": "USD",
"isRecurring": false
};
const config = {
method: 'POST',
url: '${AMPLIFI_BASE_URL}/externalaccount/push',
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/externalaccount/push" --data "{ \"AFiExternalAccountId\":\"qweealasn0avuygieaupmevow\", \"amount\":1.00, \"currency\":\"USD\", \"isRecurring\":false}" --header "Content-Type: application/json" --header "token: A long random string token received from /token request"
Successful Response Examples
200 EXTERNALACCOUNT/PUSH SUCCESSFUL RESPONSE TRANSFER FUNDS TO EXTERNAL ACCOUNT
HEADERS
Header | Value |
---|---|
Content-Type | application/json |
token | A long random string token received from /token request |
REQUEST BODY
RESPONSE BODY