{"openapi":"3.1.0","info":{"title":"DutyMesh public estimate contract","version":"0.2.0-stage6","description":"A validated request boundary for the DutyMesh public evidence beta. Calculation publication is locked, so every schema-valid request currently receives an explicit refusal with grand_total set to null."},"servers":[{"url":"https://usedutymesh.com","description":"The public evidence origin that served this document"}],"paths":{"/api/estimate":{"post":{"operationId":"validatePublicEstimateRequest","summary":"Validate a landed-cost request and enforce the publication lock","description":"Accepts shipment facts only. Do not send names, email addresses, street addresses, payment details, or identity documents. A valid request is refused until a complete calculation release is explicitly approved.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LandedCostRequest"},"example":{"entry_date":"2026-08-03","origin_country":"BR","dispatch_country":"BR","destination_country":"US","destination_region":null,"transport_mode":"express_courier","transaction_type":"commercial_b2c","incoterm":"DAP","settlement_currency":"USD","lines":[{"line_id":"line-1","destination_tariff_code":"6109100012","description":"Cotton T-shirts","origin_country":"BR","quantity":"1","quantity_unit":"item","unit_price":{"currency":"USD","decimal":"50.00","tax_inclusive":false}}],"shipping":{"currency":"USD","decimal":"12.00"},"insurance":{"currency":"USD","decimal":"0"},"other_incidental_costs":[],"tax_collection":{"pathway":"unknown","ioss_status":"unknown","prices_include_tax":false},"preference_claim":{"mode":"none"},"fee_mode":"official_only","carrier_charges_scope":"include"}}}},"responses":{"400":{"description":"Malformed JSON."},"413":{"description":"Request body exceeds 64 KiB."},"415":{"description":"Content-Type is not JSON."},"422":{"description":"JSON does not match the request schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationRefusal"}}}},"503":{"description":"Schema-valid request; calculation publication remains locked.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Conservative retry interval in seconds."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationRefusal"},"example":{"error":"publication_locked","message":"No public calculation release is approved. Candidate base-rate evidence cannot be presented as a complete landed-cost quote.","grand_total":null,"known_components":[],"missing_components":["tax","preferences","trade_remedies","fees","official_fx","carrier_charges"],"retryable":false}}}}}}}},"components":{"schemas":{"LandedCostRequest":{"type":"object","properties":{"entry_date":{"type":"string"},"shipment_date":{"type":"string"},"origin_country":{"type":"string","pattern":"^[A-Z]{2}$"},"dispatch_country":{"type":"string","pattern":"^[A-Z]{2}$"},"destination_country":{"anyOf":[{"type":"string","const":"US"},{"type":"string","enum":["AT","BE","BG","HR","CY","CZ","DE","DK","EE","ES","FI","FR","GR","HU","IE","IT","LT","LU","LV","MT","NL","PL","PT","RO","SE","SI","SK"]},{"type":"string","const":"GB"},{"type":"string","const":"CA"},{"type":"string","const":"AU"}]},"destination_region":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"destination_postal_code":{"type":"string","minLength":1,"maxLength":24},"transport_mode":{"type":"string","enum":["international_postal","express_courier","air_cargo","ocean","road","rail"]},"transaction_type":{"type":"string","enum":["commercial_b2c","commercial_b2b","gift","personal"]},"incoterm":{"type":"string","minLength":2,"maxLength":120},"settlement_currency":{"type":"string","pattern":"^[A-Z]{3}$"},"lines":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"line_id":{"type":"string","minLength":1,"maxLength":100},"destination_tariff_code":{"type":"string","pattern":"^\\d{4,14}$"},"description":{"type":"string","minLength":1,"maxLength":500},"origin_country":{"type":"string","pattern":"^[A-Z]{2}$"},"quantity":{"type":"string","pattern":"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"quantity_unit":{"type":"string","minLength":1,"maxLength":40},"unit_price":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"decimal":{"type":"string","pattern":"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"tax_inclusive":{"type":"boolean"}},"required":["currency","decimal"],"additionalProperties":false},"discounts":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"decimal":{"type":"string","pattern":"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"tax_inclusive":{"type":"boolean"}},"required":["currency","decimal"],"additionalProperties":false},"assists":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"decimal":{"type":"string","pattern":"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"tax_inclusive":{"type":"boolean"}},"required":["currency","decimal"],"additionalProperties":false},"packing":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"decimal":{"type":"string","pattern":"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"tax_inclusive":{"type":"boolean"}},"required":["currency","decimal"],"additionalProperties":false},"royalties":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"decimal":{"type":"string","pattern":"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"tax_inclusive":{"type":"boolean"}},"required":["currency","decimal"],"additionalProperties":false},"seller_proceeds":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"decimal":{"type":"string","pattern":"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"tax_inclusive":{"type":"boolean"}},"required":["currency","decimal"],"additionalProperties":false},"excise_attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"material_attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["line_id","destination_tariff_code","description","origin_country","quantity","quantity_unit","unit_price"],"additionalProperties":false}},"shipping":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"decimal":{"type":"string","pattern":"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"tax_inclusive":{"type":"boolean"}},"required":["currency","decimal"],"additionalProperties":false},"insurance":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"decimal":{"type":"string","pattern":"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"tax_inclusive":{"type":"boolean"}},"required":["currency","decimal"],"additionalProperties":false},"other_incidental_costs":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","minLength":1,"maxLength":80},"amount":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"decimal":{"type":"string","pattern":"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"tax_inclusive":{"type":"boolean"}},"required":["currency","decimal"],"additionalProperties":false},"destination_point":{"type":"string","minLength":1,"maxLength":120}},"required":["kind","amount"],"additionalProperties":false}},"tax_collection":{"type":"object","properties":{"pathway":{"type":"string","enum":["border","seller","marketplace","none","unknown"]},"ioss_status":{"type":"string","enum":["valid_at_entry","not_used","unknown","not_applicable"]},"prices_include_tax":{"type":"boolean"}},"required":["pathway","ioss_status","prices_include_tax"],"additionalProperties":false},"preference_claim":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"none"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"claimed"},"treatment_code":{"type":"string","minLength":1,"maxLength":80},"proof_held":{"type":"boolean"}},"required":["mode","treatment_code","proof_held"],"additionalProperties":false}]},"carrier":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"service":{"type":"string","minLength":1,"maxLength":100},"account_type":{"type":"string","minLength":1,"maxLength":80}},"required":["name","service"],"additionalProperties":false},"fee_mode":{"default":"official_only","type":"string","enum":["official_only","source_backed_range"]},"carrier_charges_scope":{"default":"include","type":"string","enum":["include","exclude"]}},"required":["entry_date","origin_country","dispatch_country","destination_country","transport_mode","transaction_type","incoterm","settlement_currency","lines","shipping","insurance","other_incidental_costs","tax_collection","preference_claim","fee_mode","carrier_charges_scope"],"additionalProperties":false},"ValidationRefusal":{"type":"object","required":["error","message","grand_total","issues"],"properties":{"error":{"type":"string","const":"invalid_request"},"message":{"type":"string"},"grand_total":{"type":"null"},"issues":{"type":"array","items":{"type":"object","required":["path","message"],"properties":{"path":{"type":"string"},"message":{"type":"string"}}}}}},"PublicationRefusal":{"type":"object","required":["error","message","grand_total","known_components","missing_components","retryable"],"properties":{"error":{"type":"string","const":"publication_locked"},"message":{"type":"string"},"grand_total":{"type":"null"},"known_components":{"type":"array","maxItems":0},"missing_components":{"type":"array","items":{"type":"string"}},"retryable":{"type":"boolean","const":false}}}}},"x-dutymesh-publication-status":"locked","x-dutymesh-calculation-release-authorized":false}