Skip to content

Autofunding Reference

Constructor

An instance of the Autofunding class is created automatically when the externalAccounts submodule is initialized. Additional, temporary instantiations of the Autofunding class can be created using TheM.externalAccounts.newAutofunding(given).

//occurs automatically with initialization of the externalAccounts submodule

Example

//Temporary Autofunding class instance
let tempAutofunding = TheM.externalAccounts.newAutofunding({
  AFiExternalAccountId: 'qweealxt6213tavxcsmyztaio',
  amount: 20,
  cadence: 'when_low',
  currency: 'USD',
  lowAmount: 15
}

Properties

Property table for Autofunding

Property Description Required Schema
AFiExternalAccountId Gets (returns) or sets the ID of the external account in ampliFi to use for autofunding. No {
  "title":
"TheM.externalAccounts.autofunding.AFiExterna
lAccountId",
  "type": "string",
  "nullable": true,
  "description": "Gets (returns) or sets the ID of the
external account in ampliFi to use for
autofunding.",
  "$comment": "getter setter",
  "examples": [
    "qweealxsye6pizvuubieaoyoe"
  ]
}
externalAccount Gets (returns) or sets the ExternalAccount instance representing the external account to use for autofunding transactions. No {
  "title":
"TheM.externalAccounts.autofunding.externalAc
count",
  "type": "string",
  "description": "Gets (returns) or sets the
ExternalAccount instance representing the
external account to use for autofunding
transactions.",
  "$comment": "getter setter",
  "examples": [
    {
      "AFiExternalAccountId":
"qweealxsye6pizvuubieaoyoe",
      "accountNumberMasked": "4...0004",
      "bankName": "Debit card",
      "comment": "Adding new individual debit card",
      "dtsCreated": "Fri Jun 28 2024 07:12:10 GMT-0400
(Eastern Daylight Time)",
      "dtsModified": "Fri Jun 28 2024 07:12:10 GMT-0400
(Eastern Daylight Time)",
      "name": "Individual debit card",
      "networkName": "Visa",
      "panMasked": "4...0004",
      "type": "DEBITCARD",
      "isActive": true,
      "isPending": false,
      "isSyncedToServer": true,
      "isValid": false,
      "isVerified": true,
      "toJSON": {
        "AFiExternalAccountId":
"qweealxsye6pizvuubieaoyoe",
        "comment": "Individual debit card",
        "dtsModified": "Fri Jun 28 2024 07:12:10 GMT-0400
(Eastern Daylight Time)",
        "isActive": true,
        "isSyncedToServer": true,
        "isVerified": true,
        "name": "Individual debit card",
        "name_on_card": "SUZY QUEUE TESTER",
        "panMasked": "4...0004",
        "type": "DEBITCARD"
      },
      "validationMessage": "The card number is invalid"
    },
    {
      "AFiExternalAccountId":
"qweealxszpo0chsufhuxwwesv",
      "accountNumber": "123467890123456",
      "accountNumberMasked": "...3456",
      "bankName": "Bank ABC",
      "comment": "Bank Account",
      "dtsCreated": "Fri Jun 28 2024 07:12:10 GMT-0400
(Eastern Daylight Time)",
      "dtsModified": "Fri Jun 28 2024 07:12:10 GMT-0400
(Eastern Daylight Time)",
      "name": "Bank Account",
      "routingNumber": "103112617",
      "title": "Suzy Tester",
      "type": "CHECKING",
      "isActive": true,
      "isPending": false,
      "isSyncedToServer": true,
      "isValid": true,
      "isVerified": true,
      "toJSON": {
        "AFiExternalAccountId":
"qweealxszpo0chsufhuxwwesv",
        "accountNumberMasked": "*****3456",
        "bankName": "Bank ABC",
        "comment": "Bank Account",
        "dtsModified": "Fri Jun 28 2024 07:12:10 GMT-0400
(Eastern Daylight Time)",
        "isActive": true,
        "isSyncedToServer": true,
        "isVerified": true,
        "name": "Bank Account",
        "routingNumber": "103112617",
        "title": "Suzy Tester",
        "type": "CHECKING"
      },
      "validationMessage": ""
    }
  ]
}
cadence Gets (returns) or sets the cadence (schedule) that should be used to determine when the account should be autofunded. No {
  "title":
"TheM.externalAccounts.autofunding.cadence",
  "type": "string",
  "description": "Gets (returns) or sets the cadence
(schedule) that should be used to determine when the
account should be autofunded.",
  "$comment": "getter setter",
  "examples": [
    "weekly",
    "monthly",
    "when_low"
  ]
}
weekday Gets (returns) or sets the day of the week that autofunding should occur. Required if cadence is 'weekly'. No {
  "title":
"TheM.externalAccounts.autofunding.weekday",
  "type": "string",
  "nullable": true,
  "description": "Gets (returns) or sets the day of
the week that autofunding should occur. Required if
cadence is 'weekly'.",
  "$comment": "getter setter",
  "examples": [
    "Sun",
    "Mon",
    "Tue",
    "Wed",
    "Thu",
    "Fri",
    "Sat"
  ]
}
day Gets (returns) or sets the day of the month that autofunding should occur as a number between 1 and 31, inclusive. Required if cadence is 'monthly'. If there are less days in the current month than the value of the day property, the autopayment will roll over to the beginning of the following month. For example, if the day property is set to a value of 31 and the current month has only 30 days, then the autopayment will occur on the first day of the following month. No {
  "title":
"TheM.externalAccounts.autofunding.day",
  "type": "number",
  "nullable": true,
  "description": "Gets (returns) or sets the day of
the month that autofunding should occur as a number
between 1 and 31, inclusive. Required if cadence is
'monthly'. If there are less days in the current
month than the value of the day property, the
autopayment will roll over to the beginning of the
following month. For example, if the day property
is set to a value of 31 and the current month has only
30 days, then the autopayment will occur on the first
day of the following month.",
  "$comment": "getter setter",
  "examples": [
    1,
    2,
    15,
    30,
    31
  ]
}
lowAmount Gets (returns) or sets the account balance threshold at which to initiate the autofunding. Required if cadence is 'when_low'. No {
  "title":
"TheM.externalAccounts.autofunding.lowAmount"
,
  "type": "number",
  "nullable": true,
  "description": "Gets (returns) or sets the account
balance threshold at which to initiate the
autofunding. Required if cadence is 'when_low'.",
  "$comment": "getter setter",
  "examples": [
    10,
    150,
    25
  ]
}
amount Gets (returns) or sets the amount that should be transferred when autofunding occurs. Required for autofunding to be valid. It may be subject to a pre-specified maximum or minimum which can be configured using TheM.fdrs.externalAccountsConfig.minTopup and TheM.fdrs.externalAccountsConfig.maxTopup. Yes {
  "title":
"TheM.externalAccounts.autofunding.amount",
  "type": "number",
  "nullable": false,
  "description": "Gets (returns) or sets the amount
that should be transferred when autofunding
occurs. Required for autofunding to be valid. It may
be subject to a pre-specified maximum or minimum
which can be configured using
TheM.fdrs.externalAccountsConfig.minTopup and
TheM.fdrs.externalAccountsConfig.maxTopup.",
  "$comment": "getter setter",
  "examples": [
    20,
    150,
    500
  ]
}
currency Gets (returns) or sets the currency for autofunding. Required for autofunding to be valid. No {
  "title":
"TheM.externalAccounts.autofunding.currency",
  "type": "string",
  "default": "USD",
  "description": "Gets (returns) or sets the
currency for autofunding. Required for
autofunding to be valid.",
  "$comment": "getter setter",
  "examples": [
    "USD"
  ]
}
dtsNext Gets (returns) the date that the next autofunding transfer is scheduled to occur. If the cadence property is set to 'when_low', then the dtsNext property will be undefined. No {
  "title":
"TheM.externalAccounts.autofunding.dtsNext",
  "type": "Date",
  "description": "Gets (returns) the date that the
next autofunding transfer is scheduled to occur. If
the cadence property is set to 'when_low', then
the dtsNext property will be undefined.",
  "$comment": "getter",
  "examples": [
    "Fri Jul 05 2024 09:12:10 GMT-0400 (Eastern
Daylight Time)"
  ]
}
daysLeft Gets (returns) the number of days left until the next autofunding transfer is scheduled to occur. The daysLeft value is calculated by finding the difference between the dtsNext date and the current date. No {
  "title":
"TheM.externalAccounts.autofunding.daysLeft",
  "type": "number",
  "description": "Gets (returns) the number of days
left until the next autofunding transfer is
scheduled to occur. The daysLeft value is
calculated by finding the difference between the
dtsNext date and the current date.",
  "$comment": "getter",
  "examples": [
    "7"
  ]
}
isEnabled Gets (returns) true if autofunding is enabled and valid. Can set false to remove current cadence. If set to false, the cadence property (and any properties dependent on cadence) will be undefined. To reenable autofunding, you will need to set the desired cadence, along with any properties that are dependent on cadence. For example, if autofunding is disabled, you could set cadence = 'weekly' and weekday = 'Mon' to reenable autofunding. If the current property values represent a valid autofunding set up, isEnabled will return true. No {
  "title":
"TheM.externalAccounts.autofunding.isEnabled"
,
  "type": "boolean",
  "description": "Gets (returns) true if
autofunding is enabled and valid. Can set false to
remove current cadence. If set to false, the
cadence property (and any properties dependent
on cadence) will be undefined. To reenable
autofunding, you will need to set the desired
cadence, along with any properties that are
dependent on cadence. For example, if
autofunding is disabled, you could set cadence =
'weekly' and weekday = 'Mon' to reenable
autofunding. If the current property values
represent a valid autofunding set up, isEnabled
will return true.",
  "$comment": "getter setter",
  "examples": [
    true,
    false
  ]
}
isValid Gets (returns) true if autofunding is valid with current properties. For an autofunding set up to be valid, AFiExternalAccountId must represent an active user account, the amount, currency, and cadence must be valid, and there must be an additional property present that is appropriate based on the cadence value (if cadence = 'weekly', then weekday must be defined, etc.) No {
  "title":
"TheM.externalAccounts.autofunding.isValid",
  "type": "boolean",
  "description": "Gets (returns) true if
autofunding is valid with current properties. For
an autofunding set up to be valid,
AFiExternalAccountId must represent an active
user account, the amountcurrency, and
cadence must be valid, and there must be an
additional property present that is appropriate
based on the cadence value (if cadence =
'weekly', then weekday must be defined, etc.)",
  "$comment": "getter",
  "examples": [
    true,
    false
  ]
}
toJSON Gets (returns) a JSON formated object containing autofunding properties. Yes {
  "title":
"TheM.externalAccounts.autofunding.toJSON",
  "type": "object",
  "description": "Gets (returns) a JSON formated
object containing autofunding properties.",
  "$comment": "getter",
  "examples": [
    {
      "AFiExternalAccountId":
"qweealxsye6pizvuubieaoyoe",
      "amount": "100",
      "currency": "USD",
      "cadence": "monthly",
      "day": 15
    }
  ],
  "nullable": false
}