天天看点

SAP Spartacus取cart的HTTP请求

Spartacus标准开发

专栏收录该内容

880 篇文章4 订阅

订阅专栏

取cart的url:

https://spartacus-dev0.eastus.cloudapp.azure.com:9002/occ/v2/electronics-spa/users/anonymous/carts/43b901b0-0f02-43f4-add2-24b79a6ec1a8?fields=DEFAULT,potentialProductPromotions,appliedProductPromotions,potentialOrderPromotions,appliedOrderPromotions,entries(totalPrice(formattedValue),product(images(FULL),stock(FULL)),basePrice(formattedValue,value),updateable),totalPrice(formattedValue),totalItems,totalPriceWithTax(formattedValue),totalDiscounts(value,formattedValue),subTotal(formattedValue),deliveryItemsQuantity,deliveryCost(formattedValue),totalTax(formattedValue,%20value),pickupItemsQuantity,net,appliedVouchers,productDiscounts(formattedValue),u

ser&lang=en&curr=USD

SAP Spartacus取cart的HTTP请求

{

  "type" : "cartWsDTO",

  "appliedOrderPromotions" : [ {

     "consumedEntries" : [ ],

     "description" : "Buy over $200.00 get $20.00 discount on cart",

     "promotion" : {

        "code" : "order_threshold_fixed_discount_main",

        "promotionType" : "Rule Based Promotion"

     }

  } ],

  "appliedProductPromotions" : [ ],

  "appliedVouchers" : [ ],

  "code" : "00006714",

  "deliveryItemsQuantity" : 3,

  "entries" : [ {

     "basePrice" : {

        "formattedValue" : "$485.57",

        "value" : 485.57

     },

     "cancellableQuantity" : 0,

     "configurationInfos" : [ ],

     "entryNumber" : 0,

     "product" : {

        "availableForPickup" : true,

        "averageRating" : 4.411764705882353,

        "baseOptions" : [ ],

        "categories" : [ {

           "code" : "576",

           "name" : "Digital Compacts"

        }, {

           "code" : "brand_5",

           "name" : "Sony"

        } ],

        "code" : "358639",

        "configurable" : false,

        "images" : [ {

           "altText" : "DSC-N1",

           "format" : "zoom",

           "imageType" : "PRIMARY",

           "url" : "/medias/?context=bWFzdGVyfGltYWdlc3wyNjE4MXxpbWFnZS9qcGVnfGltYWdlcy9oZWIvaDAzLzg3OTcyNTQ2ODA2MDYuanBnfDhlZjVlY2YxNGU0NTRmOTQ3OWZmNjYzMDBkYWE0Y2E4YmZiOWY1MzM1YjY5NmVlNjg3YWVmYzlmMmYyNWFkYzY"

           "format" : "product",

           "url" : "/medias/?context=bWFzdGVyfGltYWdlc3wxMjA3OHxpbWFnZS9qcGVnfGltYWdlcy9oMjkvaDhmLzg3OTcyODA5NjA1NDIuanBnfDg2MDdiZTc1MGJiMDE5NjhjODM3YzM3MmVkZWMzNTZkN2NkYWViN2ZiYTM3NmYxZWM2Nzc3MGY3ZDc4YTlmMDg"

           "format" : "thumbnail",

           "url" : "/medias/?context=bWFzdGVyfGltYWdlc3wyNDAxfGltYWdlL2pwZWd8aW1hZ2VzL2g3Yi9oNzIvODc5NzMwNzMwNjAxNC5qcGd8MDZhMTdjZmY1Y2Q1NjRiMWJhMGFkZmMyM2VkMjJmNDUzYmMyODc5NmM1OWJjMDBkMTlhZWYwZTJkMmNlZTM3OQ"

           "format" : "cartIcon",

           "url" : "/medias/?context=bWFzdGVyfGltYWdlc3wxNDYyfGltYWdlL2pwZWd8aW1hZ2VzL2g5OS9oZDEvODc5NzMzMzY1MTQ4Ni5qcGd8NDE2MTk1ZDM1NzkzMGZhZjU1NDkxZjQ1MGEwNzQxMzE0OTEzZWIwMWU5NTRlZjQzZGVhODcxYjgyMDdlY2NiNg"

        "manufacturer" : "Sony",

        "name" : "DSC-N1",

        "purchasable" : true,

        "stock" : {

           "isValueRounded" : false,

           "stockLevel" : 285,

           "stockLevelStatus" : "inStock"

        },

        "url" : "/Open-Catalogue/Cameras/Digital-Cameras/Digital-Compacts/DSC-N1/p/358639"

     "quantity" : 2,

     "returnableQuantity" : 0,

     "statusSummaryList" : [ ],

     "totalPrice" : {

        "currencyIso" : "USD",

        "formattedValue" : "$971.14",

        "value" : 971.14

     "updateable" : true

  }, {

        "formattedValue" : "$114.12",

        "value" : 114.12

     "entryNumber" : 1,

        "averageRating" : 4.5,

           "code" : "brand_1",

           "name" : "HP"

        "code" : "300938",

           "altText" : "Photosmart E317 Digital Camera",

           "url" : "/medias/?context=bWFzdGVyfGltYWdlc3wxMzkzNnxpbWFnZS9qcGVnfGltYWdlcy9oMjYvaDdhLzg3OTcyNTE0NjkzNDIuanBnfGU3N2FlYWQ1YmQ1ODhjZjZiNTFjNDg3NDdjNGRkNjM5NGQzMjZmZWVmNjc3ZWQwMjgzY2MyNDJlNzYyNTczM2Q"

           "url" : "/medias/?context=bWFzdGVyfGltYWdlc3w3MDg1fGltYWdlL2pwZWd8aW1hZ2VzL2g2Ni9oOWQvODc5NzI3Nzc0OTI3OC5qcGd8NzdjOTNiMThkODQ4NTM4NmQ2NjMxMGMwYmMyOTIwODIwMzI4NTgyMGUxNDc4Y2I0OTRkOGViODNlNDZiYTJhNw"

           "url" : "/medias/?context=bWFzdGVyfGltYWdlc3wyMDYxfGltYWdlL2pwZWd8aW1hZ2VzL2g3ZS9oZmEvODc5NzMwNDA5NDc1MC5qcGd8OGZjMTNjM2JmMGY0MmYyMWY3OGM5YjQ4YjAyNzM4NjkxYjUyMmQzMDBhMmMzMjMwZThmMjI4OWMwZjg1NmYzMw"

           "url" : "/medias/?context=bWFzdGVyfGltYWdlc3wxNDQwfGltYWdlL2pwZWd8aW1hZ2VzL2gxNS9oZmYvODc5NzMzMDQ0MDIyMi5qcGd8ODU0ZWQwMjY5OWE5OTBlZjc0ZGFhZTU4ZWYwNDk4ODFmZmM1ZTg2ZjIxOWFiZTBkZmU0NDBmMDBiNTYyMzdlYg"

        "manufacturer" : "HP",

        "name" : "Photosmart E317 Digital Camera",

           "stockLevel" : 314,

        "url" : "/Open-Catalogue/Cameras/Digital-Cameras/Digital-Compacts/Photosmart-E317-Digital-Camera/p/300938"

     "quantity" : 1,

  "guid" : "43b901b0-0f02-43f4-add2-24b79a6ec1a8",

  "net" : true,

  "pickupItemsQuantity" : 0,

  "productDiscounts" : {

     "formattedValue" : "$0.00"

  },

  "subTotal" : {

     "currencyIso" : "USD",

     "formattedValue" : "$1,065.26",

     "priceType" : "BUY",

     "value" : 1065.26

  "totalDiscounts" : {

     "formattedValue" : "$20.00",

     "value" : 20.0

  "totalItems" : 2,

  "totalPrice" : {

  "totalPriceWithTax" : {

  "totalTax" : {

     "formattedValue" : "$0.00",

     "value" : 0.0

  "user" : {

     "name" : "Anonymous",

     "uid" : "anonymous"

  "paymentType" : {

     "code" : "CARD",

     "displayName" : "Card Payment"

  "potentialOrderPromotions" : [ ],

  "potentialProductPromotions" : [ ],

  "totalUnitCount" : 3

}

继续阅读