Saltar al contenido principal
POST
/
v1
/
organizations
/
{organization_id}
/
ledgers
/
{ledger_id}
/
operation-routes
Crear una Ruta de Operación
curl --request POST \
  --url https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/operation-routes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "account": {
    "ruleType": "alias",
    "validIf": "@external/BRL"
  },
  "code": "PIX-DEBIT",
  "title": "PIX External Account Debit",
  "description": "PIX External Account Debit",
  "metadata": {
    "customField1": "value1",
    "customField2": 123
  },
  "operationType": "source",
  "accountingEntries": {
    "direct": {
      "debit": {
        "code": "1.1.001",
        "description": "Cash - Available funds"
      },
      "credit": {
        "code": "3.1.001",
        "description": "Service Revenue"
      }
    }
  }
}
'
{
  "id": "019c96a0-1071-7a0d-9916-a831221de252",
  "organizationId": "019c96a0-0a98-7287-9a31-786e0809c769",
  "ledgerId": "019c96a0-0ac0-7de9-9f53-9cf842a2ee5a",
  "account": {
    "ruleType": "alias",
    "validIf": [
      "@external/BRL"
    ]
  },
  "code": "PIX-DEBIT",
  "description": "PIX External Account Debit",
  "operationType": "source",
  "action": "direct",
  "title": "PIX External Account Debit",
  "metadata": {
    "customField1": "value1",
    "customField2": 123
  },
  "accountingEntries": {
    "direct": {
      "debit": {
        "code": "1.1.001",
        "description": "Cash - Available funds"
      },
      "credit": {
        "code": "3.1.001",
        "description": "Service Revenue"
      }
    }
  },
  "createdAt": "2026-02-25T21:06:38.321656Z",
  "deletedAt": null,
  "updatedAt": "2026-02-25T21:06:38.321656Z"
}

Autorizaciones

Authorization
string
header
requerido

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

Encabezados

Authorization
string

El token de autorización. Este encabezado es requerido si su entorno tiene Access Manager habilitado.

Content-Type
string

El tipo de medio del recurso. El valor recomendado es application/json.

X-Request-Id
string<uuid>

Un identificador único utilizado para rastrear y seguir cada solicitud.

Parámetros de ruta

organization_id
string
requerido

El identificador único de la Organización asociada al Ledger.

ledger_id
string
requerido

El identificador único del Ledger asociado.

Cuerpo

application/json
title
string
requerido

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

Maximum string length: 50
operationType
enum<string>
requerido

El tipo de la Ruta de Operación. Use bidirectional cuando la ruta puede operar en ambas direcciones.

Opciones disponibles:
source,
destination,
bidirectional
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 string length: 100
description
string

Detailed description of the Operation Route purpose and usage.

Maximum string 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'.

accountingEntries
object

Entradas contables agrupadas por tipo de acción de transacción. Cada acción se mapea a un par de rúbricas de débito y crédito.

Respuesta

Indica que el recurso fue creado exitosamente y la operación se completó como se esperaba.

id
string<uuid>

El identificador único de la Ruta de Operación.

organizationId
string<uuid>

The unique identifier of the Organization.

ledgerId
string<uuid>

El identificador único del 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 string length: 100
description
string

Detailed description of the Operation Route purpose and usage.

operationType
enum<string>

El tipo de la Ruta de Operación. Use bidirectional cuando la ruta puede operar en ambas direcciones.

Opciones disponibles:
source,
destination,
bidirectional
action
enum<string>

La acción de la ruta en el contexto del ciclo de vida de la transacción.

Opciones disponibles:
direct,
hold,
commit,
cancel,
revert
accountingEntries
object

Entradas contables agrupadas por tipo de acción de transacción. Cada acción se mapea a un par de rúbricas de débito y crédito.

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'.