# Modify a single product PUT https://api.shipbob.com/1.0/product/{productId} Content-Type: application/json Reference: https://developer.shipbob.com/v1.0/api/products/modify-a-single-product ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: | Modify a single product version: endpoint_products.modifyASingleProduct paths: /1.0/product/{productId}: put: operationId: modify-a-single-product summary: | Modify a single product tags: - - subpackage_products parameters: - name: productId in: path description: Unique identifier of the product to modify required: true schema: type: string format: int32 - name: Authorization in: header description: Authentication using Personal Access Token (PAT) token required: true schema: type: string - name: shipbob_channel_id in: header description: Channel Id for Operation required: true schema: type: string format: int32 responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/Products.ProductViewModel' '400': description: Bad Request content: {} '401': description: No access right at this time content: {} '403': description: No access content: {} '404': description: Not Found content: {} '422': description: Client Error content: {} requestBody: description: Updated fields to the product content: application/json: schema: $ref: '#/components/schemas/Products.UpdateProductModel' components: schemas: Products.UpdateProductModel: type: object properties: barcode: type: - string - 'null' description: Barcode for the product gtin: type: - string - 'null' description: >- Global Trade Item Number - unique and internationally recognized identifier assigned to item by company GS1. name: type: string description: The name of the product sku: type: - string - 'null' description: The stock keeping unit of the product unit_price: type: - number - 'null' format: double description: The price of one unit upc: type: - string - 'null' description: Universal Product Code - Unique external identifier required: - name Products.BundleRootInformationViewModel: type: object properties: id: type: integer description: Id of the bundle root product name: type: - string - 'null' description: Name of the bundle root product Products.ChannelViewModel: type: object properties: id: type: integer description: Unique id of the store channel name: type: - string - 'null' description: Name of the store channel Products.InventoryItemViewModel: type: object properties: id: type: integer description: Unique id of the inventory item name: type: - string - 'null' description: Name of the inventory item quantity: type: integer description: Quantity of the inventory item included in a store product Products.FulfillmentCenterQuantityViewModel: type: object properties: committed_quantity: type: integer description: Amount of committed quantity at this fulfillment center fulfillable_quantity: type: integer description: Amount of fulfillable quantity at this fulfillment center id: type: integer description: Unique id of the fulfillment center name: type: - string - 'null' description: Name of the fulfillment center onhand_quantity: type: integer description: Amount of onhand quantity at this fulfillment center Products.ProductViewModel: type: object properties: barcode: type: - string - 'null' description: Barcode for the product bundle_root_information: $ref: '#/components/schemas/Products.BundleRootInformationViewModel' channel: $ref: '#/components/schemas/Products.ChannelViewModel' created_date: type: string format: date-time description: Date the product was created fulfillable_inventory_items: type: - array - 'null' items: $ref: '#/components/schemas/Products.InventoryItemViewModel' description: >- The inventory that this product will resolve to when packing a shipment fulfillable_quantity_by_fulfillment_center: type: - array - 'null' items: $ref: '#/components/schemas/Products.FulfillmentCenterQuantityViewModel' description: >- Fulfillable quantity of this product broken down by fulfillment center location gtin: type: - string - 'null' description: >- Global Trade Item Number - unique and internationally recognized identifier assigned to item by company GS1. id: type: integer description: Unique identifier of the product name: type: - string - 'null' description: The name of the product reference_id: type: - string - 'null' description: Unique reference identifier of the product sku: type: - string - 'null' description: Stock keeping unit for the product total_committed_quantity: type: integer description: Total committed quantity of this product total_fulfillable_quantity: type: integer description: Total fulfillable quantity of this product total_onhand_quantity: type: integer description: Total on hand quantity of this product unit_price: type: - number - 'null' format: double description: The price of one unit upc: type: - string - 'null' description: Universal Product Code - Unique external identifier ``` ## SDK Code Examples ```python Products_modifyASingleProduct_example import requests url = "https://api.shipbob.com/1.0/product/productId" payload = { "name": "Medium Blue T-Shirt", "barcode": "123456789012", "gtin": "012345678905", "sku": "TShirtBlueM", "unit_price": 20.32, "upc": "012345678912" } headers = { "shipbob_channel_id": "shipbob_channel_id", "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Products_modifyASingleProduct_example const url = 'https://api.shipbob.com/1.0/product/productId'; const options = { method: 'PUT', headers: { shipbob_channel_id: 'shipbob_channel_id', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"name":"Medium Blue T-Shirt","barcode":"123456789012","gtin":"012345678905","sku":"TShirtBlueM","unit_price":20.32,"upc":"012345678912"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Products_modifyASingleProduct_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.shipbob.com/1.0/product/productId" payload := strings.NewReader("{\n \"name\": \"Medium Blue T-Shirt\",\n \"barcode\": \"123456789012\",\n \"gtin\": \"012345678905\",\n \"sku\": \"TShirtBlueM\",\n \"unit_price\": 20.32,\n \"upc\": \"012345678912\"\n}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("shipbob_channel_id", "shipbob_channel_id") 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 Products_modifyASingleProduct_example require 'uri' require 'net/http' url = URI("https://api.shipbob.com/1.0/product/productId") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["shipbob_channel_id"] = 'shipbob_channel_id' request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"name\": \"Medium Blue T-Shirt\",\n \"barcode\": \"123456789012\",\n \"gtin\": \"012345678905\",\n \"sku\": \"TShirtBlueM\",\n \"unit_price\": 20.32,\n \"upc\": \"012345678912\"\n}" response = http.request(request) puts response.read_body ``` ```java Products_modifyASingleProduct_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.put("https://api.shipbob.com/1.0/product/productId") .header("shipbob_channel_id", "shipbob_channel_id") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"name\": \"Medium Blue T-Shirt\",\n \"barcode\": \"123456789012\",\n \"gtin\": \"012345678905\",\n \"sku\": \"TShirtBlueM\",\n \"unit_price\": 20.32,\n \"upc\": \"012345678912\"\n}") .asString(); ``` ```php Products_modifyASingleProduct_example request('PUT', 'https://api.shipbob.com/1.0/product/productId', [ 'body' => '{ "name": "Medium Blue T-Shirt", "barcode": "123456789012", "gtin": "012345678905", "sku": "TShirtBlueM", "unit_price": 20.32, "upc": "012345678912" }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', 'shipbob_channel_id' => 'shipbob_channel_id', ], ]); echo $response->getBody(); ``` ```csharp Products_modifyASingleProduct_example using RestSharp; var client = new RestClient("https://api.shipbob.com/1.0/product/productId"); var request = new RestRequest(Method.PUT); request.AddHeader("shipbob_channel_id", "shipbob_channel_id"); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"name\": \"Medium Blue T-Shirt\",\n \"barcode\": \"123456789012\",\n \"gtin\": \"012345678905\",\n \"sku\": \"TShirtBlueM\",\n \"unit_price\": 20.32,\n \"upc\": \"012345678912\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Products_modifyASingleProduct_example import Foundation let headers = [ "shipbob_channel_id": "shipbob_channel_id", "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "name": "Medium Blue T-Shirt", "barcode": "123456789012", "gtin": "012345678905", "sku": "TShirtBlueM", "unit_price": 20.32, "upc": "012345678912" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.shipbob.com/1.0/product/productId")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PUT" 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() ```