{"openapi":"3.1.0","info":{"title":"POST /api/v1/inventory/shipments","version":"1.0.0","description":"Create shipment"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/inventory/shipments":{"post":{"tags":["inventory:shipments"],"summary":"Create shipment","description":"Record a received shipment and update inventory.","operationId":"create_shipment_api_v1_inventory_shipments_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShipmentCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShipmentResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Fee":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Fee name (e.g., 'Shipping', 'Handling')."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Fee description (alternative to name)."},"amount":{"type":"integer","title":"Amount","description":"Fee amount in cents."}},"type":"object","required":["amount"],"title":"Fee","description":"Additional fee on an inventory order.\n\nUsed for shipping, handling, customs, or other charges.\nAmount is in cents.","example":{"amount":5000,"name":"Shipping"}},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LineItem":{"properties":{"amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount","description":"Line item total in cents (e.g., 2550 for $25.50)."},"product_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Id","description":"Product UUID (optional if variant_id provided)."},"quantity":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Quantity","description":"Number of units."},"unit_price":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Price","description":"Price per unit in cents."},"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id","description":"Product variant UUID."},"inventory_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inventory Order Id","description":"Parent order UUID (set automatically)."}},"type":"object","title":"LineItem","description":"Line item for inventory orders and shipments.\n\nRepresents a single product variant being ordered or shipped.\nAmounts are in cents (e.g., 2550 = $25.50).","example":{"amount":120000,"quantity":100,"unit_price":1200,"variant_id":"019ab37c-var1-7000-8000-000000000001"}},"ShipmentCreateRequest":{"properties":{"fees":{"anyOf":[{"items":{"$ref":"#/components/schemas/Fee"},"type":"array"},{"type":"null"}],"title":"Fees","description":"Shipment-specific fees."},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Shipment status.","default":"draft"},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/LineItem"},"type":"array"},{"type":"null"}],"title":"Line Items","description":"Items included in this shipment."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Shipment notes."},"tracking_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tracking Number","description":"Carrier tracking number."},"expected_arrival_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Arrival Date","description":"Expected delivery date."},"shipped_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Shipped Date","description":"Date shipped."},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id","description":"Destination location ID (where the shipment is being shipped to)."}},"type":"object","title":"ShipmentCreateRequest","description":"Request schema for creating a shipment.\n\nShipments track delivery of inventory order items.\n\n**Shipment Statuses:**\n- `pending`: Being prepared\n- `shipped`: In transit\n- `received`: Received at destination\n- `canceled`: Cancelled","example":{"expected_arrival_date":"2024-01-20T00:00:00Z","line_items":[{"quantity":50,"variant_id":"019ab37c-var1-7000-8000-000000000001"}],"location_id":"019ab37c-loc1-7000-8000-000000000001","shipped_date":"2024-01-16T00:00:00Z","status":"shipped","tracking_number":"1Z999AA10123456784"}},"ShipmentResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Shipment UUID."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"status":{"type":"string","title":"Status","description":"Shipment status."},"fees":{"items":{"$ref":"#/components/schemas/Fee"},"type":"array","title":"Fees","description":"Shipment fees."},"line_items":{"items":{},"type":"array","title":"Line Items","description":"Items in shipment."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Notes."},"tracking_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tracking Number","description":"Tracking number."},"expected_arrival_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Arrival Date","description":"Expected delivery."},"shipped_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Shipped Date","description":"Ship date."},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id","description":"Destination location ID."},"location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Name","description":"Destination location name."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Created timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Updated timestamp."},"version":{"type":"integer","title":"Version","description":"Version for optimistic locking.","default":1}},"additionalProperties":true,"type":"object","required":["id","business_id","status","fees","line_items","created_at","updated_at"],"title":"ShipmentResponse","description":"Response schema for a shipment.","example":{"business_id":"019ab37c-bus1-7000-8000-000000000001","created_at":"2024-01-15T10:30:00Z","expected_arrival_date":"2024-01-20T00:00:00Z","fees":[],"id":"019ab37c-ship-7000-8000-000000000001","line_items":[],"shipped_date":"2024-01-16T00:00:00Z","status":"shipped","tracking_number":"1Z999AA10123456784","updated_at":"2024-01-16T09:00:00Z","version":2}},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}