{"components":{"responses":{},"schemas":{"CartHandoffRequest":{"properties":{"cart_reference":{"description":"Opaque merchant cart reference","type":"string"},"expires_in_seconds":{"maximum":604800,"minimum":60,"type":"integer"},"external_cart_id":{"type":"string"},"lines":{"items":{"$ref":"#/components/schemas/CartLine"},"maxItems":200,"minItems":1,"type":"array"},"return_url":{"format":"uri","type":"string"}},"required":["cart_reference","lines"],"title":"CartHandoffRequest","type":"object"},"CartHandoffResponse":{"properties":{"claim_url":{"format":"uri","type":"string"},"expires_at":{"format":"date-time","type":"string"},"handoff_id":{"format":"uuid","type":"string"}},"required":["handoff_id","claim_url","expires_at"],"title":"CartHandoffResponse","type":"object"},"CartLine":{"properties":{"currency":{"type":"string"},"external_line_id":{"type":"string"},"external_product_id":{"type":"string"},"merchant_sku":{"type":"string"},"quantity":{"exclusiveMinimum":true,"minimum":0,"type":"number"},"title":{"type":"string"},"unit_price_minor":{"type":"integer"}},"required":["title","quantity"],"title":"CartLine","type":"object"},"ErrorResponse":{"properties":{"error":{"type":"string"}},"required":["error"],"title":"ErrorResponse","type":"object"},"OrderLine":{"additionalProperties":false,"properties":{"external_line_id":{"type":"string"},"external_product_id":{"type":"string"},"merchant_sku":{"type":"string"},"quantity":{"exclusiveMinimum":true,"minimum":0,"type":"number"},"title":{"type":"string"}},"required":["external_line_id","title","quantity"],"title":"OrderLine","type":"object"},"OrderRequest":{"additionalProperties":false,"properties":{"currency":{"maxLength":3,"minLength":3,"type":"string"},"external_order_id":{"type":"string"},"lines":{"items":{"$ref":"#/components/schemas/OrderLine"},"maxItems":500,"minItems":1,"type":"array"},"ordered_at":{"format":"date-time","type":"string"}},"required":["external_order_id","ordered_at","lines"],"title":"OrderRequest","type":"object"},"ResourceResponse":{"properties":{"external_id":{"type":"string"},"id":{"format":"uuid","type":"string"},"status":{"type":"string"}},"required":["id","status","external_id"],"title":"ResourceResponse","type":"object"},"ShipmentLine":{"additionalProperties":false,"properties":{"external_order_line_id":{"type":"string"},"quantity":{"exclusiveMinimum":true,"minimum":0,"type":"number"}},"required":["external_order_line_id","quantity"],"title":"ShipmentLine","type":"object"},"ShipmentRequest":{"additionalProperties":false,"properties":{"carrier":{"type":"string"},"external_order_id":{"type":"string"},"external_shipment_id":{"type":"string"},"lines":{"items":{"$ref":"#/components/schemas/ShipmentLine"},"maxItems":500,"minItems":1,"type":"array"},"shipped_at":{"format":"date-time","type":"string"},"tracking_number":{"type":"string"}},"required":["external_shipment_id","external_order_id","shipped_at","lines"],"title":"ShipmentRequest","type":"object"}},"securitySchemes":{"merchantHmac":{"description":"HMAC-SHA256 signed cart handoff request","in":"header","name":"X-SmartDepot-Signature","type":"apiKey"},"oauth2":{"flows":{"authorizationCode":{"authorizationUrl":"https://api.smartdepot.org/oauth/authorize","scopes":{"orders:write":"Import orders into an authorized workspace","shipments:write":"Import shipments into an authorized workspace"},"tokenUrl":"https://api.smartdepot.org/oauth/token"}},"type":"oauth2"}}},"info":{"description":"Write-only merchant integrations. No inventory or user read access.","title":"SmartDepot Merchant API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/api/v1/cart-handoffs":{"post":{"callbacks":{},"operationId":"SmartDepotWeb.CartHandoffController.create","parameters":[{"description":"","in":"header","name":"X-SmartDepot-Client-Id","required":true,"schema":{"type":"string"}},{"description":"","in":"header","name":"X-SmartDepot-Timestamp","required":true,"schema":{"type":"string"}},{"description":"","in":"header","name":"X-SmartDepot-Nonce","required":true,"schema":{"type":"string"}},{"description":"","in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartHandoffRequest"}}},"description":"Cart handoff","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartHandoffResponse"}}},"description":"Created handoff"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Invalid signature"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Replay or idempotency conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Invalid payload"}},"security":[{"merchantHmac":[]}],"summary":"Submit an anonymous cart handoff","tags":["Cart handoffs"]}},"/api/v1/orders":{"post":{"callbacks":{},"operationId":"SmartDepotWeb.OrderController.create","parameters":[{"description":"","in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderRequest"}}},"description":"Order","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceResponse"}}},"description":"Imported order"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Invalid token"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Insufficient scope"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Idempotency conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Invalid payload"}},"security":[{"oauth2":["orders:write"]}],"summary":"Import an order","tags":["Orders"]}},"/api/v1/shipments":{"post":{"callbacks":{},"operationId":"SmartDepotWeb.ShipmentController.create","parameters":[{"description":"","in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShipmentRequest"}}},"description":"Shipment","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceResponse"}}},"description":"Imported shipment"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Invalid token"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Insufficient scope"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Idempotency conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Invalid payload"}},"security":[{"oauth2":["shipments:write"]}],"summary":"Import a shipment","tags":["Shipments"]}}},"security":[],"servers":[{"description":"Production","url":"https://api.smartdepot.org","variables":{}},{"description":"Sandbox","url":"https://sandbox-api.smartdepot.org","variables":{}}],"tags":[]}