{"openapi":"3.0.0","info":{"version":"1.0.0","title":"3PL API"},"servers":[{"url":"https://api.3pl.uat.thehuub.io","description":"Staging server"},{"url":"https://3pl.api.thehuub.co","description":"Production server"}],"paths":{"/authenticate/":{"post":{"summary":"Returns a JWT if success on basic login","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Authenticate"},"examples":{"success":{"$ref":"#/components/examples/Authenticate"}}}}},"responses":{"200":{"description":"Successfully authenticated. Should receive a body with the JWT."},"401":{"description":"Failed to authenticate. Wrong user or password","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JWTUnauthorized"},"examples":{"success":{"$ref":"#/components/examples/JWTUnauthorized"}}}}}}}},"/reception/receive/":{"put":{"summary":"Inform new available stock received","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceptionReceive"},"examples":{"success":{"$ref":"#/components/examples/ReceptionReceive"}}}}},"security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"Successfully informed that a reception was received"},"400":{"description":"Failed to inform that a reception was received due to a payload error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"},"examples":{"success":{"$ref":"#/components/examples/APIResponse400ReceptionReceive"}}}}},"403":{"description":"Authentication or authorization Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"},"examples":{"success":{"$ref":"#/components/examples/APIResponse403"}}}}}}}},"/shipment/fulfil/":{"put":{"summary":"Inform shipment with packing and tracking information","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShipmentFulfil"},"examples":{"success":{"$ref":"#/components/examples/ShipmentFulfil"}}}}},"security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"Successfully informed that an order was fulfiled"},"400":{"description":"Failed to inform that an order was fulfiled due to a payload error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShipmentFulfil400"},"examples":{"success":{"$ref":"#/components/examples/ShipmentFulfil400"}}}}},"403":{"description":"Authentication or authorization Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"},"examples":{"success":{"$ref":"#/components/examples/APIResponse403"}}}}}}}},"/shipment/ship/":{"put":{"summary":"Inform shipment date","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShipmentShip"},"examples":{"success":{"$ref":"#/components/examples/ShipmentShip"}}}}},"security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"Successfully informed that an order was fulfiled"},"400":{"description":"Failed to inform that an order was fulfiled due to a payload error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShipmentShip400"},"examples":{"success":{"$ref":"#/components/examples/ShipmentShip400"}}}}},"403":{"description":"Authentication or authorization Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"},"examples":{"success":{"$ref":"#/components/examples/APIResponse403"}}}}}}}},"/shipment/cancel/":{"put":{"summary":"Cancel a shipment","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShipmentCancel"},"examples":{"valid":{"summary":"An example of a valid payload","value":{"shipment_reference":"SO#2021-123456-#1","reason":"lack_of_stock"}}}}}},"security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"Successfully cancelled order fulfilment"},"400":{"description":"Failed to cancel order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse400"},"examples":{"order_shipped":{"summary":"Response when order shipped","value":{"message":"Request failed for order reference SO#2021-123456-#1","details":"The order being cancelled has already been shipped"}},"order_cancelled":{"summary":"Response when order already cancelled","value":{"message":"Request failed for order reference SO#2021-123456-#1","details":"The order being cancelled has already been cancelled"}}}}}},"403":{"description":"Authentication or authorization Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"},"examples":{"success":{"$ref":"#/components/examples/APIResponse403"}}}}}}}},"/shipment/document/":{"post":{"summary":"Upload a document related to a shipment","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/ShipmentDocument"}}}},"security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"Successfully document uploaded"},"403":{"description":"Authentication or authorization Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"},"examples":{"success":{"$ref":"#/components/examples/APIResponse403"}}}}}}}},"/return/receive/":{"post":{"summary":"Inform a return received","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnReceive"},"examples":{"success":{"$ref":"#/components/examples/ReturnReceive"}}}}},"security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"Successfully informed that a return was received"},"400":{"description":"Failed to inform that a return was received due to a payload error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnReceive400"},"examples":{"success":{"$ref":"#/components/examples/ReturnReceive400"}}}}},"403":{"description":"Authentication or authorization Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"},"examples":{"success":{"$ref":"#/components/examples/APIResponse403"}}}}}}}},"/stock/adjust/":{"put":{"summary":"Adjust stock for a list of items","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockAdjust"},"examples":{"success":{"$ref":"#/components/examples/StockAdjust"}}}}},"security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"Successfully adjusted stock for a list of items"},"400":{"description":"Failed to adjust the stock of a list of items due to a payload error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse400"},"examples":{"variant_not_found":{"summary":"Response when at least one variant is not found","value":{"errors":{"code":"stock-adjustment-error-1","details":"There was at least one variant not found"}}}}}}},"403":{"description":"Authentication or authorization Failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"},"examples":{"success":{"$ref":"#/components/examples/APIResponse403"}}}}}}}}},"components":{"schemas":{"Authenticate":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"}},"required":["email","password"]},"ReceptionReceive":{"type":"object","properties":{"arrived_at_warehouse_date":{"type":"string","format":"date-time"},"reception_reference":{"type":"string"},"items_received":{"type":"array","items":{"type":"object","properties":{"variant_barcode":{"type":"string"},"variant_sku":{"type":"string"},"quantity_compliant":{"type":"integer"},"quantity_non_compliant":{"type":"integer"}},"required":["variant_barcode","variant_sku","quantity_compliant","quantity_non_compliant"]}}},"required":["arrived_at_warehouse_date","reception_reference","items_received"]},"ShipmentFulfil":{"type":"object","properties":{"date_fulfilled":{"type":"string","format":"date-time"},"shipment_reference":{"type":"string"},"carrier":{"type":"string"},"carrier_service_type":{"type":"string"},"unmapped_tracking_numbers":{"type":"array","items":{"type":"string"}},"return_carrier":{"type":"string"},"return_service_type":{"type":"string"},"return_main_tracking_number":{"type":"string"},"packs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"weight":{"type":"number"},"volume":{"type":"number"},"tracking_number":{"type":"string"},"return_tracking_number":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"variant_sku":{"type":"string"},"variant_barcode":{"type":"string"},"quantity":{"type":"integer"}},"required":["variant_sku","variant_barcode","quantity"]}}},"required":["name","weight","volume","items"]}}},"required":["date_fulfilled","shipment_reference","carrier","carrier_service_type","packs"]},"ShipmentShip":{"type":"object","properties":{"date_shipped":{"type":"string","format":"date-time"},"shipment_reference":{"type":"string"}},"required":["date_shipped","shipment_reference"]},"ShipmentCancel":{"type":"object","properties":{"shipment_reference":{"type":"string"},"reason":{"type":"string"}},"required":["shipment_reference"]},"ShipmentDocument":{"type":"object","properties":{"shipment_reference":{"type":"string","example":"SO#2021-123456-#1"},"type":{"type":"string","enum":["outbound_label","outbound_invoice","return_label","return_invoice","other"]},"file":{"type":"string","format":"binary"}},"required":["shipment_reference","type","file"]},"ReturnReceive":{"type":"object","properties":{"arrived_at_warehouse_date":{"type":"string","format":"date-time"},"shipment_reference":{"type":"string"},"warehouse_return_reference":{"type":"string"},"return_tracking_number":{"type":"string"},"return_carrier":{"type":"string"},"return_service_type":{"type":"string"},"return_type":{"type":"string","enum":["rto","client_return"]},"items_received":{"type":"array","items":{"type":"object","properties":{"variant_sku":{"type":"string"},"variant_barcode":{"type":"string"},"quantity_compliant":{"type":"integer"},"quantity_non_compliant":{"type":"integer"},"non_compliant_reasons":{"type":"array","items":{"type":"object","properties":{"quantity":{"type":"integer"},"reason":{"type":"string"}},"required":["quantity","reason"]}},"refurbish":{"type":"array","items":{"type":"object","properties":{"quantity":{"type":"integer"},"refurbish_type":{"type":"string"}},"required":["quantity","refurbish_type"]}}},"required":["variant_sku","variant_barcode","quantity_compliant","quantity_non_compliant","non_compliant_reasons","refurbish"]}}},"required":["arrived_at_warehouse_date","shipment_reference","return_tracking_number","return_carrier","return_service_type","return_type","items_received"]},"StockAdjust":{"type":"object","properties":{"warehouse_code":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"brand_reference":{"type":"string"},"variant_sku":{"type":"string"},"variant_barcode":{"type":"string"},"quantity_compliant":{"type":"number"},"quantity_non_compliant":{"type":"number"},"reception_reference":{"type":"string"}},"required":["brand_reference","variant_sku","variant_barcode","quantity_compliant","quantity_non_compliant"]}}},"required":["warehouse_code","items"]},"APIResponse":{"type":"object","properties":{"message":{"type":"string"},"details":{"type":"string"}}},"JWT":{"type":"object","properties":{"jwt":{"type":"string"},"expiration_time":{"type":"number"}}},"JWTUnauthorized":{"type":"object","properties":{"details":{"type":"string"}}},"ShipmentFulfil400":{"type":"object","properties":{"code":{"type":"integer"},"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"details":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"variant_barcode":{"type":"string"},"variant_sku":{"type":"string"},"quantity_requested":{"type":"integer"},"quantity_fulfilled":{"type":"integer"}}}}}}}}},"ShipmentShip400":{"type":"object","properties":{"code":{"type":"integer"},"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"details":{"type":"string"}}}}}},"ReturnReceive400":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"details":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"variant_barcode":{"type":"string"},"variant_sku":{"type":"string"}}}}}}}}},"APIResponse400":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"details":{"type":"string"}}}}}}},"examples":{"Authenticate":{"summary":"An example of a valid authentication payload","value":{"email":"user@example.com","password":"MyPasswordAtExample"}},"JWT":{"summary":"An example of a JWT payload","value":{"jwt":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c","expiration_time":1.6142112E9}},"ReceptionReceive":{"summary":"An example of a valid payload","value":{"arrived_at_warehouse_date":"2021-01-18 18:09:38","reception_reference":"PO#2020-1234-1","items_received":[{"variant_sku":"Rib Collar T-shirt_Black_8-9y","variant_barcode":"1234567890000","quantity_compliant":23,"quantity_non_compliant":0},{"variant_sku":"Rib Collar T-shirt_Black_12-13y","variant_barcode":"9876543210000","quantity_compliant":38,"quantity_non_compliant":0}]}},"ShipmentFulfil":{"summary":"An example of a valid payload","value":{"date_fulfilled":"2021-01-27 17:00:25","shipment_reference":"SO#2021-123456-#1","carrier":"DHL","carrier_service_type":"Express","unmapped_tracking_numbers":[],"return_carrier":"UPS","return_service_type":"UPSStandard","return_main_tracking_number":"DH123456432PT","packs":[{"name":"DHL Flyer Small","tracking_number":"783422884944","return_tracking_number":"783422884955","weight":1.1,"volume":8177.0,"items":[{"variant_sku":"008-00415-0044-042","variant_barcode":"2325659978945","quantity":1}]}]}},"ShipmentFulfil400":{"summary":"Response for an API call with a 400 response","value":{"code":400,"errors":[{"code":"error-order-2","details":"There was at least one item packed with higher quantity than requested","items":[{"variant_barcode":"5060708781071","variant_sku":"008-00415-0044-042","quantity_requested":1,"quantity_fulfilled":2}]}]}},"ShipmentShip":{"summary":"An example of a valid payload","value":{"date_shipped":"2021-01-27 17:00:25","shipment_reference":"SO#2021-123456-#1"}},"ShipmentShip400":{"summary":"Response for an API call with a 400 response","value":{"code":400,"errors":[{"code":"error-order-9","details":"Shipment already shipped"}]}},"ReturnReceive":{"summary":"An example of a valid request","value":{"arrived_at_warehouse_date":"2020-11-16T09:20:00.000","shipment_reference":"SO#2021-3997628-#1","warehouse_return_reference":"02200318202","return_carrier":"DHL","return_service_type":"Express","return_tracking_number":"LP003999275DE","return_type":"client_return","items_received":[{"variant_sku":"008-00415-0044-042","variant_barcode":5060708781071,"quantity_compliant":1,"quantity_non_compliant":1,"non_compliant_reasons":[{"quantity":1,"reason":"Stained"}],"refurbish":[{"quantity":1,"refurbish_type":"Label Polybag"}]}]}},"StockAdjust":{"summary":"An example of a valid payload","value":{"warehouse_code":"WH01","items":[{"brand_reference":"NU","variant_sku":"008-00415-0044-042","variant_barcode":"2325659978945","quantity_compliant":-1,"quantity_non_compliant":0},{"brand_reference":"NU","variant_sku":"008-00415-0044-043","variant_barcode":"2325659978946","quantity_compliant":-3,"quantity_non_compliant":3,"reception_reference":"PO#2021-1000-1"}]}},"APIResponse400ReceptionReceive":{"summary":"Response for an API call with a 400 response","value":{"message":"Bad request","details":"Validation Error. 'arrived_at_warehouse_date' is a required property"}},"APIResponse400ShipmentFulfil":{"summary":"Response for an API call with a 400 response","value":{"message":"Bad request","details":"Validation Error. 'variant_sku' is a required property"}},"APIResponse400StockAdjust":{"summary":"Response for an API call with a 400 response","value":{"message":"Bad request","details":"Validation Error. 'quantity_compliant' is a required property"}},"ReturnReceive400":{"summary":"Response for an API call with a 400 response","value":{"code":400,"message":"Request failed for warehouse_return_reference 0000031820","errors":[{"code":"return-error-1","details":"There was at least one item returned not on order","items":[{"variant_barcode":"5060708781071","variant_sku":"008-00415-0044-042"}]}]}},"APIResponse403":{"summary":"Response for an API call with 403 response","value":{"details":"Error decoding signature."}},"JWTUnauthorized":{"summary":"Response for failed authentication","value":{"details":"Authentication failed."}}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"jwt"}}}}