Skip to main content
POST
/
v1
/
fees
Calculate Fees for a Package
curl --request POST \
  --url https://fees.sandbox.lerian.net/v1/fees \
  --header 'Content-Type: <content-type>' \
  --header 'X-Organization-Id: <x-organization-id>' \
  --data '
{
  "segmentId": "019c96a0-0b4e-7079-8be0-ab6bdccf975f",
  "ledgerId": "019c96a0-0ac0-7de9-9f53-9cf842a2ee5a",
  "transaction": {
    "route": "019c96a0-10a0-72d2-9fb0-2b7de8093182",
    "description": "Fee test",
    "pending": false,
    "send": {
      "asset": "BRL",
      "value": "4000.00",
      "source": {
        "from": [
          {
            "accountAlias": "customer-brl-1",
            "share": {
              "percentage": "15"
            }
          },
          {
            "accountAlias": "customer-brl-2",
            "share": {
              "percentage": "35"
            }
          },
          {
            "accountAlias": "customer-brl-3",
            "share": {
              "percentage": "40"
            }
          },
          {
            "accountAlias": "customer-brl-4",
            "share": {
              "percentage": "10"
            }
          }
        ]
      },
      "distribute": {
        "to": [
          {
            "accountAlias": "business-brl-1",
            "share": {
              "percentage": "25"
            }
          },
          {
            "accountAlias": "business-brl-2",
            "share": {
              "percentage": "25"
            }
          },
          {
            "accountAlias": "business-brl-3",
            "share": {
              "percentage": "25"
            }
          },
          {
            "accountAlias": "business-brl-4",
            "share": {
              "percentage": "25"
            }
          }
        ]
      }
    }
  }
}
'
{ "segmentId": "019c96a0-0b4e-7079-8be0-ab6bdccf975f", "ledgerId": "019c96a0-0ac0-7de9-9f53-9cf842a2ee5a", "transaction": { "route": "019c96a0-10a0-72d2-9fb0-2b7de8093182", "pending": false, "description": "Fee Example", "metadata": { "packageAppliedID": "01962565-8d57-737b-abfa-84c3a15eeb15" }, "send": { "asset": "BRL", "value": "4175.00", "source": { "from": [ { "accountAlias": "customer-brl-1", "amount": { "asset": "BRL", "value": "1000.00" }, "route": "pixdebit", "metadata": null }, { "accountAlias": "customer-brl-2", "amount": { "asset": "BRL", "value": "1000.00" }, "route": "pixdebit", "metadata": null }, { "accountAlias": "customer-brl-3", "amount": { "asset": "BRL", "value": "1000.00" }, "route": "pixdebit", "metadata": null }, { "accountAlias": "customer-brl-4", "amount": { "asset": "BRL", "value": "1175.00" }, "route": "pixdebit", "metadata": null } ] }, "distribute": { "to": [ { "accountAlias": "business-brl-1", "amount": { "asset": "BRL", "value": "4175.00" }, "route": "pixcredit", "metadata": null } ] } } } }

Documentation Index

Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt

Use this file to discover all available pages before exploring further.

Headers

Authorization
string

The authorization token in the 'Bearer ' format.

Important: This header is required if your environment has Access Manager enabled. For more information, refer to the Access Manager documentation.

Content-Type
string
required

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

Example:

"application/json"

X-Organization-Id
string
required

The unique identifier of the Organization associated with the request.

Example:

"019c96a0-0a98-7287-9a31-786e0809c769"

Body

application/json
ledgerId
string
required

Unique identifier of the Ledger this Fee Package is linked to in the Midaz Ledger.

transaction
object
required

Information about the transaction to which the fee applies.

segmentId
string

Unique identifier of the Segment this Fee Package is linked to in the Midaz Ledger.

Response

Indicates that the resource was successfully created and the operation was completed as expected.

Result of the fee calculation. Contains the Ledger and Segment identifiers together with the transaction payload enriched with the calculated fees.

ledgerId
string
required

Unique identifier of the Ledger this Fee Package is linked to in the Midaz Ledger.

transaction
object
required

Information about the transaction to which the fee applies.

segmentId
string

Unique identifier of the Segment this Fee Package is linked to in the Midaz Ledger.