Skip to content

Delivery Stop Cost

What one delivery cost to make: product cost and additional cost from the books, and our allocation of labor, fuel, truck and overhead. Never a charge billed to the customer; those are invoice lines.

Base/deliveryStopCost
GET/deliveryStopCost

List delivery stop costs

Retrieve a paginated list of delivery stop costs. Filter, order, and select columns with PostgREST query parameters.

Query parameters

selectstring

Comma-separated columns to return. Defaults to all.

orderstring

Column to sort by, e.g. `createdAt.desc`.

limitinteger

Maximum rows to return.

offsetinteger

Rows to skip, for pagination.

GET/deliveryStopCost
curl --request GET \
  --url '<your-host>/deliveryStopCost?select=*&limit=10' \
  --header 'Authorization: Bearer <api-key>'
Response
[
  {
    "id": "abc123def456",
    "companyId": "xyz789",
    "deliveryFillOrderId": "xyz789",
    "productCost": 0,
    "additionalCost": 0,
    "laborCost": 0,
    "fuelCost": 0,
    "truckCost": 0
  }
]
GET/deliveryStopCost

Retrieve a delivery stop cost

Fetch a single delivery stop cost by filtering on `id`.

Query parameters

idstring

Match on the delivery stop cost's `id`, e.g. `eq.{id}`.

GET/deliveryStopCost
curl --request GET \
  --url '<your-host>/deliveryStopCost?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
Response
{
  "id": "abc123def456",
  "companyId": "xyz789",
  "deliveryFillOrderId": "xyz789",
  "productCost": 0,
  "additionalCost": 0,
  "laborCost": 0,
  "fuelCost": 0,
  "truckCost": 0
}
POST/deliveryStopCost

Create a delivery stop cost

Create a new delivery stop cost.

Body parameters

deliveryFillOrderIdstringrequired
productCostnumberrequired
additionalCostnumberrequired
laborCostnumberrequired
fuelCostnumberrequired
truckCostnumberrequired
overheadAllocationnumberrequired
roundTripMilesnumber
totalCostnumber

Generated: productCost + additionalCost + laborCost + fuelCost + truckCost + overheadAllocation. May be negative on a pickup.

POST/deliveryStopCost
curl --request POST \
  --url <your-host>/deliveryStopCost \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"deliveryFillOrderId":"xyz789","productCost":0,"additionalCost":0,"laborCost":0,"fuelCost":0,"truckCost":0,"overheadAllocation":0}'
Response
{
  "id": "abc123def456",
  "companyId": "xyz789",
  "deliveryFillOrderId": "xyz789",
  "productCost": 0,
  "additionalCost": 0,
  "laborCost": 0,
  "fuelCost": 0,
  "truckCost": 0
}
PATCH/deliveryStopCost

Update a delivery stop cost

Update an existing delivery stop cost, matched on `id`.

Body parameters

deliveryFillOrderIdstringrequired
productCostnumberrequired
additionalCostnumberrequired
laborCostnumberrequired
fuelCostnumberrequired
truckCostnumberrequired
overheadAllocationnumberrequired
roundTripMilesnumber
totalCostnumber

Generated: productCost + additionalCost + laborCost + fuelCost + truckCost + overheadAllocation. May be negative on a pickup.

PATCH/deliveryStopCost
curl --request PATCH \
  --url '<your-host>/deliveryStopCost?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"deliveryFillOrderId":"xyz789"}'
Response
{
  "id": "abc123def456",
  "companyId": "xyz789",
  "deliveryFillOrderId": "xyz789",
  "productCost": 0,
  "additionalCost": 0,
  "laborCost": 0,
  "fuelCost": 0,
  "truckCost": 0
}
DELETE/deliveryStopCost

Delete a delivery stop cost

Delete a delivery stop cost, matched on `id`. Returns 204 No Content.

Query parameters

idstring

The `id` of the delivery stop cost to delete, e.g. `eq.{id}`.

DELETE/deliveryStopCost
curl --request DELETE \
  --url '<your-host>/deliveryStopCost?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
204 No Content