POST
/
v1
/
fees
Calculate Fees for a Package
curl --request POST \
  --url https://fees.sandbox.midaz.io/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",
    "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": [
{
"accountAlias": "@account1",
"amount": {
"asset": "BRL",
"value": "1000.00"
},
"route": "pixdebit",
"metadata": null
},
{
"accountAlias": "@account2",
"amount": {
"asset": "BRL",
"value": "1000.00"
},
"route": "pixdebit",
"metadata": null
},
{
"account": "@account3",
"amount": {
"asset": "BRL",
"value": "1000.00"
},
"route": "pixdebit",
"metadata": null
},
{
"account": "@account4",
"amount": {
"asset": "BRL",
"value": "1175.00"
},
"route": "pixdebit",
"metadata": null
}
],
"distribute": {
"to": [
{
"account": "@account5",
"amount": {
"asset": "BRL",
"value": "4175.00"
},
"route": "pixcredit",
"metadata": null
}
]
}
}
}
}

Headers

Authorization
string

The authorization token. This header is required if your environment has the Acces Manager plugin enabled.

Content-Type
string
required

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

X-Organization-Id
string
required

The unique identifier of the Organization associated with the request.

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.

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.