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": "0197d237-c31d-74de-ab9a-8f6c4c210b97",
  "ledgerId": "0197d1fb-4687-75b7-9615-a6547695ee6e",
  "transaction": {
    "route": "b2d91a9f-a369-4d8f-9116-660493b528ab",
    "description": "Fee test",
    "pending": false,
    "send": {
      "asset": "BRL",
      "value": "4000.00",
      "source": {
        "from": [
          {
            "accountAlias": "@testfee1",
            "share": {
              "percentage": "15"
            }
          },
          {
            "accountAlias": "@testfee2",
            "share": {
              "percentage": "35"
            }
          },
          {
            "accountAlias": "@testfee3",
            "share": {
              "percentage": "40"
            }
          },
          {
            "accountAlias": "@testfee4",
            "share": {
              "percentage": "10"
            }
          }
        ]
      },
      "distribute": {
        "to": [
          {
            "accountAlias": "@testfee5",
            "share": {
              "percentage": "25"
            }
          },
          {
            "accountAlias": "@testfee6",
            "share": {
              "percentage": "25"
            }
          },
          {
            "accountAlias": "@testfee7",
            "share": {
              "percentage": "25"
            }
          },
          {
            "accountAlias": "@testfee8",
            "share": {
              "percentage": "25"
            }
          }
        ]
      }
    }
  }
}'
{
"id": "c62c6564-17fb-4eb6-b57b-4bc27c42b06b",
"segmentId": "ecd2ac18-920e-4438-9f84-208eac050c8a",
"ledgerId": "ac0cd8b8-55e1-4695-8b50-67868aa5f334",
"transaction": {
"route": "b2d91a9f-a369-4d8f-9116-660493b528ab",
"pending": false,
"description": "Fee Example",
"metadata": {
"packageAppliedID": "01962565-8d57-737b-abfa-84c3a15eeb15"
},
"send": {
"asset": "BRL",
"value": "4175.00",
"source": {
"from": [
{
"accountAlias": "@account1",
"amount": {
"asset": "BRL",
"value": "1000.00"
},
"route": "pixdebit",
"metadata": null
},
{
"accountAlias": "@account2",
"amount": {
"asset": "BRL",
"value": "1000.00"
},
"route": "pixdebit",
"metadata": null
},
{
"accountAlias": "@account3",
"amount": {
"asset": "BRL",
"value": "1000.00"
},
"route": "pixdebit",
"metadata": null
},
{
"accountAlias": "@account4",
"amount": {
"asset": "BRL",
"value": "1175.00"
},
"route": "pixdebit",
"metadata": null
}
]
},
"distribute": {
"to": [
{
"accountAlias": "@account5",
"amount": {
"asset": "BRL",
"value": "4175.00"
},
"route": "pixcredit",
"metadata": null
}
]
}
}
}
}

Headers

Authorization
string

The authorization token in the 'Bearer <token>' 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:

"0195fb87-eeb6-7487-bc58-659255a23ef1"

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.

  • Option 1
  • Option 2
id
string
required

Unique identifier of the calculation, in UUIDv7 format.

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.