---
title: "Store a new piggy bank"
method: POST
path: "/v1/piggy-banks"
tags: ["piggy_banks"]
---

# Store a new piggy bank

`POST /v1/piggy-banks`

Creates a new piggy bank. The data required can be submitted as a JSON body or as a list of parameters.

## Headers

- `X-Trace-Id` string, uuid

## Request body

- PiggyBankStore
  - `name` string, string, required
  - `accounts` PiggyBankAccountStore[]
    - `id` string, string, nullable, required — The ID of the account.
    - `name` string, string, nullable — The name of the account.
    - `current_amount` string, amount — The amount saved currently.
  - `target_amount` string, amount, nullable, required
  - `current_amount` string, amount
  - `start_date` string, date, required — The date you started with this piggy bank.
  - `target_date` string, date, nullable — The date you intend to finish saving money.
  - `order` integer
  - `active` boolean
  - `notes` string, string, nullable
  - `object_group_id` string, string, nullable — The group ID of the group this object is part of. NULL if no group.
  - `object_group_title` string, string, nullable — The name of the group. NULL if no group.

## Response `200`

New piggy bank stored, result in response.

## Other responses

- `400` — Bad request
- `401` — Unauthenticated
- `404` — Page not found
- `422` — Validation error. The body will have the exact details.
- `500` — Internal exception

---

[API](https://skmtc.dev/firefly-iii/apis/firefly-iii-api-develop.md) · [All operations](https://skmtc.dev/firefly-iii/apis/firefly-iii-api-develop/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/firefly-iii/firefly-iii-api-develop/revisions/8a1f6472e04b/schema)
