Skip to main content
POST
Configure a provider's ledger counterparty

Authorizations

Authorization
string
header
required

JWT bearer token issued by the identity provider.

Headers

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
required

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.

Path Parameters

ledger_id
string
required

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

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

provider_type
string
required

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

"LERIAN"

Body

application/json

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

accountAlias
string
required

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

"@siloc-a-liquidar"

assetCode
string
required

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

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

"BRL"

reason
string
required

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

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

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

version
integer<int64>
required

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

Required range: x >= 0
Example:

0

Response

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

changeId
string<uuid>
required

Identifier of the history line this write recorded.

Example:

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

counterparty
object
required

The counterparty as written, with its new version.