Documentation
Spending

Spending

Spending objects are used to represent how the user wants to spend their money and how frequently they want to or need to spend it. Spending objects create an "earmark" (opens in a new tab) against the available balance of the bank account they are associated with. This is then used to allow monetr to calculate an amount that is safe for the user to spend at any given time; while making sure they still have funds for their defined financial obligations.

List Spending

This endpoint does not support any pagination, it simply returns all of the spending objects for the provided bank account ID.

HTTP
GET /api/bank_accounts/{bankAccountId}/spending

Request Path

AttributeTypeRequiredDescription
bankAccountIdnumberyesThe ID of the bank account the spending objects belong to.

Response Body

AttributeTypeRequiredDescription
spendingIdnumberyesThe unique identifier for a spending object within monetr.
bankAccountIdnumberyesThe bank account that the spending object belongs to. This will match the path parameter for this API endpoint.
fundingScheduleIdnumberyesThe ID of the funding schedule that is used to calculate contributions to the spending object.
namestringyesThe name or title of the spending object, this must be unique within a bank account and spendingType.
descriptionstringnoThe description for the spending object.
spendingTypeenumyesThe type of spending object this is.
- 0 Expense
- 1 Goal
targetAmountnumberyesThe amount of money (in cents) that this spending object needs at or before it's nextRecurrence date.
currentAmountnumberyesThe amount of money (in cents) that is allocated to this spending object.
usedAmountnumbernoThis field is only used for Goals, it is used to keep track of how much has been spent from the goal. When a transaction is spent from a Goal it increments the usedAmount equal the the amount of the transaction or the currentAmount of the spending object, whichever is lesser.
recurrenceRulestringnoThe RRule used to calculate the due dates for a spending object, this is only present for Expenses.
lastRecurrencedatetimenoThe timestamp of the last time this spending object was due. This is not a reflection of the last time the spending object was used.
nextRecurrencedatetimeyesThe timestamp of the next time this spending object is due, for a Goal this is just the day you want to complete the Goal. For an expense this is the next time it will recur before it is recalculated.
nextContributionAmountnumberyesThe amount of money (in cents) that will be allocated to the currentAmount the next time the funding schedule is processed.
isBehindbooleanyesSpending objects can fall behind if there will not be a funding event before the nextRecurrence and the currentAmount is less than the targetAmount.
isPausedbooleannoSpending objects can be paused, when they are paused they will not be funded or updated automatically.
dateCreateddatetimeyesThe timestamp of when this spending object was created.
dateStarteddatetimeyesThe timestamp of the first instance of the recurrence or the goal date. This is used to recalculate subsequent recurrences of an expense accurately.

Create Spending

To create a spending object (a goal or an expense at the moment) you can perform a POST request to the following endpoint.

HTTP
POST /api/bank_accounts/{bankAccountId}/spending

Request Path

AttributeTypeRequiredDescription
bankAccountIdnumberyesThe ID of the bank account the spending object should belong to once it is created.

Request Body

AttributeTypeRequiredDescription
fundingScheduleIdnumberyesThe ID of the funding schedule that is used to calculate contributions to the spending object.
namestringyesThe name or title of the spending object, this must be unique within a bank account and spendingType.
descriptionstringnoThe description for the spending object.
spendingTypeenumyesThe type of spending object this is.
- 0 Expense
- 1 Goal
targetAmountnumberyesThe amount of money (in cents) that this spending object needs at or before it's nextRecurrence date.
recurrenceRulestringnoThe RRule used to calculate the due dates for a spending object, this is only present for Expenses.
nextRecurrencedatetimeyesThe timestamp of the next time this spending object is due, for a Goal this is just the day you want to complete the Goal. For an expense this is the next time it will recur before it is recalculated.

Response Body

AttributeTypeRequiredDescription
spendingIdnumberyesThe unique identifier for a spending object within monetr.
bankAccountIdnumberyesThe bank account that the spending object belongs to. This will match the path parameter for this API endpoint.
fundingScheduleIdnumberyesThe ID of the funding schedule that is used to calculate contributions to the spending object.
namestringyesThe name or title of the spending object, this must be unique within a bank account and spendingType.
descriptionstringnoThe description for the spending object.
spendingTypeenumyesThe type of spending object this is.
- 0 Expense
- 1 Goal
targetAmountnumberyesThe amount of money (in cents) that this spending object needs at or before it's nextRecurrence date.
currentAmountnumberyesThe amount of money (in cents) that is allocated to this spending object.
usedAmountnumbernoThis field is only used for Goals, it is used to keep track of how much has been spent from the goal. When a transaction is spent from a Goal it increments the usedAmount equal the the amount of the transaction or the currentAmount of the spending object, whichever is lesser.
recurrenceRulestringnoThe RRule used to calculate the due dates for a spending object, this is only present for Expenses.
lastRecurrencedatetimenoThe timestamp of the last time this spending object was due. This is not a reflection of the last time the spending object was used.
nextRecurrencedatetimeyesThe timestamp of the next time this spending object is due, for a Goal this is just the day you want to complete the Goal. For an expense this is the next time it will recur before it is recalculated.
nextContributionAmountnumberyesThe amount of money (in cents) that will be allocated to the currentAmount the next time the funding schedule is processed.
isBehindbooleanyesSpending objects can fall behind if there will not be a funding event before the nextRecurrence and the currentAmount is less than the targetAmount.
isPausedbooleannoSpending objects can be paused, when they are paused they will not be funded or updated automatically.
dateCreateddatetimeyesThe timestamp of when this spending object was created.
dateStarteddatetimeyesThe timestamp of the first instance of the recurrence or the goal date. This is used to recalculate subsequent recurrences of an expense accurately.