{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/moneyhub/main/json-schema/moneyhub-savings-goals-schema.json", "title": "SavingsGoals", "x-generated": "2026-10-12", "x-method": "derived", "x-generator": "derive-json-schema.py", "x-source": "openapi/moneyhub-savings-goals-api-openapi.yml#/components/schemas/SavingsGoals", "type": "object", "additionalProperties": false, "properties": { "id": { "description": "Unique id of the saving goal.", "type": "string" }, "name": { "description": "Name for the savings goal.", "type": "string" }, "amount": { "properties": { "value": { "description": "The target amount in minor unit in minor units of the currency, eg. pennies for GBP.", "type": "integer", "exclusiveMinimum": 0 }, "majorUnits": { "description": "The major units of the value, based on the values currency, eg. pounds for GBP.", "type": "integer" }, "minorUnits": { "description": "The minor units of the value, based on the values currency, eg. pennies for GBP.", "type": "integer" }, "currency": { "description": "The currency of the amount", "type": "string" } }, "required": [ "value", "currency" ], "additionalProperties": false, "type": "object" }, "targetDate": { "description": "The target date for the savings goal. Format YYYY-MM-DD", "type": "string", "format": "date" }, "dateCreated": { "description": "The date at which the savings goal was added.", "type": "string", "format": "date-time" }, "imageUrl": { "type": "string" }, "notes": { "description": "Arbitrary text that a user can add about a savings goal.", "type": "string" }, "progressPercentage": { "description": "Progress achieved towards the target amount represented in percentage.", "type": "number" }, "progressAmount": { "description": "Progress achieved towards the target amount by adding up the balances of the selected accounts.", "properties": { "value": { "description": "The amount of the transaction in minor units of the currency, eg. pennies for GBP, negative means money going out of an account, positive means money coming into an account.", "type": "integer" }, "majorUnits": { "description": "The major units of the value, based on the values currency, eg. pounds for GBP.", "type": "integer" }, "minorUnits": { "description": "The minor units of the value, based on the values currency, eg. pennies for GBP.", "type": "integer" }, "currency": { "description": "The currency of the amount", "type": "string" } } }, "accounts": { "type": "array", "description": "Accounts that will be taken into account towards the target amount.", "items": { "type": "object", "additionalProperties": false, "properties": { "id": { "description": "Id of the account", "type": "string" } }, "required": [ "id" ] }, "minItems": 1 } }, "required": [ "id", "name", "amount", "dateCreated", "accounts" ] }