Skip to main content
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
    }
  }
}
'
{
  "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
    }
  }
}

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

FieldDescription
charge_basket_idCharge basket to add the line to
codeUnique code for the charge line (1-30 chars)
nameDisplay name for the charge (max 50 chars)
charge_typeOne of: PICK, RECEIPT, RENTAL, SUNDRY

Optional Fields

FieldDescription
quantityQuantity to charge (defaults to 1.0)
priceUnit price (defaults to 0.0)
descriptionAdditional description
charge_price_idReference to a charge price template
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.
FieldRecommendedPurpose
goods_out_idYesLink to the outbound order being charged
goods_out_pick_list_idOptionalLink to specific pick list if applicable
product_idOptionalLink 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.
FieldRecommendedPurpose
inbound_good_idYesLink to the goods in receipt
inbound_item_idOptionalLink to specific receipt line
product_idOptionalLink 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.
FieldRecommendedPurpose
storage_unit_idYesLink to the storage unit being charged for
product_idOptionalLink 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.
FieldRecommendedPurpose
AnyOptionalCan 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 total field is automatically calculated as quantity × 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

Authorization
string
header
required

OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.

X-Clarus-Subdomain
string
header
required

The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.

Body

application/json
data
object
required

Response

Charge line created successfully

data
object