Fetch Consumer Cart
1 min
code examples curl request get \\ \ url https //api upstartcommerce com/v1/cart/{customerid}/cart \\ \ header 'accept application/json' \\ \ header 'x upstart tenant string' \\ \ header 'x upstart site string'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); myheaders append("x upstart tenant", "string"); myheaders append("x upstart site", "string"); var requestoptions = { method 'get', headers myheaders, redirect 'follow' }; fetch("https //api upstartcommerce com/v1/cart/{customerid}/cart", 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/cart/{customerid}/cart") https = net http new(url host, url port) https use ssl = true request = net http get new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request\["x upstart tenant"] = "string" request\["x upstart site"] = "string" response = https request(request) puts response read body import requests import json url = "https //api upstartcommerce com/v1/cart/{customerid}/cart" payload = {} headers = { 'accept' 'application/json', 'content type' 'application/json', 'x upstart tenant' 'string', 'x upstart site' 'string' } response = requests request("get", url, headers=headers, data=payload) print(response text) responses // success consumer's active cart found and returned { "id" "5b3b51df 5ae2 4ed0 a1be 3332b48745f2", "siteids" \[ "" ], "customerid" "ba5030a9 ae17 45e3 8ca7 713bb832523c", "anonymous" false, "state" "paid", "currency" "usd", "distanceunit" "", "items" \[ { "id" "", "catalogitemid" "", "productitemskuid" "", "catalogitemtype" "", "quantity" "", "pricing" { "baseprice" { "type" "", "zone" "", "price" 1599 99, "listprice" 1999 99 }, "promotionpriceadjustments" \[ { "id" "e9a22ea5 253e 4764 8238 48aaefe2e1d3", "value" 0, "name" "", "description" "buy 1 flubber get 10 free", "taxpriceadjustment" { "taxcode" "", "value" 0 } } ], "feepriceadjustments" \[ { "name" "", "quantity" "", "basevalue" 0, "description" "", "value" 0, "taxable" false } ], "taxpriceadjustment" { "taxcode" "", "value" 0 } }, "catalogitem" { "id" "", "siteids" \[ "" ], "typeid" "fa1f5dc8 e4fb 415f bdd8 8e6f0ad43318", "type" "", "typename" "speaker", "name" "green flubber", "brandname" "bob's best toy line", "manufacturername" "bob's chemical company ", "media" "", "tags" \[ "" ], "dynamicproperties" {}, "productitems" {}, "offeredwarrantyid" "", "offeredprotectionplantype" {}, "offeredstandardwarranty" {}, "servicequalification" { "eligibleproductids" \[ "" ], "eligibleshippingmethodids" \[ "" ] }, "excludesclearanceitems" false, "relatedids" \[ "" ], "shippingmethodids" \[ "" ], "activationdate" "", "deactivationdate" "", "taxcode" "p0000000", "ignoreinventory" false, "hidden" false, "avgrating" 4 62, "numreviews" 17, "avggrouprating" "", "numgroupreviews" "", "version" 5, "subversion" "", "seo" { "pagetitle" "", "description" "", "metakeywords" \[ "" ] }, "livedate" "", "modifieddate" "", "archived" false, "productpopularity" "" }, "shipmentid" "", "promotionid" "", "targetitemids" \[ "" ], "targetshipmentids" \[ "" ], "invalid" false, "errors" \[ { "level" "", "code" "", "message" "", "detail" "" } ], "quoteid" "", "availablequantity" "", "isleaseable" false, "category" "" } ], "locationid" "loc 456", "postalcode" "03101", "stateorregion" "wa", "country" "us", "haulawayrequested" "", "haulawayallowed" "", "coupons" \[ { "id" "", "applied" false, "applystatus" "", "promotionid" "" } ], "returnpolicyqualifications" \[ { "id" "", "name" "", "groupqualifications" \[ { "name" "", "triggeringitemids" \[ "" ], "qualifyingitemids" \[ "" ], "qualifyingsubjects" {}, "qualificationresult" {} } ] } ], "shippingcoordinates" { "latitude" "", "longitude" "" }, "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" "a9ca1b7e 7bde 4285 937e b81a38deaeec", "shippingmethodid" "537ed6df 9de2 47de 8c0c a47022b6f940", "shippingmethodname" "fedex", "instorepickup" false, "trackingnumber" "tz54235423nsf42334", "addressfrom" { "street1" "", "street2" "", "city" "", "county" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith", "middleinitial" "d ", "salutation" "capt ", "suffix" "sr " }, "businessname" "", "phonenumber" "" }, "locationfromid" "wrhse 23425", "addressto" { "street1" "", "street2" "", "city" "", "county" "", "stateorregion" "", "country" "", "postalcode" "", "pobox" false, "name" { "first" "john", "last" "smith", "middleinitial" "d ", "salutation" "capt ", "suffix" "sr " }, "businessname" "", "phonenumber" "" }, "locationtoid" "store 14678", "shippingtodistance" { "value" 157 75, "unit" "" }, "rateservicecode" "fedex overnight", "ratevariants" \[ { "rateid" "ups abcdef", "carrierid" "se 12345", "pricing" { "shipping" 0, "insurance" 0, "confirmation" 0, "other" 0, "fee" 0 }, "packagetype" "fixed rate priority envelope", "deliverydays" 4, "estimateddeliverydate" "2019 09 23t00 00 00z", "carrierdeliverydates" "2 business days", "shipdate" "", "servicetype" "$5587z76", "servicecode" "next day", "carriercode" "fixed rate priority" } ], "packages" \[ { "packagecode" "flat rate padded envelope", "weight" { "value" "", "unit" "" }, "dimensions" { "width" 18 5, "length" 18 5, "height" 18 5, "unit" "" }, "insuredvalue" 0 } ], "pricing" { "baseprice" 199 99, "promotionpriceadjustments" \[ { "id" "e9a22ea5 253e 4764 8238 48aaefe2e1d3", "value" 0, "name" "", "description" "buy 1 flubber get 10 free", "taxpriceadjustment" { "taxcode" "", "value" 0 } } ], "taxpriceadjustment" { "taxcode" "", "value" 0 } }, "invalid" false, "metadata" {}, "errors" \[ { "level" "", "code" "", "message" "", "detail" "" } ] } ], "pricing" { "promotionpriceadjustments" \[ { "id" "", "value" 0, "name" "", "description" "buy 1 flubber get 10 free", "itemids" \[ "e9a22ea5 253e 4764 8238 48aaefe2e1d3" ], "taxpriceadjustment" { "taxcode" "", "value" 0 } } ], "totalitemsprice" 1799 99, "totalitemsbaseprice" 1999 99, "totalwarrantyitemsprice" 1999 99, "totalwarrantyitemsbaseprice" 1999 99, "totalshippingprice" 150, "totalshippingbaseprice" 150, "totalfee" 29 54, "totaltax" 29 23, "totalshippingpromotion" 0, "totalcartpromotion" 0, "totalitemcartpromotion" 0, "totalpromotion" 0, "totalprice" 2012 48, "totalpretaxprice" 1829 53 }, "payments" \[ { "exec" {}, "id" "", "state" "", "transactionid" "469512", "value" 1500 } ], "tax" { "transactioncode" "", "processeddate" "2021 12 01t00 00 00z", "entityusecode" "", "state" "" }, "email" "example\@example com", "errors" \[ { "transactionid" "", "level" "", "code" "", "message" "", "detail" "" } ], "timezoneid" "america/denver", "modifieddate" "2021 06 04t05 55 27 067z", "publicdealerid" "your pdi" }// 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" "" }