Skip to content

Latest commit

 

History

History
200 lines (183 loc) · 6.59 KB

File metadata and controls

200 lines (183 loc) · 6.59 KB
description Use this endpoint to insert many transactions at once.

Insert transactions

{% api-method method="post" host="https://dev.lunchmoney.app" path="/v1/transactions" %} {% api-method-summary %} Insert transactions {% endapi-method-summary %}

{% api-method-description %} Bulk-insert transactions {% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-query-parameters %} {% api-method-parameter name="transactions" type="array" required=true %} List of transactions to insert (see below) {% endapi-method-parameter %}

{% api-method-parameter name="apply_rules" type="boolean" %} If true, will apply account’s existing rules to the inserted transactions. Defaults to false. {% endapi-method-parameter %}

{% api-method-parameter name="check_for_recurring" type="boolean" %} If true, will check new transactions for occurrences of new monthly expenses. Defaults to false. {% endapi-method-parameter %}

{% api-method-parameter name="debit_as_negative" type="boolean" %} If true, will assume negative amount values denote expenses and positive amount values denote credits. Defaults to false.

{% endapi-method-parameter %} {% endapi-method-query-parameters %} {% endapi-method-request %}

{% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Upon success, IDs of inserted transactions will be returned in an array. {% endapi-method-response-example-description %}

{
    ids: [54, 55, 56, 57]
}

{% endapi-method-response-example %}

{% api-method-response-example httpCode=404 %} {% api-method-response-example-description %} An array of errors will be returned denoting reason why parameters were deemed invalid. {% endapi-method-response-example-description %}

{ error:
   [ 'Transaction 0 is missing date.',
     'Transaction 0 is missing amount.',
     'Transaction 1 status must be either cleared or uncleared: null' ] }

{% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %}

{% tabs %} {% tab title="Insert Transaction object" %}

Insert Transaction object

Key Type Description
date string

Must be in ISO 8601 format (YYYY-MM-DD).

Required.

amount number | string

Numeric value of amount. i.e. $4.25 should be denoted as 4.25.

Required.

category_id number Unique identifier for associated category_id. Category must be associated with the same account and must not be a category group.
payee string Max 140 characters
currency string Three-letter lowercase currency code must exist in our database. Defaults to user account's primary currency.
asset_id number Unique identifier for associated asset (manually-managed account). Asset must be associated with the same account.
recurring_id number Unique identifier for associated recurring expense. Recurring expense must be associated with the same account.
notes string Max 350 characters
status string

Must be either cleared or uncleared. If recurring_id is provided, the status will automatically be set to recurring or recurring_suggested depending on the type of recurring_id.

Defaults to uncleared.

external_id string User-defined external ID for transaction. Max 75 characters. External IDs must be unique within the same asset_id.
tags Array of numbers and/or strings

Passing in a number will attempt to match by ID. If no matching tag ID is found, an error will be thrown.

Passing in a string will attempt to match by string. If no matching tag name is found, a new tag will be created.

{% endtab %} {% endtabs %}