Sync Order Updates With Persistence
1 min
code examples curl request put \\ \ url https //api upstartcommerce com/v1/order/{orderid}/sync order/{sequenceno} \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ header 'x upstart tenant string' \\ \ data '{ "currency" "", "distanceunit" "", "items" \[ { "catalogitem" { "id" "", "siteids" \[], "dynamicproperties" "", "hidden" false, "ignoreinventory" false, "name" "green flubber", "relatedids" \[], "shippingmethodids" \[], "type" "", "typeid" "", "typename" "speaker", "version" 0 }, "catalogitemid" "", "catalogitemtype" "", "pricing" { "baseprice" { "listprice" "", "price" "", "type" "", "zone" "" }, "feepriceadjustments" \[ { "basevalue" "", "id" "", "name" "", "quantity" "", "value" "" } ], "promotionpriceadjustments" \[ { "id" "", "value" "", "taxpriceadjustment" { "taxcode" "" } } ], "taxpriceadjustment" { "taxcode" "" } }, "productitemskuid" "", "quantity" "", "targetshipmentids" \[], "state" "" } ], "coupons" \[ { "id" "", "applied" false } ], "returnpolicyqualifications" \[ { "id" "", "name" "", "groupqualifications" \[ { "name" "", "triggeringitemids" \[], "qualifyingitemids" \[], "qualifyingsubjects" { "id" "" }, "qualificationresult" { "triggeredmessage" "" } } ] } ], "shippingcoordinates" { "latitude" "", "longitude" "" }, "shippingaddress" { "street1" "", "city" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith" } }, "billingaddress" { "street1" "", "city" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith" } }, "shipments" \[ { "state" "", "shippingmethodid" "", "addressfrom" { "street1" "", "city" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith" } }, "addressto" { "street1" "", "city" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith" } }, "shippingtodistance" { "value" 157 75, "unit" "" }, "rate" { "rateid" "", "carrierid" "", "pricing" { "shipping" "" }, "carrierdeliverydates" "", "servicetype" "", "servicecode" "", "carriercode" "" }, "packages" \[ { "dimensions" { "width" 18 5, "length" 18 5, "height" 18 5, "unit" "" }, "weight" { "value" "", "unit" "" } } ], "pricing" { "promotionpriceadjustments" \[ { "id" "", "value" "", "taxpriceadjustment" { "taxcode" "" } } ], "taxpriceadjustment" { "taxcode" "" } }, "errors" \[ { "code" "", "level" "" } ], "pickuphours" { "isopen" "", "day" "" } } ], "pricing" { "promotionpriceadjustments" \[ { "id" "", "value" 200, "itemids" \[], "taxpriceadjustment" { "taxcode" "" } } ] }, "payments" \[ { "exec" "", "state" "" } ], "tax" { "state" "" } }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); myheaders append("x upstart tenant", "string"); var raw = json stringify({ "currency" "", "distanceunit" "", "items" \[ { "catalogitem" { "id" "", "siteids" \[], "dynamicproperties" "", "hidden" false, "ignoreinventory" false, "name" "green flubber", "relatedids" \[], "shippingmethodids" \[], "type" "", "typeid" "", "typename" "speaker", "version" 0 }, "catalogitemid" "", "catalogitemtype" "", "pricing" { "baseprice" { "listprice" "", "price" "", "type" "", "zone" "" }, "feepriceadjustments" \[ { "basevalue" "", "id" "", "name" "", "quantity" "", "value" "" } ], "promotionpriceadjustments" \[ { "id" "", "value" "", "taxpriceadjustment" { "taxcode" "" } } ], "taxpriceadjustment" { "taxcode" "" } }, "productitemskuid" "", "quantity" "", "targetshipmentids" \[], "state" "" } ], "coupons" \[ { "id" "", "applied" false } ], "returnpolicyqualifications" \[ { "id" "", "name" "", "groupqualifications" \[ { "name" "", "triggeringitemids" \[], "qualifyingitemids" \[], "qualifyingsubjects" { "id" "" }, "qualificationresult" { "triggeredmessage" "" } } ] } ], "shippingcoordinates" { "latitude" "", "longitude" "" }, "shippingaddress" { "street1" "", "city" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith" } }, "billingaddress" { "street1" "", "city" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith" } }, "shipments" \[ { "state" "", "shippingmethodid" "", "addressfrom" { "street1" "", "city" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith" } }, "addressto" { "street1" "", "city" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith" } }, "shippingtodistance" { "value" 157 75, "unit" "" }, "rate" { "rateid" "", "carrierid" "", "pricing" { "shipping" "" }, "carrierdeliverydates" "", "servicetype" "", "servicecode" "", "carriercode" "" }, "packages" \[ { "dimensions" { "width" 18 5, "length" 18 5, "height" 18 5, "unit" "" }, "weight" { "value" "", "unit" "" } } ], "pricing" { "promotionpriceadjustments" \[ { "id" "", "value" "", "taxpriceadjustment" { "taxcode" "" } } ], "taxpriceadjustment" { "taxcode" "" } }, "errors" \[ { "code" "", "level" "" } ], "pickuphours" { "isopen" "", "day" "" } } ], "pricing" { "promotionpriceadjustments" \[ { "id" "", "value" 200, "itemids" \[], "taxpriceadjustment" { "taxcode" "" } } ] }, "payments" \[ { "exec" "", "state" "" } ], "tax" { "state" "" } }); var requestoptions = { method 'put', headers myheaders, body raw, redirect 'follow' }; fetch("https //api upstartcommerce com/v1/order/{orderid}/sync order/{sequenceno}", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //api upstartcommerce com/v1/order/{orderid}/sync order/{sequenceno}") https = net http new(url host, url port) https use ssl = true request = net http put new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request\["x upstart tenant"] = "string" request body = json dump({ "currency" "", "distanceunit" "", "items" \[ { "catalogitem" { "id" "", "siteids" \[], "dynamicproperties" "", "hidden" false, "ignoreinventory" false, "name" "green flubber", "relatedids" \[], "shippingmethodids" \[], "type" "", "typeid" "", "typename" "speaker", "version" 0 }, "catalogitemid" "", "catalogitemtype" "", "pricing" { "baseprice" { "listprice" "", "price" "", "type" "", "zone" "" }, "feepriceadjustments" \[ { "basevalue" "", "id" "", "name" "", "quantity" "", "value" "" } ], "promotionpriceadjustments" \[ { "id" "", "value" "", "taxpriceadjustment" { "taxcode" "" } } ], "taxpriceadjustment" { "taxcode" "" } }, "productitemskuid" "", "quantity" "", "targetshipmentids" \[], "state" "" } ], "coupons" \[ { "id" "", "applied" false } ], "returnpolicyqualifications" \[ { "id" "", "name" "", "groupqualifications" \[ { "name" "", "triggeringitemids" \[], "qualifyingitemids" \[], "qualifyingsubjects" { "id" "" }, "qualificationresult" { "triggeredmessage" "" } } ] } ], "shippingcoordinates" { "latitude" "", "longitude" "" }, "shippingaddress" { "street1" "", "city" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith" } }, "billingaddress" { "street1" "", "city" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith" } }, "shipments" \[ { "state" "", "shippingmethodid" "", "addressfrom" { "street1" "", "city" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith" } }, "addressto" { "street1" "", "city" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith" } }, "shippingtodistance" { "value" 157 75, "unit" "" }, "rate" { "rateid" "", "carrierid" "", "pricing" { "shipping" "" }, "carrierdeliverydates" "", "servicetype" "", "servicecode" "", "carriercode" "" }, "packages" \[ { "dimensions" { "width" 18 5, "length" 18 5, "height" 18 5, "unit" "" }, "weight" { "value" "", "unit" "" } } ], "pricing" { "promotionpriceadjustments" \[ { "id" "", "value" "", "taxpriceadjustment" { "taxcode" "" } } ], "taxpriceadjustment" { "taxcode" "" } }, "errors" \[ { "code" "", "level" "" } ], "pickuphours" { "isopen" "", "day" "" } } ], "pricing" { "promotionpriceadjustments" \[ { "id" "", "value" 200, "itemids" \[], "taxpriceadjustment" { "taxcode" "" } } ] }, "payments" \[ { "exec" "", "state" "" } ], "tax" { "state" "" } }) response = https request(request) puts response read body import requests import json url = "https //api upstartcommerce com/v1/order/{orderid}/sync order/{sequenceno}" payload = json dumps({ "currency" "", "distanceunit" "", "items" \[ { "catalogitem" { "id" "", "siteids" \[], "dynamicproperties" "", "hidden" false, "ignoreinventory" false, "name" "green flubber", "relatedids" \[], "shippingmethodids" \[], "type" "", "typeid" "", "typename" "speaker", "version" 0 }, "catalogitemid" "", "catalogitemtype" "", "pricing" { "baseprice" { "listprice" "", "price" "", "type" "", "zone" "" }, "feepriceadjustments" \[ { "basevalue" "", "id" "", "name" "", "quantity" "", "value" "" } ], "promotionpriceadjustments" \[ { "id" "", "value" "", "taxpriceadjustment" { "taxcode" "" } } ], "taxpriceadjustment" { "taxcode" "" } }, "productitemskuid" "", "quantity" "", "targetshipmentids" \[], "state" "" } ], "coupons" \[ { "id" "", "applied" false } ], "returnpolicyqualifications" \[ { "id" "", "name" "", "groupqualifications" \[ { "name" "", "triggeringitemids" \[], "qualifyingitemids" \[], "qualifyingsubjects" { "id" "" }, "qualificationresult" { "triggeredmessage" "" } } ] } ], "shippingcoordinates" { "latitude" "", "longitude" "" }, "shippingaddress" { "street1" "", "city" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith" } }, "billingaddress" { "street1" "", "city" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith" } }, "shipments" \[ { "state" "", "shippingmethodid" "", "addressfrom" { "street1" "", "city" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith" } }, "addressto" { "street1" "", "city" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith" } }, "shippingtodistance" { "value" 157 75, "unit" "" }, "rate" { "rateid" "", "carrierid" "", "pricing" { "shipping" "" }, "carrierdeliverydates" "", "servicetype" "", "servicecode" "", "carriercode" "" }, "packages" \[ { "dimensions" { "width" 18 5, "length" 18 5, "height" 18 5, "unit" "" }, "weight" { "value" "", "unit" "" } } ], "pricing" { "promotionpriceadjustments" \[ { "id" "", "value" "", "taxpriceadjustment" { "taxcode" "" } } ], "taxpriceadjustment" { "taxcode" "" } }, "errors" \[ { "code" "", "level" "" } ], "pickuphours" { "isopen" "", "day" "" } } ], "pricing" { "promotionpriceadjustments" \[ { "id" "", "value" 200, "itemids" \[], "taxpriceadjustment" { "taxcode" "" } } ] }, "payments" \[ { "exec" "", "state" "" } ], "tax" { "state" "" } }) headers = { 'accept' 'application/json', 'content type' 'application/json', 'x upstart tenant' 'string' } response = requests request("put", url, headers=headers, data=payload) print(response text) responses // success order updated in persistence successfully { "id" "", "siteids" \[ "" ], "customerid" "", "anonymous" false, "state" "", "currency" "", "distanceunit" "", "items" \[ { "catalogitem" { "id" "", "siteids" \[ "" ], "activationdate" "", "archived" false, "avgrating" 4 62, "avggrouprating" "", "numgroupreviews" 0, "productpopularity" "", "excludesclearanceitems" false, "brandname" "bob's best toy line", "deactivationdate" "", "dynamicproperties" {}, "hidden" false, "ignoreinventory" false, "livedate" "", "manufacturername" "bob's chemical company ", "media" "", "modifieddate" "", "name" "green flubber", "numreviews" 17, "offeredstandardwarranty" {}, "servicequalification" { "eligibleproductids" \[ "" ], "eligibleshippingmethodids" \[ "" ] }, "productitems" \[ "" ], "relatedids" \[ "" ], "seo" { "pagetitle" "", "description" "", "metakeywords" \[ "" ] }, "shippingmethodids" \[ "" ], "subversion" 0, "tags" \[ "" ], "taxcode" "p0000000", "type" "", "typeid" "", "typename" "speaker", "version" 5 }, "catalogitemid" "", "catalogitemtype" "", "id" "", "pricing" { "baseprice" { "listprice" 0, "price" 0, "type" "", "zone" "" }, "feepriceadjustments" \[ { "basevalue" 0, "description" "", "id" "", "name" "", "quantity" "", "value" 0 } ], "promotionpriceadjustments" \[ { "description" "", "name" "", "id" "", "value" 0, "taxpriceadjustment" { "taxcode" "", "value" 0 } } ], "taxpriceadjustment" { "taxcode" "", "value" 0 } }, "productitemskuid" "", "promotionid" "", "quantity" "", "shipmentid" "", "quoteid" 0, "targetitemids" \[ "" ], "targetshipmentids" \[ "" ], "state" "" } ], "locationid" "", "timezoneoffset" "", "haulawayrequested" 0, "coupons" \[ { "id" "", "applied" false, "applystatus" "", "promotionid" "" } ], "returnpolicyqualifications" \[ { "id" "", "name" "", "groupqualifications" \[ { "name" "", "triggeringitemids" \[ "" ], "qualifyingitemids" \[ "" ], "qualifyingsubjects" {}, "qualificationresult" {} } ] } ], "shippingcoordinates" { "latitude" 0, "longitude" 0 }, "shippingaddress" { "street1" "", "street2" "", "city" "", "county" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith", "middleinitial" "d ", "salutation" "capt ", "suffix" "sr " }, "businessname" "", "phonenumber" "" }, "billingaddress" { "street1" "", "street2" "", "city" "", "county" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith", "middleinitial" "d ", "salutation" "capt ", "suffix" "sr " }, "businessname" "", "phonenumber" "" }, "shipments" \[ { "id" "", "state" "", "shippingmethodid" "", "shippingmethodname" "", "trackingnumber" "", "trackingurl" "https //www fedex com/apps/fedextrack/?action=track\&trackingnumber=391274234820\&cntry code=us\&locale=en us", "labeldownload" "", "addressfrom" { "street1" "", "street2" "", "city" "", "county" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith", "middleinitial" "d ", "salutation" "capt ", "suffix" "sr " }, "businessname" "", "phonenumber" "" }, "locationfromid" "", "addressto" { "street1" "", "street2" "", "city" "", "county" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith", "middleinitial" "d ", "salutation" "capt ", "suffix" "sr " }, "businessname" "", "phonenumber" "" }, "locationtoid" "", "shippingtodistance" { "value" 157 75, "unit" "" }, "rate" { "rateid" "", "carrierid" "", "pricing" { "shipping" 0, "insurance" 0, "confirmation" 0, "other" 0, "fee" 0 }, "packagetype" "", "deliverydays" "", "estimateddeliverydate" "", "carrierdeliverydates" "", "shipdate" "", "servicetype" "", "servicecode" "", "carriercode" "" }, "packages" \[ { "dimensions" { "width" 18 5, "length" 18 5, "height" 18 5, "unit" "" }, "insuredvalue" 0, "packagecode" "", "weight" { "value" "", "unit" "" }, "trackingnumber" "" } ], "pricing" { "baseprice" 0, "promotionpriceadjustments" \[ { "description" "", "name" "", "id" "", "value" 0, "taxpriceadjustment" { "taxcode" "", "value" 0 } } ], "taxpriceadjustment" { "taxcode" "", "value" 0 } }, "delivereddate" "", "errors" \[ { "code" "", "detail" "", "level" "", "message" "" } ], "pickuphours" {} } ], "pricing" { "promotionpriceadjustments" \[ { "id" "", "name" "", "value" 200, "description" "buy 1 flubber get 10 free", "itemids" \[ "e9a22ea5 253e 4764 8238 48aaefe2e1d3" ], "taxpriceadjustment" { "taxcode" "", "value" 0 } } ], "totalfee" 0, "totalitemorderpromotion" 0, "totalitemsbaseprice" 0, "totalitemsprice" 0, "totalpretaxprice" 0, "totalprice" 0, "totalpromotion" 0, "totalshippingbaseprice" 0, "totalshippingprice" 0, "totalshippingpromotion" 0, "totaltax" 0 }, "payments" \[ { "exec" {}, "id" "", "processeddate" "", "refundeddate" "", "state" "", "transactionid" "", "value" 0 } ], "tax" { "processeddate" "", "refundeddate" "", "state" "", "transactioncode" "" }, "email" "", "orderdate" "", "modifieddate" "", "closeoutdate" "", "internalinvoiceid" "", "timezoneid" "" }// the request contained information that the server was unable to process appropriate errors are provided in the response body { "name" "", "code" "", "detail" "" }// the provided credentials were not valid for this endpoint it may be that they are expired or that the user's roles are insufficient { "name" "", "code" "", "detail" "", "reason" "" }// the requested resource was not found in the nochannel system { "name" "", "code" "", "detail" "", "reason" "" }