---
updatedAt: 2025-05-19T20:30:31.000Z
agentTools:
  projectIndex: https://developers.pocketsmith.com/llms.txt
---

# Update a transaction

Updates a transaction by its ID.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "PocketSmith",
    "description": "The PocketSmith API",
    "contact": {
      "name": "API Support",
      "email": "api@pocketsmith.com"
    },
    "version": "2.0"
  },
  "x-samples-languages": [
    "curl",
    "node",
    "javascript",
    "php",
    "python"
  ],
  "servers": [
    {
      "url": "https://api.pocketsmith.com/v2",
      "description": "Production"
    }
  ],
  "components": {
    "securitySchemes": {
      "developerKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Developer-Key",
        "description": "If you want to build a tool just for yourself, be it a desktop widget to display your balances or a tool to import transactions from a bank without a bank feed, you can use our developer keys feature. You can issue yourself a key which will give you persistent API access to just your account. You should rotate your keys regularly."
      }
    },
    "responses": {
      "403": {
        "description": "Not Allowed",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "404": {
        "description": "Not Found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "422": {
        "description": "Validation Error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Institution": {
        "type": "object",
        "properties": {
          "currency_code": {
            "type": "string",
            "description": "The currency code of the institution.",
            "example": "NZD"
          },
          "title": {
            "type": "string",
            "description": "The title of the institution.",
            "example": "Bank of Foo"
          },
          "updated_at": {
            "type": "string",
            "description": "When the institution was last updated.",
            "example": "2015-04-21T22:42:22Z"
          },
          "created_at": {
            "type": "string",
            "description": "When the institution was created.",
            "example": "2015-04-21T22:42:22Z"
          },
          "id": {
            "type": "integer",
            "description": "The unique identifier of the institution.",
            "example": 57
          }
        }
      },
      "TransactionAccount": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "example": 96027
          },
          "name": {
            "type": "string",
            "example": "Sample Credit"
          },
          "number": {
            "type": "string",
            "example": "ASBCRD44554"
          },
          "current_balance": {
            "type": "number",
            "example": 2694.39
          },
          "current_balance_date": {
            "type": "string",
            "example": "2015-07-03"
          },
          "current_balance_in_base_currency": {
            "type": "number",
            "description": "The current balance of the transaction account in the user's base currency.",
            "example": 4041.59
          },
          "current_balance_exchange_rate": {
            "type": "number",
            "description": "The exchange rate between the transaction account's currency and the user's base currency, when different. If the currencies are the same, null is returned.",
            "example": 1.5
          },
          "safe_balance": {
            "type": "number",
            "description": "The current safe balance, if safe balance is activated and available for the transaction account. If safe balance is not available, then null is returned.",
            "example": 2694.39
          },
          "safe_balance_in_base_currency": {
            "type": "number",
            "description": "The current safe balance in the user's base currency, if safe balance is activated and available for the transaction account. If safe balance is not available, then null is returned.",
            "example": 4041.59
          },
          "starting_balance": {
            "type": "number",
            "example": 3547.45
          },
          "starting_balance_date": {
            "type": "string",
            "example": "2015-03-15"
          },
          "created_at": {
            "type": "string",
            "example": "2015-03-17T02:42:10Z"
          },
          "updated_at": {
            "type": "string",
            "example": "2015-07-02T22:14:49Z"
          },
          "institution": {
            "$ref": "#/components/schemas/Institution"
          },
          "currency_code": {
            "type": "string",
            "description": "The currency that the account is in. This is determined by the account that the transaction account belongs to.",
            "example": "NZD"
          },
          "type": {
            "type": "string",
            "description": "The type of the transaction account.",
            "enum": [
              "bank",
              "credits",
              "cash",
              "stocks",
              "mortgage",
              "loans",
              "vehicle",
              "property",
              "insurance",
              "other_asset",
              "other_liability"
            ],
            "example": "bank"
          }
        }
      },
      "Transaction": {
        "type": "object",
        "properties": {
          "cheque_number": {
            "type": "string",
            "example": "503113643691"
          },
          "type": {
            "type": "string",
            "description": "Whether the transaction is a debit or a credit",
            "enum": [
              "debit",
              "credit"
            ],
            "example": "credit"
          },
          "memo": {
            "type": "string",
            "example": "An example memo"
          },
          "payee": {
            "type": "string",
            "description": "The payee/merchant of the transaction.",
            "example": "St Martins New World"
          },
          "amount": {
            "type": "number",
            "example": 34.6
          },
          "amount_in_base_currency": {
            "type": "number",
            "description": "The amount of the transaction in the user's base currency.",
            "example": 51.9
          },
          "date": {
            "type": "string",
            "description": "The date the transaction took place.",
            "example": "2018-02-27"
          },
          "is_transfer": {
            "type": "boolean",
            "description": "Whether the transaction is a transfer.",
            "example": false
          },
          "category": {
            "$ref": "#/components/schemas/Category"
          },
          "note": {
            "type": "string",
            "example": "I spent way too much on cheese here"
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "foo",
              "bar",
              "baz"
            ]
          },
          "id": {
            "type": "integer",
            "description": "The unique identifier of the transaction.",
            "example": 42
          },
          "original_payee": {
            "type": "string",
            "description": "The payee the transaction was created with.",
            "example": "CARD4083ST MARTINS NEW WORLD CHRISTCHURCH"
          },
          "upload_source": {
            "type": "string",
            "description": "Where the transaction came from.",
            "example": "file"
          },
          "closing_balance": {
            "type": "number",
            "description": "The closing balance of the account at the transaction.",
            "example": 4312.32
          },
          "transaction_account": {
            "$ref": "#/components/schemas/TransactionAccount"
          },
          "status": {
            "type": "string",
            "description": "The status of the transaction. Pending transactions are temporary and may be superseded later by their posted counterparts, which are permanent.",
            "enum": [
              "pending",
              "posted"
            ]
          },
          "needs_review": {
            "type": "boolean",
            "description": "Whether the transaction needs to be reviewed.",
            "example": true
          },
          "created_at": {
            "type": "string",
            "description": "When the transaction was created.",
            "example": "2018-02-27T22:42:22Z"
          },
          "updated_at": {
            "type": "string",
            "description": "When the transaction was last updated.",
            "example": "2018-02-27T22:42:22Z"
          }
        }
      },
      "Category": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The unique identifier of the category.",
            "example": 1438154
          },
          "title": {
            "type": "string",
            "description": "The title of the category.",
            "example": "Beer"
          },
          "colour": {
            "type": "string",
            "description": "The colour for the category.",
            "format": "CSS-style hex triplet",
            "example": "#00ff00"
          },
          "children": {
            "type": "array",
            "description": "The category's child categories.",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          },
          "parent_id": {
            "type": "integer",
            "description": "The unique identifier of the parent category of this category, or null if this category has no parent (i.e. is a top-level category)",
            "example": 42
          },
          "is_transfer": {
            "type": "boolean",
            "description": "Whether this category has been marked as a transfer category.",
            "example": false
          },
          "is_bill": {
            "type": "boolean",
            "description": "Whether the category is a bill category. A bill category is when budgeted amounts are normally spent at once, instead of spread across a budgeting period. This category will be included in the bill reminder email when set to true.",
            "example": true
          },
          "roll_up": {
            "type": "boolean",
            "description": "Whether the category's budget is rolled up into its parent category, if a parent category is present.",
            "example": false
          },
          "refund_behaviour": {
            "type": "string",
            "nullable": true,
            "description": "How the category's refunds or deductions should be reported on.",
            "enum": [
              "debits_are_deductions",
              "credits_are_refunds",
              null
            ],
            "example": "credits_are_refunds"
          },
          "created_at": {
            "type": "string",
            "description": "When the category was created.",
            "format": "ISO 8601 timestamp",
            "example": "2015-08-16T02:17:02Z"
          },
          "updated_at": {
            "type": "string",
            "description": "When the category was last updated.",
            "format": "ISO 8601 timestamp",
            "example": "2015-08-16T02:17:02Z"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "A message describing the error that occurred.",
            "example": "A message describing the error that occurred."
          }
        }
      }
    }
  },
  "paths": {
    "/transactions/{id}": {
      "put": {
        "summary": "Update a transaction",
        "description": "Updates a transaction by its ID.",
        "tags": [
          "Transactions"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique identifier of the transaction.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 42
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "memo": {
                    "type": "string",
                    "description": "A new memo for the transaction.",
                    "example": "Rent"
                  },
                  "cheque_number": {
                    "type": "string",
                    "description": "A new cheque number for the transaction.",
                    "example": "503113643691"
                  },
                  "payee": {
                    "type": "string",
                    "description": "A new payee for the transaction.",
                    "example": "Bill"
                  },
                  "amount": {
                    "type": "number",
                    "description": "The amount of the transaction (signed). A positive amount is a credit, and a negative amount is a debit.",
                    "example": -225
                  },
                  "date": {
                    "type": "string",
                    "description": "A new date for the transaction.",
                    "example": "2018-02-27"
                  },
                  "is_transfer": {
                    "type": "boolean",
                    "description": "Whether the transaction is a transfer or not.",
                    "example": false
                  },
                  "category_id": {
                    "type": "integer",
                    "description": "The unique identifier of a new category for the transaction. Sending an empty string will uncategorize the transaction.",
                    "example": 42
                  },
                  "note": {
                    "type": "string",
                    "description": "A new note for the transaction."
                  },
                  "needs_review": {
                    "type": "boolean",
                    "description": "Whether the transaction needs to be reviewed or not.",
                    "example": false
                  },
                  "labels": {
                    "type": "string",
                    "description": "A new comma-separated set of labels for the transaction.",
                    "example": "foo,bar,baz"
                  },
                  "splits": {
                    "type": "array",
                    "description": "Split this transaction into multiple transactions. The correctly calculated remainder amount parameter must be provided, which is equal to the amount - sum(split_amounts). Splitting is atomic: all splits are validated before the original transaction and any splits are saved.",
                    "items": {
                      "type": "object",
                      "required": [
                        "amount"
                      ],
                      "properties": {
                        "amount": {
                          "type": "number",
                          "description": "The amount for this split transaction.",
                          "example": -30
                        },
                        "payee": {
                          "type": "string",
                          "description": "The payee for this split transaction. If not provided, inherits from the parent transaction.",
                          "example": "Restaurant ABC"
                        },
                        "category_id": {
                          "type": "integer",
                          "description": "The category ID for this split transaction. If not provided, inherits from the parent transaction.",
                          "example": 42
                        },
                        "is_transfer": {
                          "type": "boolean",
                          "description": "Whether this split transaction should be indicated as a transfer.",
                          "example": false
                        },
                        "date": {
                          "type": "string",
                          "description": "The date for this split transaction. If not provided, defaults to the parent transaction's date.",
                          "example": "2018-02-27"
                        }
                      }
                    },
                    "example": [
                      {
                        "amount": -30,
                        "category_id": 101,
                        "payee": "Restaurant ABC",
                        "note": "Lunch portion"
                      },
                      {
                        "amount": -19.95,
                        "category_id": 102,
                        "payee": "Transport",
                        "note": "Bus fare"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. When splits are provided, the response includes both the updated transaction and the newly created split transactions.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "description": "Standard response when no splits are provided",
                      "$ref": "#/components/schemas/Transaction"
                    },
                    {
                      "description": "Response when splits are provided",
                      "type": "object",
                      "properties": {
                        "transaction": {
                          "$ref": "#/components/schemas/Transaction"
                        },
                        "split_transactions": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Transaction"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "422": {
            "$ref": "#/components/responses/422"
          }
        }
      }
    }
  },
  "security": [
    {
      "developerKey": []
    }
  ]
}
```