POST
/
v1
/
fees
Calculate Fees for a Package
curl --request POST \
  --url http://127.0.0.1:4002/v1/fees \
  --header 'Content-Type: <content-type>' \
  --header 'X-Organization-Id: <x-organization-id>' \
  --data '{
  "segmentId": "ecd2ac18-920e-4438-9f84-208eac050c8a",
  "ledgerId": "ac0cd8b8-55e1-4695-8b50-67868aa5f334",
  "transaction": {
    "chartOfAccountsGroupName": "FEES",
    "description": "Fee Example",
    "send": {
      "asset": "BRL",
      "value": 400000,
      "scale": 2,
      "source": {
        "from": [
          {
            "account": "@account1",
            "amount": {
              "scale": 2,
              "asset": "BRL",
              "value": 100000
            },
            "description": "New Transaction",
            "chartOfAccounts": "PIX-DEBIT"
          },
          {
            "account": "@account2",
            "amount": {
              "scale": 2,
              "asset": "BRL",
              "value": 100000
            },
            "description": "New Transaction",
            "chartOfAccounts": "PIX-DEBIT"
          },
          {
            "account": "@account3",
            "amount": {
              "scale": 2,
              "asset": "BRL",
              "value": 160000
            },
            "description": "New Transaction",
            "chartOfAccounts": "PIX-DEBIT"
          },
          {
            "account": "@account4",
            "amount": {
              "scale": 2,
              "asset": "BRL",
              "value": 40000
            },
            "description": "New Transaction",
            "chartOfAccounts": "PIX-DEBIT"
          }
        ]
      },
      "distribute": {
        "to": [
          {
            "account": "@account5",
            "amount": {
              "scale": 2,
              "asset": "BRL",
              "value": 400000
            },
            "description": "New Trasnaction",
            "chartOfAccounts": "PIX-DEBIT"
          }
        ]
      }
    },
    "metadata": {
      "message": "payment",
      "value": 400000
    }
  }
}'
{
"id": "c62c6564-17fb-4eb6-b57b-4bc27c42b06b",
"segmentId": "ecd2ac18-920e-4438-9f84-208eac050c8a",
"ledgerId": "ac0cd8b8-55e1-4695-8b50-67868aa5f334",
"transaction": {
"chartOfAccountsGroupName": "FEES",
"description": "Fee Example",
"send": {
"asset": "BRL",
"value": 400000,
"scale": 2,
"source": {
"from": [
{
"account": "@account1",
"amount": {
"scale": 2,
"asset": "BRL",
"value": 100000
},
"description": "New Transaction",
"chartOfAccounts": "PIX-DEBIT"
},
{
"account": "@account2",
"amount": {
"scale": 2,
"asset": "BRL",
"value": 100000
},
"description": "New Transaction",
"chartOfAccounts": "PIX-DEBIT"
},
{
"account": "@account3",
"amount": {
"scale": 2,
"asset": "BRL",
"value": 160000
},
"description": "New Transaction",
"chartOfAccounts": "PIX-DEBIT"
},
{
"account": "@account4",
"amount": {
"scale": 2,
"asset": "BRL",
"value": 40000
},
"description": "New Transaction",
"chartOfAccounts": "PIX-DEBIT"
}
]
},
"distribute": {
"to": [
{
"account": "@account5",
"amount": {
"scale": 2,
"asset": "BRL",
"value": 400000
},
"description": "New Trasnaction",
"chartOfAccounts": "PIX-DEBIT"
}
]
}
},
"metadata": {
"message": "payment",
"value": 400000
}
}
}

Headers

Authorization
string

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

Content-Type
string
required

The request content type.

X-Organization-Id
string
required

The unique identifier of the Organization associated with the request.

X-lerian-Id
string

The unique identifier of Lerian's client.

Body

application/json
segmentId
string
required

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

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.

Response

id
string
required

Unique identifier of the calculation, in UUIDv7 format.

segmentId
string
required

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

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.