PATCH
/
v1
/
packages
/
{id}
Update a Package
curl --request PATCH \
  --url http://127.0.0.1:4002/v1/packages/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --header 'X-Organization-Id: <x-organization-id>' \
  --data '{
  "feeGroupLabel": "Updated Package",
  "description": "Updated set of adminitrative charges",
  "minimumAmount": 200000,
  "minimumAmountScale": 4,
  "maximumAmount": 150000,
  "maximumAmountScale": 5,
  "waivedAccounts": [
    "acc003",
    "acc004"
  ],
  "fees": {
    "admFee": {
      "feeLabel": "Administrative fee",
      "calculationModel": {
        "applicationRule": "flatValue",
        "calculations": [
          {
            "type": "flat",
            "value": 15000,
            "valueScale": 3
          }
        ]
      },
      "referenceAmount": "afterFeesAmount",
      "priority": 2,
      "isDeductibleFrom": false,
      "creditAccount": "0194fb45-ec77-793d-aeb2-8f86c5467869"
    }
  },
  "enable": false
}'
{
  "id": "0194dc48-b6ab-728d-9b02-56bff488489a",
  "feeGroupLabel": "Updated Package",
  "description": "Updated set of administrative charges.",
  "chartOfAccounts": "PIX-DEBIT",
  "segmentId": "ecd2ac18-920e-4438-9f84-208eac050c8a",
  "ledgerId": "b4de02fe-275d-48f9-8288-862cde0d6474",
  "minimumAmount": 200000,
  "maximumAmount": 150000,
  "minimumAmountScale": 4,
  "maximumAmountScale": 4,
  "waivedAccounts": [
    "@acc001",
    "@acc002",
    "@acc003",
    "@acc004"
  ],
  "fees": {
    "admFee": {
      "feeLabel": "Administrative Fee",
      "calculationModel": {
        "applicationRule": "flatFee",
        "calculations": [
          {
            "type": "flat",
            "value": 1500,
            "valueScale": 2
          }
        ]
      },
      "referenceAmount": "afterFeesAmount",
      "priority": 2,
      "isDeductibleFrom": false,
      "creditAccount": "0194fb45-ec77-793d-aeb2-8f86c5467869"
    }
  },
  "enable": false,
  "createdAt": "2025-04-10T03:21:06.782Z",
  "updatedAt": "2025-04-09T18:45:17.976Z",
  "deletedAt": null
}

Partial update

You can send only the fields you want to update. All other values will remain unchanged. For example, to partially update fees:
  • To add a new fee, just include it in the payload.
  • To update an existing fee, send the new value.
  • To remove a specific value, set it to null.
  • To remove an entire fee object, use an empty array — e.g., "taxaAdm": [].
ImportantThe ledgerId, segmentId, and chartOfAccount fields can’t be updated.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

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.

Path Parameters

id
string
required

Unique identifier of the package that you want to update.

Body

application/json
feeGroupLabel
string
required

Name used to identify the configured Fee Package.

minimumAmount
integer
required

Minimum transaction amount below which the fees in the package don't apply.

minimumAmountScale
integer
required

Scale for the <code>minimumAmount</code> field.

maximumAmount
integer
required

Maximum transaction amount above which the fees in the package don't apply.

maximumAmountScale
integer
required

Scale for the <code>maximumAmount</code> field.

fees
object
required

List containing the definition of each individual tax in the package.

enable
boolean
required

If <code>true</code> it indicates that the package is active.

description
string

Short summary of what this Fee Package is designed to handle

waivedAccounts
string[]

List of accounts hat won't be charged the taxes in this package.

Response

201 - application/json
id
string

Unique identifier of the package, in UUIDv7 format.

feeGroupLabel
string

Name used to identify the configured Fee Package.

description
string

Short summary of what this Fee Package is designed to handle.

chartOfAccounts
string

An identifier that maps to an accounting rule—like debit-type-transaction or credit-type-transaction.

segmentId
string

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

ledgerId
string

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

minimumAmount
integer

Minimum transaction amount below which the fees in the package don't apply.

maximumAmount
integer

Maximum transaction amount above which the fees in the package don't apply.

minimumAmountScale
integer

Scale for the minimumAmount field.

maximumAmountScale
integer

Scale for the maximumAmount field.

waivedAccounts
string[]

List of accounts hat won't be charged the taxes in this package.

fees
object

List containing the definition of each individual tax in the package.

enable
boolean

If <code>true</code> it indicates that the package is active.

createdAt
string<date-time>

Date when the package was created.

updatedAt
string<date-time>

Date when the package was last updated.

deletedAt
string<date-time>

Date when the package was deleted.