Saltar al contenido principal
POST
/
v1
/
fees
Calcular tarifas para un paquete
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": "Prueba de tarifas",
    "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": "Ejemplo de tarifa",
"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

Tipo de medio del recurso. Debe ser application/json.

Example:

"application/json"

X-Organization-Id
string
required

Identificador único de la organización asociada a la solicitud.

Example:

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

Body

application/json
ledgerId
string
required

Identificador único del Ledger al que está vinculado este paquete de tarifas en el Ledger de Midaz.

transaction
object
required

Información sobre la transacción a la que se aplica la tarifa.

segmentId
string

Identificador único del segmento al que está vinculado este paquete de tarifas en el Ledger de Midaz.

Response

Indica que el recurso se creó correctamente y que la operación se completó según lo esperado.

  • Option 1
  • Option 2
id
string
required

Identificador único del cálculo en formato UUIDv7.

ledgerId
string
required

Identificador único del Ledger al que está vinculado este paquete de tarifas en el Ledger de Midaz.

transaction
object
required

Información sobre la transacción a la que se aplica la tarifa.

segmentId
string

Identificador único del segmento al que está vinculado este paquete de tarifas en el Ledger de Midaz.