Pular para o conteúdo principal
POST
Configure a provider's ledger counterparty

Autorizações

Authorization
string
header
obrigatório

JWT bearer token issued by the identity provider.

Cabeçalhos

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
obrigatório

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 caminho

ledger_id
string
obrigatório

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
Exemplo:

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

provider_type
string
obrigatório

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}$
Exemplo:

"LERIAN"

Corpo

application/json

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

accountAlias
string
obrigatório

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})$
Exemplo:

"@siloc-a-liquidar"

assetCode
string
obrigatório

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

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

"BRL"

reason
string
obrigatório

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

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

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

version
integer<int64>
obrigatório

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

Intervalo obrigatório: x >= 0
Exemplo:

0

Resposta

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

changeId
string<uuid>
obrigatório

Identifier of the history line this write recorded.

Exemplo:

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

counterparty
object
obrigatório

The counterparty as written, with its new version.