Skip to main content
PATCH
/
v1
/
billing-packages
/
{id}
Update a Billing Package
curl --request PATCH \
  --url https://fees.sandbox.lerian.net/v1/billing-packages/{id} \
  --header 'Content-Type: <content-type>' \
  --header 'X-Organization-Id: <x-organization-id>' \
  --data '
{
  "label": "Updated Pix Billing",
  "description": "Updated description for Pix billing",
  "enable": false
}
'
import requests

url = "https://fees.sandbox.lerian.net/v1/billing-packages/{id}"

payload = {
"label": "Updated Pix Billing",
"description": "Updated description for Pix billing",
"enable": False
}
headers = {
"X-Organization-Id": "<x-organization-id>",
"Content-Type": "<content-type>"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {'X-Organization-Id': '<x-organization-id>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
label: 'Updated Pix Billing',
description: 'Updated description for Pix billing',
enable: false
})
};

fetch('https://fees.sandbox.lerian.net/v1/billing-packages/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://fees.sandbox.lerian.net/v1/billing-packages/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'label' => 'Updated Pix Billing',
'description' => 'Updated description for Pix billing',
'enable' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"X-Organization-Id: <x-organization-id>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://fees.sandbox.lerian.net/v1/billing-packages/{id}"

payload := strings.NewReader("{\n \"label\": \"Updated Pix Billing\",\n \"description\": \"Updated description for Pix billing\",\n \"enable\": false\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("X-Organization-Id", "<x-organization-id>")
req.Header.Add("Content-Type", "<content-type>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://fees.sandbox.lerian.net/v1/billing-packages/{id}")
.header("X-Organization-Id", "<x-organization-id>")
.header("Content-Type", "<content-type>")
.body("{\n \"label\": \"Updated Pix Billing\",\n \"description\": \"Updated description for Pix billing\",\n \"enable\": false\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://fees.sandbox.lerian.net/v1/billing-packages/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["X-Organization-Id"] = '<x-organization-id>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"label\": \"Updated Pix Billing\",\n \"description\": \"Updated description for Pix billing\",\n \"enable\": false\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "label": "<string>",
  "description": "<string>",
  "enable": true,
  "organizationId": "<string>",
  "ledgerId": "<string>",
  "eventFilter": {
    "transactionRoute": "<string>",
    "status": "<string>"
  },
  "tiers": [
    {
      "minQuantity": 123,
      "maxQuantity": 123,
      "unitPrice": "<string>"
    }
  ],
  "freeQuota": 123,
  "discountTiers": [
    {
      "minQuantity": 123,
      "discountPercentage": "<string>"
    }
  ],
  "assetCode": "<string>",
  "debitAccountAlias": "<string>",
  "creditAccountAlias": "<string>",
  "feeAmount": "<string>",
  "maintenanceCreditAccount": "<string>",
  "accountTarget": {
    "segmentId": "<string>",
    "portfolioId": "<string>",
    "aliases": [
      "<string>"
    ]
  },
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "deletedAt": "2023-11-07T05:31:56Z"
}

Headers

X-Organization-Id
string
required

The unique identifier of the Organization associated with the request.

Example:

"019c96a0-0a98-7287-9a31-786e0809c769"

Authorization
string

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

Path Parameters

id
string
required

Unique identifier of the billing package.

Example:

"bpkg_01HZ..."

Body

application/json

Partial update for a billing package. Only label, description, and enable can be updated. Send only the fields you want to change.

label
string

Updated name for the billing package.

description
string

Updated description.

enable
boolean

Enable or disable the billing package.

Response

Billing package updated successfully.

id
string

Unique identifier of the billing package.

label
string
description
string
type
enum<string>
Available options:
volume,
maintenance
enable
boolean
organizationId
string
ledgerId
string
eventFilter
object
pricingModel
enum<string>
Available options:
tiered,
fixed
tiers
object[]
freeQuota
integer
discountTiers
object[]
countMode
enum<string>
Available options:
perRoute,
perAccount
assetCode
string
debitAccountAlias
string
creditAccountAlias
string
feeAmount
string
maintenanceCreditAccount
string
accountTarget
object
createdAt
string<date-time>
updatedAt
string<date-time>
deletedAt
string<date-time> | null