Update a charge line
curl --request PATCH \
--url https://clarus-api.com/api/charge_lines/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "charge_lines",
"attributes": {
"charge_basket_id": 123,
"charge_price_id": 123,
"code": "<string>",
"description": "<string>",
"goods_out_id": 123,
"goods_out_pick_list_id": 123,
"inbound_good_id": 123,
"inbound_item_id": 123,
"name": "<string>",
"price": 1,
"product_id": 123,
"quantity": 1,
"storage_unit_id": 123
}
}
}
'import requests
url = "https://clarus-api.com/api/charge_lines/{id}"
payload = { "data": {
"type": "charge_lines",
"attributes": {
"charge_basket_id": 123,
"charge_price_id": 123,
"code": "<string>",
"description": "<string>",
"goods_out_id": 123,
"goods_out_pick_list_id": 123,
"inbound_good_id": 123,
"inbound_item_id": 123,
"name": "<string>",
"price": 1,
"product_id": 123,
"quantity": 1,
"storage_unit_id": 123
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'charge_lines',
attributes: {
charge_basket_id: 123,
charge_price_id: 123,
code: '<string>',
description: '<string>',
goods_out_id: 123,
goods_out_pick_list_id: 123,
inbound_good_id: 123,
inbound_item_id: 123,
name: '<string>',
price: 1,
product_id: 123,
quantity: 1,
storage_unit_id: 123
}
}
})
};
fetch('https://clarus-api.com/api/charge_lines/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": 123,
"type": "charge_lines",
"attributes": {
"id": 1,
"code": "PICK-001",
"name": "Picking Charge",
"description": null,
"charge_type": "PICK",
"quantity": 10,
"price": 0.5
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Charging: Lines
Update a charge line
Update an existing charge line’s attributes.
PATCH
/
api
/
charge_lines
/
{id}
Update a charge line
curl --request PATCH \
--url https://clarus-api.com/api/charge_lines/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "charge_lines",
"attributes": {
"charge_basket_id": 123,
"charge_price_id": 123,
"code": "<string>",
"description": "<string>",
"goods_out_id": 123,
"goods_out_pick_list_id": 123,
"inbound_good_id": 123,
"inbound_item_id": 123,
"name": "<string>",
"price": 1,
"product_id": 123,
"quantity": 1,
"storage_unit_id": 123
}
}
}
'import requests
url = "https://clarus-api.com/api/charge_lines/{id}"
payload = { "data": {
"type": "charge_lines",
"attributes": {
"charge_basket_id": 123,
"charge_price_id": 123,
"code": "<string>",
"description": "<string>",
"goods_out_id": 123,
"goods_out_pick_list_id": 123,
"inbound_good_id": 123,
"inbound_item_id": 123,
"name": "<string>",
"price": 1,
"product_id": 123,
"quantity": 1,
"storage_unit_id": 123
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'charge_lines',
attributes: {
charge_basket_id: 123,
charge_price_id: 123,
code: '<string>',
description: '<string>',
goods_out_id: 123,
goods_out_pick_list_id: 123,
inbound_good_id: 123,
inbound_item_id: 123,
name: '<string>',
price: 1,
product_id: 123,
quantity: 1,
storage_unit_id: 123
}
}
})
};
fetch('https://clarus-api.com/api/charge_lines/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": 123,
"type": "charge_lines",
"attributes": {
"id": 1,
"code": "PICK-001",
"name": "Picking Charge",
"description": null,
"charge_type": "PICK",
"quantity": 10,
"price": 0.5
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "charge_lines",
"attributes": {
"quantity": 15,
"price": 0.75,
"description": "Updated picking charge"
}
}
}
Key Fields
| Field | Required | Description |
|---|---|---|
quantity | No | Updated quantity |
price | No | Updated price per unit |
description | No | Updated description |
Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Path Parameters
The unique identifier of the charge line to update
Body
application/json
Show child attributes
Show child attributes
Response
Charge line updated successfully
Show child attributes
Show child attributes
⌘I

