Saltar al contenido principal
POST
Configure a provider's ledger counterparty

Autorizaciones

Authorization
string
header
requerido

JWT bearer token issued by the identity provider.

Encabezados

X-Organization-Id
string

Midaz organization that owns the ledger in the path. Required: a request without it, or with a value that is not a canonical UUID, is refused with 400 PBP-0025. Used only to look the account of accountAlias up in that ledger; it does not select the tenant, which comes from the validated identity.

Idempotency-Key
string
requerido

Client-supplied idempotency key, a UUID. Required: a request without it, with a value that is not a UUID, or with the nil UUID (00000000-0000-0000-0000-000000000000) is refused with 400 PBP-0012. A retry with the same key replays the stored 2xx answer.

Parámetros de ruta

ledger_id
string
requerido

Midaz ledger whose counterparty is read or written, the same identifier the boleto and the payment record as their ledger. Each ledger has its own counterparty per provider and asset. Must be a canonical UUID (any case); otherwise 400 PBP-0026.

Required string length: 1 - 100
Ejemplo:

"0199a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a6c"

provider_type
string
requerido

Provider whose ledger counterparty is read or written, as the capabilities read names it. Matched case-insensitively.

Required string length: 1 - 20
Pattern: ^[A-Za-z][A-Za-z0-9_]{0,19}$
Ejemplo:

"LERIAN"

Cuerpo

application/json

The asset, the account, the reason and the version read.

accountAlias
string
requerido

Alias of the ledger account, with the leading @. @external/ returns to the default and must name the assetCode of the request; any other value is the alias of an account created through the Midaz API, of a-zA-Z0-9@:_- only. Otherwise 400 PBP-0001.

Required string length: 2 - 100
Pattern: ^(@external/[A-Z]{3,10}|@[A-Za-z0-9@:_-]{1,99})$
Ejemplo:

"@siloc-a-liquidar"

assetCode
string
requerido

Asset code in the ledger. The postings of the Payments use BRL today.

Required string length: 3 - 10
Pattern: ^[A-Z]{3,10}$
Ejemplo:

"BRL"

reason
string
requerido

Why the counterparty is changed. Recorded in the history. Blank is refused with 400 PBP-0001.

Required string length: 1 - 500
Pattern: \S
Ejemplo:

"Contrapartida do provider Lerian passa para a conta transitória do SILOC."

version
integer<int64>
requerido

The counterparty's current version, as read; 0 when never configured.

Rango requerido: x >= 0
Ejemplo:

0

Respuesta

OK. The counterparty was written. A retry under the same Idempotency-Key returns this same answer.

changeId
string<uuid>
requerido

Identifier of the history line this write recorded.

Ejemplo:

"019a5c1e-2b3d-7f4a-8c5d-6e7f8a9b0c1d"

counterparty
object
requerido

The counterparty as written, with its new version.