SavingsGoals

SavingsGoals

Service to interact with a customer's savings goals

Constructor

new SavingsGoals(options)

Create a new savings goal service

Source:
Parameters:
Name Type Description
options Object

configuration parameters

Methods

addMoneyToSavingsGoal(accessToken, savingsGoalId, transactionId, amount) → {Promise}

Add money to a specific savings goal

Source:
Parameters:
Name Type Description
accessToken string

the oauth bearer token.

savingsGoalId string

the savings goal's ID.

transactionId string

a transaction ID for this transaction

amount number

an amount in minor unit

Returns:
Type:
Promise
  • the http request promise

createSavingsGoal(accessToken, savingsGoalId, name, currency, targetAmount, targetCurrency, base64EncodedPhoto) → {Promise}

Creates a savings goal

Source:
Parameters:
Name Type Description
accessToken string

the oauth bearer token.

savingsGoalId string

the savings goal's ID, generate one if creating a goal.

name string

the name of the new contact.

currency string

the currency of the savings goal. Defaults to 'GBP'.

targetAmount number

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

targetCurrency string

the target currency, also defaults to 'GBP'.

base64EncodedPhoto string

base64 encoded image to associate with the goal. (optional)

Returns:
Type:
Promise
  • the http request promise

deleteSavingsGoal(accessToken, savingsGoalId) → {Promise}

Deletes specific savings goal

Source:
Parameters:
Name Type Description
accessToken string

the oauth bearer token.

savingsGoalId string

the unique mandate ID

Returns:
Type:
Promise
  • the http request promise

getSavingsGoal(accessToken, savingsGoalId) → {Promise}

Gets a specific savings goal

Source:
Parameters:
Name Type Description
accessToken string

the oauth bearer token.

savingsGoalId string

the savings goal's ID.

Returns:
Type:
Promise
  • the http request promise

listSavingsGoals(accessToken) → {Promise}

Gets a list of the customer's savings goals

Source:
Parameters:
Name Type Description
accessToken string

the oauth bearer token.

Returns:
Type:
Promise
  • the http request promise