The addItemToOrder actor-chain is used to add a single to a shopping cart. It also is used to add an item from a customer’s gift/wish list to a shopping cart, as well as adding an item to an in-store pickup order:

Parameter

Description

catalogRefIds

The catalog reference ID.

productId

The ID of the product to add to the shopping cart.

quantity

The number of each product being added to the shopping cart. For example, two sweaters or four pairs of shoes.

siteId

Identifies the site associated with the product.

locationId

Used only for in-store pickup, identifies the location of the store.

addToWishlist

Boolean parameter used only for adding wish list items to the shopping cart.

giftlistId

Identifies the gift list ID.

giftlistItemId

Used only for adding gift/wish list items. Identifies the list item ID.

Add Item to Order Example
curl -L -v -b customer_cookies.txt -H "Content-Type: application/json" -d "{
"catalogRefIds": "xsku1043","productId":"xprod1015","quantity": 1}"
"http://localhost:8280/rest/model/atg/commerce/order/purchase/CartModifierActor/
addItemToOrder"
Add Item to In-Store Pickup Example

Note the use of the locationId to identify the store from where the item will be picked up.

curl -L -v -b customer_cookies.txt -H "Content-Type: application/json" -d "{
"catalogRefIds": "sku30029","productId": "prod10004", "locationId":
"FashionIsland", "quantity": 1}" "http://localhost:8280/rest/model/atg/commerce/
order/purchase/CartModifierActor/addItemToOrder"
Add Item From Gift List Example

Note the use of the giftlistId and the giftlistItemId.

curl -L -v -b customer_cookies.txt -H "Content-Type: application/json" -d "{
"catalogRefIds" : "xsku2085", "productId" : "xprod2085", "giftlistId" : "gl40007",
"giftlistItemId" : "gi40001", "quantity": 1}" "http://localhost:8280/rest/model/
atg/commerce/order/purchase/CartModifierActor/addItemToOrder"
Add Item From Wish List Example

This example is similar to the Gift List example, however if addToWishlist is true, the system uses Profile.wishlist.repositoryId instead of the giftlistId.

curl -L -v -b customer_cookies.txt -H "Content-Type: application/json" -d "{
"catalogRefIds" : "xsku2085", "productId" : "xprod2085", "addToWishlist" :
"true","giftlistItemId" : "gi40001", "quantity": 1}" "http://localhost:8280/
rest/model/atg/commerce/order/purchase/CartModifierActor/addItemToOrder"

Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices