Create a charge line
curl --request POST \
--url https://clarus-api.com/api/charge_lines \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "charge_lines",
"attributes": {
"charge_basket_id": 1,
"code": "PICK-001",
"name": "Picking Charge",
"charge_type": "PICK",
"quantity": 10,
"price": 0.5
}
}
}
'import requests
url = "https://clarus-api.com/api/charge_lines"
payload = { "data": {
"type": "charge_lines",
"attributes": {
"charge_basket_id": 1,
"code": "PICK-001",
"name": "Picking Charge",
"charge_type": "PICK",
"quantity": 10,
"price": 0.5
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'charge_lines',
attributes: {
charge_basket_id: 1,
code: 'PICK-001',
name: 'Picking Charge',
charge_type: 'PICK',
quantity: 10,
price: 0.5
}
}
})
};
fetch('https://clarus-api.com/api/charge_lines', 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": {}
}
]
}Charging: Lines
Create a charge line
Create a new charge line to record a billable item. Charge lines are used for invoicing and billing operations.
POST
/
api
/
charge_lines
Create a charge line
curl --request POST \
--url https://clarus-api.com/api/charge_lines \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "charge_lines",
"attributes": {
"charge_basket_id": 1,
"code": "PICK-001",
"name": "Picking Charge",
"charge_type": "PICK",
"quantity": 10,
"price": 0.5
}
}
}
'import requests
url = "https://clarus-api.com/api/charge_lines"
payload = { "data": {
"type": "charge_lines",
"attributes": {
"charge_basket_id": 1,
"code": "PICK-001",
"name": "Picking Charge",
"charge_type": "PICK",
"quantity": 10,
"price": 0.5
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'charge_lines',
attributes: {
charge_basket_id: 1,
code: 'PICK-001',
name: 'Picking Charge',
charge_type: 'PICK',
quantity: 10,
price: 0.5
}
}
})
};
fetch('https://clarus-api.com/api/charge_lines', 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": {}
}
]
}Request Structure
{
"data": {
"type": "charge_lines",
"attributes": {
"charge_basket_id": 1,
"code": "PICK-001",
"name": "Picking Charge",
"charge_type": "PICK",
"quantity": 10,
"price": 0.50,
"goods_out_id": 123
}
}
}
Required Fields
| Field | Description |
|---|---|
charge_basket_id | Charge basket to add the line to |
code | Unique code for the charge line (1-30 chars) |
name | Display name for the charge (max 50 chars) |
charge_type | One of: PICK, RECEIPT, RENTAL, SUNDRY |
Optional Fields
| Field | Description |
|---|---|
quantity | Quantity to charge (defaults to 1.0) |
price | Unit price (defaults to 0.0) |
description | Additional description |
charge_price_id | Reference to a charge price template |
Charge Types & Recommended Associations
While all association fields are technically optional, each charge type has recommended associations based on what you’re charging for:PICK - Picking/Outbound Charges
Charges for picking and packing operations.| Field | Recommended | Purpose |
|---|---|---|
goods_out_id | Yes | Link to the outbound order being charged |
goods_out_pick_list_id | Optional | Link to specific pick list if applicable |
product_id | Optional | Link to product if product-specific pricing |
{
"charge_type": "PICK",
"goods_out_id": 123,
"goods_out_pick_list_id": 456,
"code": "PICK-001",
"name": "Order Picking Fee",
"quantity": 10,
"price": 0.50
}
RECEIPT - Receiving/Inbound Charges
Charges for receiving goods into the warehouse.| Field | Recommended | Purpose |
|---|---|---|
inbound_good_id | Yes | Link to the goods in receipt |
inbound_item_id | Optional | Link to specific receipt line |
product_id | Optional | Link to product if product-specific pricing |
{
"charge_type": "RECEIPT",
"inbound_good_id": 789,
"inbound_item_id": 101,
"code": "RCV-001",
"name": "Receiving Fee",
"quantity": 50,
"price": 0.25
}
RENTAL - Storage Charges
Charges for storing goods in the warehouse.| Field | Recommended | Purpose |
|---|---|---|
storage_unit_id | Yes | Link to the storage unit being charged for |
product_id | Optional | Link to product if product-specific rates |
{
"charge_type": "RENTAL",
"storage_unit_id": 555,
"code": "RENT-001",
"name": "Weekly Pallet Storage",
"quantity": 4,
"price": 5.00
}
SUNDRY - Miscellaneous Charges
Ad-hoc charges not tied to specific operations.| Field | Recommended | Purpose |
|---|---|---|
| Any | Optional | Can link to any entity as needed |
{
"charge_type": "SUNDRY",
"code": "ADMIN-001",
"name": "Administrative Fee",
"quantity": 1,
"price": 25.00
}
Important Notes
- Total calculation: The
totalfield is automatically calculated asquantity × price - Invoiced charges: Once a charge line is invoiced (linked to an AR document), it cannot be modified or deleted
- Warehouse access: Users can only create/update charge lines for warehouses they have access to
Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
FlowAuthorization Code
- Authorization URL
- https://clarus-api.com/oauth/authorize
- Token URL
- https://clarus-api.com/oauth/token
FlowClient Credentials
- Token URL
- https://clarus-api.com/oauth/token
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Body
application/json
Show child attributes
Show child attributes
Response
Charge line created successfully
Show child attributes
Show child attributes

