{"uid":"cap_ASg-0gYuBWSf6nJDmjkHu","slug":"sitecheck-trade-energy-container-demurrage-detention-calculator-807048f3","name":"SiteCheck Trade & Energy – Container Demurrage & Detention Calculator","description":"Container demurrage or detention calculator: from the start date (discharge or gate-out), end date (gate-out or empty return), free days and the carrier's tiered daily rates you supply (e.g. 1-4:75,5-8:150,9+:250), returns chargeable days, the day-by-day tier split and the total per container and for all containers. Counts calendar days, start day included unless you say otherwise. Carrier tariffs are not looked up.","url":"https://api.tradeenergy-api.workers.dev/api/logistics/demurrage-detention?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["start","end","freeDays","rates"],"properties":{"end":{"type":"string","description":"End date YYYY-MM-DD: gate-out full (demurrage) or empty return (detention) (required)"},"rates":{"type":"string","description":"Tiers after free time, 'from-to:rate' comma separated, last open-ended with '+', e.g. 1-4:75,5-8:150,9+:250 (required)"},"start":{"type":"string","description":"Start date YYYY-MM-DD: discharge (demurrage) or gate-out full (detention) (required)"},"currency":{"type":"string","description":"Currency label for the output, default USD"},"freeDays":{"type":"string","description":"Free days granted, 0-60 (required)"},"containers":{"type":"string","description":"Number of containers, default 1"},"countStartDay":{"type":"string","description":"true (default) counts the start date as day 1; false starts on the next day"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"tiers":[{"days":4,"rate":75,"tier":"1-4","amount":300},{"days":4,"rate":150,"tier":"5-8","amount":600}],"total":4300,"currency":"USD","daysUsed":20,"freeDays":7,"containers":2,"freeTimeEnds":"2026-10-07","perContainer":2150,"chargeableDays":13}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_K_wynHkyr0EwJZuGPiUMV","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates container demurrage or detention charges given start/end dates, free days, and carrier tiered daily rates, returning chargeable days, tier breakdown, and total cost per container and overall.","exampleAgentPrompt":"Can you calculate the demurrage charges for 3 containers that were discharged on 2026-09-24 and returned empty on 2026-10-18, with 7 free days and carrier rates of 1-4:75, 5-8:150, 9+:250 USD per day?","exampleUseCases":[{"title":"Shipping invoice demurrage audit","prompt":"I need to verify a carrier demurrage invoice — we had 2 containers discharged on 2026-08-01 and returned on 2026-08-20, the carrier gave us 5 free days and their rates are 1-5:80, 6-10:160, 11+:300 USD. Can you compute the total chargeable days and the tier breakdown so I can check if the invoice is correct?"},{"title":"Detention cost estimate for import planning","prompt":"We're planning an import and want to estimate detention costs. Gate-out is 2026-11-03 and we expect to return the empty container on 2026-11-14. Free days are 4 and the carrier charges 1-4:100, 5+:200 USD per day per box. We have 5 containers — what's the total detention bill?"},{"title":"Freight brokerage rate comparison","prompt":"I'm comparing two carrier tariffs for the same shipment: start date 2026-10-10, end date 2026-10-28, 6 free days, 4 containers. Carrier A rates are 1-5:60,6-10:120,11+:200 and Carrier B rates are 1-7:50,8+:175. Can you calculate the total demurrage for each so I can see which is cheaper?"}],"resultDescription":"Returns a JSON object with: total chargeable days (daysUsed), free days granted, date free time ends (freeTimeEnds), an array of tier objects (tier label, days in that tier, daily rate, tier subtotal), cost per container (perContainer), total cost across all containers (total), number of containers, and currency label.","failureModes":["Missing required parameters (start, end, freeDays, rates) returns an error","Invalid date format (not YYYY-MM-DD) causes parsing failure","Malformed rates string (wrong separators or missing '+' on last tier) returns an error","End date before start date may return zero or negative chargeable days","freeDays value outside 0-60 range may be rejected","Carrier tariff data is not auto-fetched — rates must be supplied manually"],"whenToPreferThis":"Use this endpoint when you have all charge parameters on hand (dates, free days, tiered rates) and need a precise, day-by-day tier breakdown without looking up carrier tariffs. Prefer this over manual spreadsheet calculation when automating invoice validation, freight cost estimation, or multi-container billing in a workflow. It is not suitable if you need the endpoint to fetch carrier tariffs automatically.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T00:34:25.783Z","isFirstParty":false,"canonicalSlug":"sitecheck-trade-energy-container-demurrage-detention-calculator-807048f3"}