Transactions

Updates a transaction.

patch/transactions/{transaction_ref}

Path parameters

transaction_refstring required

Transaction id or external_id.

Example:txn_abc123

Request body

current_transaction_versioninteger required

Current version of the transaction. Must match the stored version.

Example request

{
  "tags": {
    "set": [
      {
        "key": "department",
        "value": "engineering"
      }
    ]
  },
  "allocations": {
    "create": [
      {
        "invoice_id": "inv_abc123",
        "amount": "1000",
        "type": "invoice_payin",
        "user": {
          "id": "user_abc123"
        }
      }
    ],
    "update": [
      {
        "id": "alloc_abc123",
        "amount": "2000"
      }
    ]
  }
}

Response

Success

Example response

{
  "data": {
    "id": "txn_dHhuX2ZyYWdfMDAx",
    "external_id": "bank_txn_123",
    "account": {
      "id": "ext_account_YWJjMTIz",
      "external_id": "acct_external_123"
    },
    "posted": "2024-01-13T00:00:00Z",
    "currency": "USD",
    "amount": "-1000",
    "allocations": [
      {
        "invoice_id": "inv_abc123",
        "amount": "1000",
        "type": "invoice_payin",
        "user": {
          "id": "user_abc123",
          "external_id": "user_ext_001"
        }
      }
    ],
    "tags": [
      {
        "key": "department",
        "value": "engineering"
      }
    ],
    "unallocated_amount": "-1000",
    "created": "2024-01-13T00:00:00Z",
    "modified": "2024-01-13T00:00:00Z",
    "version": 1
  }
}

Changes

Changed in 2 of the 38 revisions of this API.14

  • 8472a9bd15ea13See the full diff
    • removed subschema #1 subschema #2 from the allocations/create/items/user request property anyOf list

      request-property-any-of-removed

    • added the new optional request property tags/set

      new-optional-request-property

    • added subschema #1 subschema #2 to the allocations/create/items/user request property anyOf list

      request-property-any-of-added

    • the response property data/allocations/items/user/external_id became required for the status 200

      response-property-became-required

    This revision also has 18 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • endpoint added

      endpoint-added