SavingsGoal

SavingsGoal

Service to interact with a customer's savings goals

Constructor

new SavingsGoal(options)

Create a new savings goal service

Source:
Parameters:
Name Type Description
options Object

configuration parameters

Methods

addMoneyToSavingsGoal() → {Promise}

Add money to a savings goal

Source:
Parameters:
Name Type Attributes Description
parameters.apiUrl string

the API URL

parameters.accessToken string

the oauth bearer token

parameters.accountUid string

the account uid

parameters.savingsGoalUid string

the savings goal's uid

parameters.transferUid string

a transaction ID for this transaction

parameters.amount number

amount in the minor units of the given currency; eg pence in GBP, cents in EUR

parameters.currency string <optional>

ISO-4217 3 character currency code

Returns:
Type:
Promise
  • the http request promise

createSavingsGoal() → {Promise}

Create a savings goal

Source:
Parameters:
Name Type Attributes Description
parameters.apiUrl string

the API URL

parameters.accessToken string

the oauth bearer token

parameters.accountUid string

the account uid of the account to create the savings goal in

parameters.name string

the name of the new savings goal

parameters.currency string <optional>

ISO-4217 3 character currency code

parameters.targetAmount number <optional>

the target amount in minor units (e.g. 1234 => £12.34)

parameters.targetCurrency string <optional>

ISO-4217 3 character currency code

parameters.base64EncodedPhoto string <optional>

base64 encoded image to associate with the goal

Returns:
Type:
Promise
  • the http request promise

deleteSavingsGoal() → {Promise}

Delete a savings goal

Source:
Parameters:
Name Type Description
parameters.apiUrl string

the API URL

parameters.accessToken string

the oauth bearer token

parameters.accountUid string

the account uid

parameters.savingsGoalUid string

the savings goal's uid

Returns:
Type:
Promise
  • the http request promise

getSavingsGoal() → {Promise}

Get a savings goal

Source:
Parameters:
Name Type Description
parameters.apiUrl string

the API URL

parameters.accessToken string

the oauth bearer token

parameters.accountUid string

the account uid

parameters.savingsGoalUid string

the savings goal's uid

Returns:
Type:
Promise
  • the http request promise

getSavingsGoals() → {Promise}

Get all savings goals

Source:
Parameters:
Name Type Description
parameters.apiUrl string

the API URL

parameters.accessToken string

the oauth bearer token

parameters.accountUid string

the account uid

Returns:
Type:
Promise
  • the http request promise

withdrawMoneyFromSavingsGoal() → {Promise}

Withdraw money from a savings goal

Source:
Parameters:
Name Type Attributes Description
parameters.apiUrl string

the API URL

parameters.accessToken string

the oauth bearer token

parameters.accountUid string

the account uid

parameters.savingsGoalUid string

the savings goal's uid

parameters.transferUid string

a transaction ID for this transaction

parameters.amount number

amount in the minor units of the given currency; eg pence in GBP, cents in EUR

parameters.currency string <optional>

ISO-4217 3 character currency code

Returns:
Type:
Promise
  • the http request promise