Skip to content

Latest commit

 

History

History
258 lines (241 loc) · 8.92 KB

File metadata and controls

258 lines (241 loc) · 8.92 KB
description Use this endpoint to update a single transaction. You may also use this to split an existing transaction.

Update transaction

{% api-method method="put" host="https://dev.lunchmoney.app" path="/v1/transactions/:transaction_id" %} {% api-method-summary %} Update transaction {% endapi-method-summary %}

{% api-method-description %}

{% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="split" type="object" required=false %} Defines the split of a transaction. You may not split an already-split transaction, recurring transaction, or group transaction.
See Split object for supported properties. {% endapi-method-parameter %}

{% api-method-parameter name="transaction" type="object" required=true %} Updates to transaction matching ID (see Update Transaction object below) {% endapi-method-parameter %}

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

{% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} If a split was part of the request, an array of newly-created split transactions will be returned. {% endapi-method-response-example-description %}

{
    updated: true,
    split: [58, 59]
}

{% endapi-method-response-example %}

{% api-method-response-example httpCode=404 %} {% api-method-response-example-description %} Array of errors will be returned if field(s) are invalid. {% endapi-method-response-example-description %}

{ error:
   [ 'This transaction doesn't exist or you don't have access to it.' ] }

{ error:
   [ 'You cannot change the amount for this transaction because it was automatically imported.',
     'You cannot assign an asset_id for this transaction because it was automatically imported.' ] }

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

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

Update Transaction object

Key Type Description
date string Must be in ISO 8601 format (YYYY-MM-DD).
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
amount number | string You may only update this if this transaction was not created from an automatic import, i.e. if this transaction is not associated with a plaid_account_id
currency string You may only update this if this transaction was not created from an automatic import, i.e. if this transaction is not associated with a plaid_account_id. 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. You may only update this if this transaction was not created from an automatic import, i.e. if this transaction is not associated with a plaid_account_id
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. Defaults to 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. You may only update this if this transaction was not created from an automatic import, i.e. if this transaction is not associated with a plaid_account_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 %}

{% tab title="Split object" %}

Split object

Key Type Description
date string

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

Required.

category_id number

Unique identifier for associated category_id. Category must be associated with the same account.

Required.

notes string
amount number | string

Individual amount of split. Currency will inherit from parent transaction. All amounts must sum up to parent transaction amount.

Required.

{% endtab %} {% endtabs %}