POST
/
v1
/
organizations
/
{organization_id}
/
ledgers
/
{ledger_id}
/
operation-routes
Create an Operation Route
curl --request POST \
  --url https://transaction.sandbox.midaz.io/v1/organizations/{organization_id}/ledgers/{ledger_id}/operation-routes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --data '{
  "account": {
    "ruleType": "alias",
    "validIf": [
      "@account1"
    ]
  },
  "code": "EXT-001",
  "title": "Cashin from service charge",
  "description": "This operation route handles cash-in transactions from service charge collections",
  "metadata": {
    "customField1": "value1",
    "customField2": 123
  },
  "operationType": "source"
}'
{
"id": "01965ed9-7fa4-75b2-8872-fc9e8509ab0a",
"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.

Headers

Content-Type
string
required

The type of media of the resource. Must be application/json.

X-Request-Id
string

A unique identifier used to trace and track each request.

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.

Body

application/json
title
string
required

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

Maximum length: 50
operationType
enum<string>
required

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 (source or destination).

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.

Maximum length: 250
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.

title
string
required

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

Maximum length: 50
operationType
enum<string>
required

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 (source or destination).

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.

Maximum length: 250
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'.