ClassPayee Reference
Constructor
The payees array can contain multiple instances of the ClassPayee class, where a payee represents a grouping of one or more beneficiaries together with the same AFiPayeeId. TheM.payees[0]
refers to the first payee belonging to the user. If multiple payees exist, TheM.payees[0]
could be replaced by TheM.payees[1]
, TheM.payees[2]
, etc. Alternatively, you could reference the payee based on the AFiPayeeId, replacing TheM.payees[0]
with TheM.payees['PUT_AFiPayeeId_HERE']
or TheM.payees.payee('PUT_AFiPayeeId_HERE')
.
A new instance of the ClassPayee class is initialized when a modelBank payees pushed
event occurs. A new payee can also be created using await (TheM.payees.newTempPayee(given)).doSubmit()
, where a temporary ClassPayee instance is first created and then submitted to the server. For each ClassPayee instance, there is an associated beneficiaries array. Once a payee has been created, beneficiaries can be added to the beneficiaries array of the payee group by assigning the AFiPayeeId of the new payee group to each beneficiary that should be a part of the group. The properties and methods of the ClassPayee class can be referenced by specifying the payee, followed by the property or method name, like TheM.payees['PUT_AFiPayeeId_HERE'].name.
Example
const newPayee = TheM.payees.newTempPayee({
name: 'Payee Name',
isFavourite: false,
isHidden: false,
imageBase64: 'VeryLongBase64ImageString',
narrativeDebit: 'A brief narrative',
narrativeCredit: 'A brief narrative',
isBusiness: false
});
await newPayee.doSubmit();
Properties
Property table for ClassPayee
Property | Description | Required | Schema |
---|---|---|---|
AFiPayeeId | Gets (returns) the payee group ID in ampliFi. | Yes | { "title": "TheM.payees[0].AFiPayeeId", "type": "string", "description": "Gets (returns) the payee group ID in ampliFi.", "examples": [ "3gzvss70aqhkjh0gcmwz6fr6eutmzmf8" ], "nullable": false } |
AFiUserId | Gets (returns) the user ID in ampliFi. | Yes | { "title": "TheM.payees[0].AFiUserId", "type": "string", "description": "Gets (returns) the user ID in ampliFi.", "examples": [ "testaurlx8wfimcrw" ], "nullable": false } |
beneficiaries | Gets (returns) an array of beneficiaries associated with the payee group for this user. | No | { "title": "TheM.payees[0].beneficiaries", "type": "array", "description": "Gets (returns) an array of beneficiaries associated with the payee group for this user.", "examples": [ [ { "AFiBeneficiaryId": "testpgbenlxuma31jlu", "beneficiaryId": "testpgbenlxuma31jlu", "AFiPayeeId": "3gzvss70aqhkjh0gcmwz6fr6eutmzmf8", "AFiUserId": "testaurlx8wfimcrw", "userId": "testaurlx8wfimcrw", "name": "ACH Payee Account", "destinationName": "Receiving account title", "backOfficeId": "connectFiBOIS", "backOfficeName": "connectFiBOIS", "backOffices": [], "type": "CHECKING", "typeName": "USA interbank transfer", "accountNumber": "1234567890123456", "routingNumber": "123456789", "bankName": "Citibank NA", "txnType": "USA", "status": "Active", "defaultAmount": 0, "defaultCurrency": "USD", "narrativeDebit": "ACH payment", "narrativeCredit": "", "imageBase64": "Very_Long_Base64_Image_String", "dtsCreated": "2024-06-28T11:12:10.053Z", "dtsUpdated": "2024-06-28T11:12:10.053Z", "isActive": true, "isBusiness": false, "isDeleted": false, "isFavourite": false, "isHidden": false, "isPaying": false, "isValid": true, "toJSON": { "AFiBeneficiaryId": "testpgbenlxuma31jlu", "AFiPayeeId": "3gzvss70aqhkjh0gcmwz6fr6eutmzmf8", "accountNumber": "1234567890123456", "routingNumber": "123456789", "bankName": "Citibank NA", "defaultAmount": 20, "destinationName": "Receiving account title", "isActive": true, "isBusiness": false, "isFavourite": true, "isHidden": false, "name": "ACH Payee Account", "narrativeDebit": "ACH payment", "status": "Active", "txnType": "USA", "type": "CHECKING", "imageBase64": "Very_Long_Base64_Image_String", "dtsCreated": "2024-06-28T11:12:10.053Z" }, "transactions": [], "validationMessage": "" } ] ], "default": [] } |
name | Gets (returns) or sets the nickname associated with this payee group. | Yes | { "title": "TheM.payees[0].name", "type": "string", "description": "Gets (returns) or sets the nickname associated with this payee group.", "examples": [ "Test Payee Group" ], "nullable": false } |
imageBase64 | Gets (returns) or sets the image associated with the payee group in base 64 format. | No | { "title": "TheM.payees[0].imageBase64", "type": "string", "description": "Gets (returns) or sets the image associated with the payee group in base 64 format.", "examples": [ "VeryLongBase64ImageString" ], "nullable": true } |
narrativeDebit | Gets (returns) or sets a brief narrative to use for debit transactions for this payee group. | No | { "title": "TheM.payees[0].narrativeDebit", "type": "string", "description": "Gets (returns) or sets a brief narrative to use for debit transactions for this payee group.", "nullable": true, "examples": [ "A brief narrative" ] } |
narrativeCredit | Gets (returns) or sets a brief narrative to use for credit transactions for this payee group. | No | { "title": "TheM.payees[0].narrativeCredit", "type": "string", "description": "Gets (returns) or sets a brief narrative to use for credit transactions for this payee group.", "nullable": true, "examples": [ "A brief narrative" ] } |
toJSON | Gets (returns) the payee properties in a JSON formatted object. | Yes | { "title": "TheM.payees[0].toJSON", "type": "object", "description": "Gets (returns) the payee properties in a JSON formatted object.", "examples": [ { "AFiPayeeId": "3gzvss70aqhkjh0gcmwz6fr6eutmzmf8", "AFiUserId": "testaurlx8wfimcrw", "dtsCreated": "2024-06-28T11:12:10.053Z", "dtsModified": "2024-06-28T11:12:10.053Z", "imageBase64": "VeryLongBase64ImageString", "isBusiness": false, "isFavourite": false, "isHidden": false, "name": "Test Payee Group", "narrativeCredit": "A brief narrative", "narrativeDebit": "A brief narrative" } ], "nullable": false } |
isBusiness | Gets (returns) or sets true if this payee group is marked as a business payee group. | No | { "title": "TheM.payees[0].isBusiness", "type": "boolean", "description": "Gets (returns) or sets true if this payee group is marked as a business payee group.", "examples": [ true, false ], "default": false } |
isHidden | Gets (returns) or sets true if this payee group should be hidden. | No | { "title": "TheM.payees[0].isHidden", "type": "boolean", "description": "Gets (returns) or sets true if this payee group should be hidden.", "examples": [ true, false ], "default": false } |
isFavourite | Gets (returns) or sets true if this payee group is marked as a favorite. | No | { "title": "TheM.payees[0].isFavourite", "type": "boolean", "description": "Gets (returns) or sets true if this payee group is marked as a favorite.", "examples": [ true, false ], "nullable": true } |
isDeleted | Gets (returns) true if this payee group has been deleted. | No | { "title": "TheM.payees[0].isDeleted", "type": "boolean", "description": "Gets (returns) true if this payee group has been deleted.", "examples": [ true, false ] } |
dtsCreated | Gets (returns) the date that the payee group was created. | Yes | { "title": "TheM.payees[0].dtsCreated", "type": "Date", "description": "Gets (returns) the date that the payee group was created.", "examples": [ "Fri Jun 28 2024 07:12:10 GMT-0400 (Eastern Daylight Time)" ], "nullable": false } |
dtsModified | Gets (returns) the date that the payee group was last modified. | Yes | { "title": "TheM.payees[0].dtsModified", "type": "Date", "description": "Gets (returns) the date that the payee group was last modified.", "examples": [ "Fri Jun 28 2024 07:12:10 GMT-0400 (Eastern Daylight Time)" ], "nullable": false } |
Methods
Method Name | Parameter Descriptions | Description | Example |
---|---|---|---|
forTxnType | [ |
Returns a list of beneficiaries in this payee group that match the givenTxnType. This method checks to make sure that the beneficiary txnType is equivalent to givenTxnType when deciding whether the beneficiary should be included. | TheM.payees[0].forTxnType("USA_wire"); |
doRefresh | [] |
Refreshes the TheM.payees[0].beneficiaries list to all current beneficiaries having this payee's same AFiPayeeId property. | TheM.payees[0].doRefresh(); |