PATCH
/
v1
/
organizations
/
{organization_id}
/
ledgers
/
{ledger_id}
/
operation-routes
/
{operation_route_id}
Update an Operation Route
curl --request PATCH \
  --url https://transaction.sandbox.midaz.io/v1/organizations/{organization_id}/ledgers/{ledger_id}/operation-routes/{operation_route_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "title": "Cashout from service charge",
  "code": "EXT-001",
  "description": "This operation route handles cash-out transactions from service charge collections",
  "account": {
    "ruleType": "account_type",
    "validIf": [
      "liability",
      "revenue"
    ],
    "metadata": {
      "customField1": "updatedValue",
      "customField2": 456,
      "newField": "newValue"
    }
  }
}'
{
"organizationId": "01965ed9-7fa4-75b2-8872-fc9e8509ab0a",
"ledgerId": "01965ed9-7fa4-75b2-8872-fc9e8509ab0a",
"account": {
"ruleType": "alias",
"validIf": [
"@account1"
]
},
"code": "EXT-001",
"description": "This operation route handles cash-in transactions from service charge collections",
"operationType": "source",
"title": "Cashin from service charge",
"metadata": {
"property1": "string",
"property2": "string"
},
"createdAt": "2021-01-01T00:00:00Z",
"deletedAt": "2021-01-01T00:00:00Z",
"updatedAt": "2021-01-01T00:00:00Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

organization_id
string
required

The unique identifier of the Organization associated with the Ledger.

ledger_id
string
required

The unique identifier of the associated Ledger.

operation_route_id
string
required

The unique identifier of the Operation Route that you want to retrieve.

Body

application/json
title
string

Short text summarizing the purpose of the operation. Used as an entry note for identification.

Maximum length: 50
description
string

Detailed description of the Operation Route purpose and usage.

Maximum length: 250
code
string

An external reference used to identify the operation route.

Maximum length: 50
account
object

Defines the rule for selecting the account that will participate in the operation (debit or credit).

metadata
object

An object containing key-value pairs to add as metadata, where the field name is the key and the field value is the value. For example, to add a Cost Center, use 'costCenter': 'BR_11101997'.

Response

Indicates that the resource was successfully created and the operation was completed as expected.

id
string<uuid>

The unique identifier of the Operation Route.

organizationId
string<uuid>

The unique identifier of the Organization.

ledgerId
string<uuid>

The unique identifier of the Ledger.

title
string

Short text summarizing the purpose of the operation. Used as an entry note for identification.

code
string

An external reference used to identify the operation route.

Maximum length: 50
description
string

Detailed description of the Operation Route purpose and usage.

operationType
enum<string>

The type of the Operation Route.

Available options:
source,
destination
account
object

Defines the rule for selecting the account that will participate in the operation (debit or credit).

createdAt
string<date-time>

Timestamp of creation (UTC).

updatedAt
string<date-time>

Timestamp of last update (UTC).

deletedAt
string<date-time> | null

Timestamp of soft deletion, if applicable (UTC).

metadata
object

An object containing key-value pairs to add as metadata, where the field name is the key and the field value is the value. For example, to add a Cost Center, use 'costCenter': 'BR_11101997'.