# Create Work Order POST https://sandbox-api.shipbob.com/Experimental/kitting:create Content-Type: application/json Creates a kitting work order. Currently only Kitting is supported as a work order type. Reference: https://developer-stage.shipbob.dev/experimental/api/kitting/create-work-order ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: api-experimental version: 1.0.0 paths: /Experimental/kitting:create: post: operationId: create-work-order summary: | Create Work Order description: > Creates a kitting work order. Currently only Kitting is supported as a work order type. tags: - subpackage_kitting parameters: - name: Authorization in: header description: Authentication using Personal Access Token (PAT) token required: true schema: type: string responses: '201': description: Success content: application/json: schema: $ref: '#/components/schemas/Kitting.PublicCreateWorkOrderResponse' '500': description: Server Error content: application/json: schema: $ref: '#/components/schemas/Kitting.ApiError' requestBody: description: The work order creation request content: application/json: schema: $ref: '#/components/schemas/Kitting.PublicCreateWorkOrderRequest' servers: - url: https://sandbox-api.shipbob.com components: schemas: Kitting.PublicWorkOrderActionAttachmentRequest: type: object properties: id: type: string description: The unique identifier (GUID) of the previously uploaded attachment. name: type: string description: The file name of the attachment including extension. required: - id - name description: Represents an attachment reference for a work order action. title: Kitting.PublicWorkOrderActionAttachmentRequest Kitting.PublicWorkOrderActionRequest: type: object properties: attachments: type: - array - 'null' items: $ref: >- #/components/schemas/Kitting.PublicWorkOrderActionAttachmentRequest description: Attachments associated with this action step. data: oneOf: - description: Any type - type: 'null' description: >- The action-specific data payload (e.g. packaging or inventory identifiers). instructions: type: - string - 'null' description: Optional instructions for this action step. order: type: integer description: The sort order of this action within the work order. sub_actions: type: - array - 'null' items: $ref: '#/components/schemas/Kitting.PublicWorkOrderActionRequest' description: Optional sub-actions nested under this action. work_order_action_type_id: type: integer description: >- The action type identifier that defines the kind of action to perform. required: - order - work_order_action_type_id description: Represents an action (step) in a kitting work order. title: Kitting.PublicWorkOrderActionRequest Kitting.PublicOrderLineItemRequest: type: object properties: inventory_id: type: integer description: The inventory identifier for this line item. quantity: type: integer description: The quantity of this inventory item required per kit. required: - inventory_id - quantity description: Represents an inventory line item in a kitting work order. title: Kitting.PublicOrderLineItemRequest Kitting.WorkOrderType: type: string enum: - Kitting title: Kitting.WorkOrderType Kitting.PublicCreateWorkOrderRequest: type: object properties: actions: type: array items: $ref: '#/components/schemas/Kitting.PublicWorkOrderActionRequest' description: The actions (steps) to be performed for the kitting work order. end_kitted_inventory_id: type: integer description: The inventory identifier for the end kitted product. fulfillment_center_id: type: integer description: >- The fulfillment center identifier where the work order will be processed. line_items: type: array items: $ref: '#/components/schemas/Kitting.PublicOrderLineItemRequest' description: The line items (component inventory) for the kitting work order. lot_date: type: - string - 'null' format: date-time description: Optional lot date for the kitting work order. lot_number: type: - string - 'null' description: Optional lot number for the kitting work order. quantity: type: integer description: The number of kits to produce. workorder_type: $ref: '#/components/schemas/Kitting.WorkOrderType' required: - actions - end_kitted_inventory_id - fulfillment_center_id - line_items - quantity - workorder_type description: Request model for creating a kitting work order. title: Kitting.PublicCreateWorkOrderRequest Kitting.PublicCreateWorkOrderResponse: type: object properties: shipment_id: type: integer description: The shipment identifier associated with the created work order. description: Response returned after successfully creating a kitting work order. title: Kitting.PublicCreateWorkOrderResponse Kitting.ApiError: type: object properties: details: oneOf: - description: Any type - type: 'null' errors: type: array items: type: string message: type: string stackTrace: type: - string - 'null' title: Kitting.ApiError securitySchemes: PAT: type: http scheme: bearer description: Authentication using Personal Access Token (PAT) token OAuth2: type: http scheme: bearer description: OAuth2 authentication using JWT tokens ``` ## SDK Code Examples ```python Kitting_createWorkOrder_example import requests url = "https://sandbox-api.shipbob.com/Experimental/kitting:create" payload = { "actions": [ { "order": 1, "work_order_action_type_id": 1, "attachments": [], "instructions": "Scan the barcode on the product before kitting", "sub_actions": [] }, { "order": 2, "work_order_action_type_id": 2, "attachments": [], "instructions": "Package items according to kit specifications", "sub_actions": [ { "order": 1, "work_order_action_type_id": 3, "attachments": [ { "id": "photo-001", "name": "completed-kit-photo" } ], "instructions": "Take a photo of the completed kit" } ] } ], "end_kitted_inventory_id": 42, "fulfillment_center_id": 1, "line_items": [ { "inventory_id": 101, "quantity": 10 } ], "quantity": 10, "workorder_type": "Kitting", "lot_date": "2024-01-15T09:00:00Z", "lot_number": "LOT-2024-001" } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Kitting_createWorkOrder_example const url = 'https://sandbox-api.shipbob.com/Experimental/kitting:create'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"actions":[{"order":1,"work_order_action_type_id":1,"attachments":[],"instructions":"Scan the barcode on the product before kitting","sub_actions":[]},{"order":2,"work_order_action_type_id":2,"attachments":[],"instructions":"Package items according to kit specifications","sub_actions":[{"order":1,"work_order_action_type_id":3,"attachments":[{"id":"photo-001","name":"completed-kit-photo"}],"instructions":"Take a photo of the completed kit"}]}],"end_kitted_inventory_id":42,"fulfillment_center_id":1,"line_items":[{"inventory_id":101,"quantity":10}],"quantity":10,"workorder_type":"Kitting","lot_date":"2024-01-15T09:00:00Z","lot_number":"LOT-2024-001"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Kitting_createWorkOrder_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://sandbox-api.shipbob.com/Experimental/kitting:create" payload := strings.NewReader("{\n \"actions\": [\n {\n \"order\": 1,\n \"work_order_action_type_id\": 1,\n \"attachments\": [],\n \"instructions\": \"Scan the barcode on the product before kitting\",\n \"sub_actions\": []\n },\n {\n \"order\": 2,\n \"work_order_action_type_id\": 2,\n \"attachments\": [],\n \"instructions\": \"Package items according to kit specifications\",\n \"sub_actions\": [\n {\n \"order\": 1,\n \"work_order_action_type_id\": 3,\n \"attachments\": [\n {\n \"id\": \"photo-001\",\n \"name\": \"completed-kit-photo\"\n }\n ],\n \"instructions\": \"Take a photo of the completed kit\"\n }\n ]\n }\n ],\n \"end_kitted_inventory_id\": 42,\n \"fulfillment_center_id\": 1,\n \"line_items\": [\n {\n \"inventory_id\": 101,\n \"quantity\": 10\n }\n ],\n \"quantity\": 10,\n \"workorder_type\": \"Kitting\",\n \"lot_date\": \"2024-01-15T09:00:00Z\",\n \"lot_number\": \"LOT-2024-001\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Kitting_createWorkOrder_example require 'uri' require 'net/http' url = URI("https://sandbox-api.shipbob.com/Experimental/kitting:create") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"actions\": [\n {\n \"order\": 1,\n \"work_order_action_type_id\": 1,\n \"attachments\": [],\n \"instructions\": \"Scan the barcode on the product before kitting\",\n \"sub_actions\": []\n },\n {\n \"order\": 2,\n \"work_order_action_type_id\": 2,\n \"attachments\": [],\n \"instructions\": \"Package items according to kit specifications\",\n \"sub_actions\": [\n {\n \"order\": 1,\n \"work_order_action_type_id\": 3,\n \"attachments\": [\n {\n \"id\": \"photo-001\",\n \"name\": \"completed-kit-photo\"\n }\n ],\n \"instructions\": \"Take a photo of the completed kit\"\n }\n ]\n }\n ],\n \"end_kitted_inventory_id\": 42,\n \"fulfillment_center_id\": 1,\n \"line_items\": [\n {\n \"inventory_id\": 101,\n \"quantity\": 10\n }\n ],\n \"quantity\": 10,\n \"workorder_type\": \"Kitting\",\n \"lot_date\": \"2024-01-15T09:00:00Z\",\n \"lot_number\": \"LOT-2024-001\"\n}" response = http.request(request) puts response.read_body ``` ```java Kitting_createWorkOrder_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://sandbox-api.shipbob.com/Experimental/kitting:create") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"actions\": [\n {\n \"order\": 1,\n \"work_order_action_type_id\": 1,\n \"attachments\": [],\n \"instructions\": \"Scan the barcode on the product before kitting\",\n \"sub_actions\": []\n },\n {\n \"order\": 2,\n \"work_order_action_type_id\": 2,\n \"attachments\": [],\n \"instructions\": \"Package items according to kit specifications\",\n \"sub_actions\": [\n {\n \"order\": 1,\n \"work_order_action_type_id\": 3,\n \"attachments\": [\n {\n \"id\": \"photo-001\",\n \"name\": \"completed-kit-photo\"\n }\n ],\n \"instructions\": \"Take a photo of the completed kit\"\n }\n ]\n }\n ],\n \"end_kitted_inventory_id\": 42,\n \"fulfillment_center_id\": 1,\n \"line_items\": [\n {\n \"inventory_id\": 101,\n \"quantity\": 10\n }\n ],\n \"quantity\": 10,\n \"workorder_type\": \"Kitting\",\n \"lot_date\": \"2024-01-15T09:00:00Z\",\n \"lot_number\": \"LOT-2024-001\"\n}") .asString(); ``` ```php Kitting_createWorkOrder_example request('POST', 'https://sandbox-api.shipbob.com/Experimental/kitting:create', [ 'body' => '{ "actions": [ { "order": 1, "work_order_action_type_id": 1, "attachments": [], "instructions": "Scan the barcode on the product before kitting", "sub_actions": [] }, { "order": 2, "work_order_action_type_id": 2, "attachments": [], "instructions": "Package items according to kit specifications", "sub_actions": [ { "order": 1, "work_order_action_type_id": 3, "attachments": [ { "id": "photo-001", "name": "completed-kit-photo" } ], "instructions": "Take a photo of the completed kit" } ] } ], "end_kitted_inventory_id": 42, "fulfillment_center_id": 1, "line_items": [ { "inventory_id": 101, "quantity": 10 } ], "quantity": 10, "workorder_type": "Kitting", "lot_date": "2024-01-15T09:00:00Z", "lot_number": "LOT-2024-001" }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Kitting_createWorkOrder_example using RestSharp; var client = new RestClient("https://sandbox-api.shipbob.com/Experimental/kitting:create"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"actions\": [\n {\n \"order\": 1,\n \"work_order_action_type_id\": 1,\n \"attachments\": [],\n \"instructions\": \"Scan the barcode on the product before kitting\",\n \"sub_actions\": []\n },\n {\n \"order\": 2,\n \"work_order_action_type_id\": 2,\n \"attachments\": [],\n \"instructions\": \"Package items according to kit specifications\",\n \"sub_actions\": [\n {\n \"order\": 1,\n \"work_order_action_type_id\": 3,\n \"attachments\": [\n {\n \"id\": \"photo-001\",\n \"name\": \"completed-kit-photo\"\n }\n ],\n \"instructions\": \"Take a photo of the completed kit\"\n }\n ]\n }\n ],\n \"end_kitted_inventory_id\": 42,\n \"fulfillment_center_id\": 1,\n \"line_items\": [\n {\n \"inventory_id\": 101,\n \"quantity\": 10\n }\n ],\n \"quantity\": 10,\n \"workorder_type\": \"Kitting\",\n \"lot_date\": \"2024-01-15T09:00:00Z\",\n \"lot_number\": \"LOT-2024-001\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Kitting_createWorkOrder_example import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "actions": [ [ "order": 1, "work_order_action_type_id": 1, "attachments": [], "instructions": "Scan the barcode on the product before kitting", "sub_actions": [] ], [ "order": 2, "work_order_action_type_id": 2, "attachments": [], "instructions": "Package items according to kit specifications", "sub_actions": [ [ "order": 1, "work_order_action_type_id": 3, "attachments": [ [ "id": "photo-001", "name": "completed-kit-photo" ] ], "instructions": "Take a photo of the completed kit" ] ] ] ], "end_kitted_inventory_id": 42, "fulfillment_center_id": 1, "line_items": [ [ "inventory_id": 101, "quantity": 10 ] ], "quantity": 10, "workorder_type": "Kitting", "lot_date": "2024-01-15T09:00:00Z", "lot_number": "LOT-2024-001" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox-api.shipbob.com/Experimental/kitting:create")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```