Inventory API
Shippings
Update Shipping
this api endpoint (post) (post) updates an existing shipping method if the request succeeds it returns a shipping object docid 5za enkucyxmck0padqau permissions shippings edit webhook event shipping events docid\ now4znvtojwapfhlwflaj path parameters id the id of the shipping body parameters label string the label of the shipping method currency string appendix docid\ kfbmx4q3dxjtduqf75yx1 the currency of the shipping method destination array of strings appendix docid\ kfbmx4q3dxjtduqf75yx1 the countries served by this shipping method price integer the cost of shipments per unit active boolean this attribute shows whether the shipping method is enabled postcodes array of strings an array of postcodes to use for filtering when customers attempt to make an order states array of strings an array of states to use for filtering when customers attempt to make an order bundling rules array of objects an array of objects, each corresponding to a bundling rule "bundling rules" \[ { "cost rule" "unit", "type" "range", "max" 100, "cost" 100, "from" 1, "to" 5 }, { "cost rule" "fixed", "type" "max", "max" 5, "cost" 80 } ] cost integer the base shipping cost to apply for this bundling rule cost rule string this attribute shows how the shipping cost for this bundling rule will be charged the possible values are unit (cost quantity) and fixed type string the possible values are range and max if set to max , the bundling rule will be activated on orders whose total quantity is more than the maximum (max) for range , the rule will be activated if the order quantity is between the configured range values (from and to) max integer orders with quantity larger than this value will activate the bundling rule provided if the type is set to max from integer the starting value of the bundling range provided if the rule type is set to range to integer the end value of the bundling range provided if the rule type is set to range require "uri" require "json" require "net/http" url = uri("https //api tamio com/v2/shippings/update/c8006b68 6619 4b3f 844c 7025ffaa5b3b") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["authorization"] = "bearer your token here" data = { label "new shipping method", currency "eur", destination \[ "worldwide" ], price 1200, bundling rules \[ { cost rule "unit", type "range", max 100, cost 100, from 1, to 5 }, { cost rule "fixed", type "max", max 5, cost 80 } ], active true } request body = data to json response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/shippings/update/c8006b68 6619 4b3f 844c 7025ffaa5b3b' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here' \\ \ data raw '{"label" "new shipping method", "currency" "eur", "destination" \["worldwide"], "sites" \[], "price" 1200, "bundling rules" \[{"cost rule" "unit", "type" "range", "max" 100, "cost" 100, "from" 1, "to" 5}, {"cost rule" "fixed", "type" "max", "max" 5, "cost" 80}], "states" \[], "postcodes" \[], "active"\ true}'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("authorization", "bearer your token here"); var data = { label "new shipping method", currency "eur", destination \[ "worldwide" ], price 1200, bundling rules \[ { cost rule "unit", type "range", max 100, cost 100, from 1, to 5 }, { cost rule "fixed", type "max", max 5, cost 80 } ], active true }; var body = json stringify(data); var requestoptions = { method 'post', headers myheaders, body body }; fetch("https //api tamio com/v2/shippings/update/c8006b68 6619 4b3f 844c 7025ffaa5b3b", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "status" 200, "shipping" { "object" "shipping", "id" "c8006b68 6619 4b3f 844c 7025ffaa5b3b", "label" "new shipping method", "currency" "eur", "destination" \[ "worldwide" ], "price" 1200, "has bundling" true, "postcodes" \[], "states" \[], "sites" \[], "active" true, "bundling rules" \[ { "cost rule" "unit", "type" "range", "max" 100, "cost" 100, "from" 1, "to" 5 }, { "cost rule" "fixed", "type" "max", "max" 5, "cost" 80 } ] } }