Create a budget or savings goal
POST
/ledgers/{ledgerId}/budgets
const url = 'http://127.0.0.1:47821/api/v1/ledgers/example/budgets';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"budget_scope":"category","category":"example","sub_category":"example","scope_name":"example","target_amount":1,"currency":"example","frequency":"Monthly","start_date":"example","end_date":"example","is_active":true,"is_goal":false,"target_date":"example","monthly_contribution":1,"goal_context":"example","account_scope_values":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://127.0.0.1:47821/api/v1/ledgers/example/budgets \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "budget_scope": "category", "category": "example", "sub_category": "example", "scope_name": "example", "target_amount": 1, "currency": "example", "frequency": "Monthly", "start_date": "example", "end_date": "example", "is_active": true, "is_goal": false, "target_date": "example", "monthly_contribution": 1, "goal_context": "example", "account_scope_values": [ "example" ] }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”ledgerId
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
budget_scope
string
category
string
sub_category
string
scope_name
string
target_amount
required
number
currency
string
frequency
string
start_date
string
end_date
string | null
is_active
boolean
is_goal
boolean
target_date
string | null
monthly_contribution
number | null
goal_context
string | null
account_scope_values
Any of:
Array<string>
null
Responses
Section titled “Responses”Success. JSON, or a file download for export endpoints and ?format=csv.
Validation error
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Example generated
{ "error": { "code": "example", "message": "example", "details": "example" }}Missing or invalid bearer token
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Example generated
{ "error": { "code": "example", "message": "example", "details": "example" }}Not found
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Example generated
{ "error": { "code": "example", "message": "example", "details": "example" }}Conflict
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Example generated
{ "error": { "code": "example", "message": "example", "details": "example" }}