WishListResource

The Wish list resource provides read/write access to the wish lists in InService. Each wish list acts as a container to which the user can add or remove parts. Items within a wish list can be updated e.g. you can increment the count of items, or add a textual comment. Wish lists are managed per-user, and a user can have any number of wish lists. Customizable delegates provide validation, recommendation and business process support such as supersession – these delegates operate on wish list and wish list contents.

Named Objects & Collections

NameDescription
items The items contained within the wish list.
recommended The recommended items based on the contents of the wish list.

Action Links

NameDescription
action_update_self The link to update an individual wish list.
action_delete_self The link to delete an individual wish list.
action_create The link to create a wish list. (Available on an SCList)
action_update_group The link to update a list of wish lists. (Available on an SCList)
action_delete_group The link to delete a list of wish lists. (Available on an SCList)

Data Model Objects

  • SCEWishList
  • SCECartItem

Customization Points

ClassMethodDescription
com.ptc.sc.services.plugins.CommerceDelegate validateRequestedItem The validateRequestedItem method is called on all items that are added to cart. A requested item is the part for which the user has clicked on the "add to cart" button in the UI. If the item is accepted (validated), the cart processing logic will move on to replaceItem (see below). If validation fails, the "add to cart" action fails and a message is returned to the caller.
com.ptc.sc.services.plugins.CommerceDelegate validateActualItem The validateActualItem method is called following replaceItem. A actual item is the part that is actually being added to the cart (could be replaced or could be the same as the requested item). If the item is accepted (validated), the cart processing logic will add the item to cart. If validation fails, the "add to cart" action fails and a message is returned to the caller.
com.ptc.sc.services.plugins.CommerceDelegate replaceItem The replaceItem method is called following validateRequestedItem, and can run any business logic to upgrade or alter the chosen object that is being added to the cart. The default OOTB behavior demonstrates automatic supersession, using the supersession business services to provide the latest part. replaceItem can return N number of items for 1 item passed in, supporting 1:N supersession for example.
com.ptc.sc.services.plugins.CommerceDelegate findExistingCartItem When items are added to a cart, the findExistingCartItem method is used to determine if the item already exists in the cart.

The following resources are applicable:

POST /wishlists/remove

Delete a list of given wish lists.

Request Body

media type data type description
application/vnd.ptc.sc+json SCList (JSON) The SCList of wish lists to be deleted.

Response Codes

code condition
204 Returned if a list of wish lists were successfully deleted.
400 Returned when the content does not contain data or the id of any item in the SCList is not of valid ID format.
404 Returned when none of the wish lists is found
415 Returned if the Content-Type is not application/vnd.ptc.sc+json;version=n

Response Body

media type data type
application/vnd.ptc.sc+json SCList (JSON)

POST /wishlists/{wishlistId}/cart

Creates a new cart based an the given wishlist.

Request Parameters

name type description default
wishlistId path the id of the wishlist to use as the basis for the new cart. n/a

Request Body

media type data type description
application/vnd.ptc.sc+json SCItem (JSON) the SCItem representing the attributes to be used when creating the cart.

Response Codes

code condition
201 Returned when the new cart is created.
400 Returned when the wishlistId is not of valid ID format.
404 Returned when a wishlist is not found for the given wishlistId.
415 Returned if the Content-Type is not application/vnd.ptc.sc+json;version=n

Response Body

media type data type
application/vnd.ptc.sc+json SCItem (JSON)

POST /wishlists/sendemail

Sends a email with given data provided by user.

This takes an SCList of one SCItem containing all of the form input parameters from the Send Email UI. It uses these input parameters to send the email. The cart is send as an attachment with chosen export type.

The UI has the following fields.

NameDescription
exportTypelist of available export types
subjectthe email subject
recipientscomma separated email addresses for recipients
messagethe message for email body

Request Body

media type data type description
application/vnd.ptc.sc+json SCList (JSON) an SCList of one SCItem containing all of the form input parameters from the Send Email UI

Response Codes

code condition
200 returned if email was send successfully
400 returned if request data is bad
502 returned if email was NOT successfully send

Response Body

media type data type
application/vnd.ptc.sc+json SCList (JSON)
Available Since
InService 6.0

GET /wishlists/{wishlistId}

Retrieves a specific wish list by the given wish list ID.

Available Since
InService 6.0

Request Parameters

name type description default
wishlistId path the ID of the wish list to retrieve n/a
$expand query the OData expand clause used to expand attribute objects and collections.

To expand the items collection when requesting the wish list use: $expand=items

n/a
$filter query -- Reserved for future use. -- n/a
$orderby query the ordering of wish list items when expanding items n/a
$skip query the number of wish list items to skip for paging when expanding items n/a
$top query the number of wish list items to return in a page when expanding items n/a

Response Codes

code condition
400 returned when the cartId is not of valid ID for a wish list
404 returned when a wish list is not found for the given wish list ID

Response Body

media type data type
application/vnd.ptc.sc+json SCItem (JSON)
Available Since
InService 6.0

GET /wishlists/all_shared_list

Retrieves all lists owned by the user plus list shared to ServiceGroups with which user is associated with.

Available Since
InService 6.0

Request Parameters

name type description default
$expand query the OData expand clause used to expand attribute objects and collections.

To expand the items collection when requesting the wish list use: $expand=items

n/a
$filter query -- Reserved for future use. -- n/a
$orderby query the ordering of lisst items when expanding items n/a
$skip query the number of lists items to skip for paging when expanding items n/a
$top query the number of lists to return in a page when expanding items n/a

Response Codes

code condition
400 returned when the list id is not of valid ID for a wish list

Response Body

media type data type
application/vnd.ptc.sc+json SCList (JSON)
Available Since
InService 6.0

POST /wishlists/{wishlistId}/share

Shares the given wish list to the given library/libraries depending upon the shareWithAll parameter value.

Available Since
InService 6.0

Request Parameters

name type description default
wishlistId path n/a

Request Body

media type data type
application/vnd.ptc.sc+json SCItem (JSON)

Response Codes

code condition
400 returned when the wishlistId is not of valid ID for a wish list
404 returned when a wish list is not found for the given wish list ID

Response Body

media type data type
application/vnd.ptc.sc+json SCItem (JSON)
Available Since
InService 6.0

POST /wishlists/{wishlistId}/unshare

Unshares the given list.

Available Since
InService 6.0

Request Parameters

name type description default
wishlistId path n/a

Response Codes

code condition
400 returned when the wishlistId is not of valid ID for a wish list
404 returned when a wish list is not found for the given wish list ID

Response Body

media type data type
application/vnd.ptc.sc+json SCItem (JSON)

GET /wishlists/get_all_owned_and_shared_ids

Retrieves all cart ids for the given user. This does not return serialized carts, it returns a List of ids.

Response Body

media type data type
application/vnd.ptc.sc+json array of object (JSON)

GET /wishlists

Retrieves all carts for the given user in all dealerships and unaffiliated carts.

Retrieves all carts with in specific dealerships. For example:

Carts in dealer wt.inf.library.WTLibrary-33096

$filter=dealerReference eq 'wt.inf.library.WTLibrary-33096'

Retrieves all carts that are unaffiliated. For example:

$filter=dealerReference eq 'unaffiliated'

Retrieves all carts in a set of dealerships, including unaffiliated carts. For example:

Carts in dealer wt.inf.library.WTLibrary-33096 and unaffiliated carts

$filter=dealerReference eq 'wt.inf.library.WTLibrary-33096' or dealerReference eq 'unaffiliated'


If the activeCart is not specified no metadata for the active cart will be returned. If the activeCart is specified, the $expand must specify 'activeCart'. For example:

$expand=activeCart

activeCart=com.ptc.sce.cart.SCEShoppingCart-12345

Request Parameters

name type description default
$expand query The OData expand clause, in this case only used to indicate to get active cart metadata. n/a
$filter query Allows filtering by dealer with the format: dealerReference eq 'dealerId' n/a
$orderby query The OData order by n/a
$skip query The number of items to skip for the start of this page. n/a
$top query The number of objects to return in this page. n/a
activeCart query The id of the active cart, whose metadata should be included in the result n/a

Response Body

media type data type
application/vnd.ptc.sc+json SCList (JSON)

GET /wishlists/get_all_ids

Retrieves all cart ids for the given user. This does not return serialized carts, it returns a List of ids.

Response Body

media type data type
application/vnd.ptc.sc+json array of object (JSON)

POST /wishlists

Creates a list of carts.

Request Body

media type data type description
application/vnd.ptc.sc+json SCList (JSON) The SCList of carts to create.

Response Codes

code condition
400 Returned when the content does not contain data.
415 Returned if the Content-Type is not application/vnd.ptc.sc+json;version=n

Response Body

media type data type
application/vnd.ptc.sc+json SCList (JSON)

PUT /wishlists/{cartId}

Updates an existing cart.

Request Parameters

name type description default
cartId path The ID of the cart to be updated. n/a
$expand query The OData expand parameter. $expand=pricing is used to inject pricing and availability n/a

Request Body

media type data type description
application/vnd.ptc.sc+json SCItem (JSON) The cart to be updated.

Response Codes

code condition
400 Returned when the content does not contain the correct cart data for the update or the cartId is not of valid ID format.
404 Returned when a cart is not found for the given cart ID.
415 Returned if the Content-Type is not application/vnd.ptc.sc+json;version=n

Response Body

media type data type
application/vnd.ptc.sc+json SCItem (JSON)

DELETE /wishlists/{cartId}

Deletes the specified cart.

Request Parameters

name type description default
cartId path The ID of the cart to be deleted. n/a

Response Codes

code condition
204 Returned if the cart was successfully deleted.
400 Returned when a cartId is not of valid ID format.
404 Returned when a cart is not found for the given cart ID.

Response Body

media type data type
application/vnd.ptc.sc+json SCList (JSON)

GET /wishlists/{cartId}/items

Retrieves the cart items of a specific cart. This method validate that cart item parts are in the right parts list context and parts exists in e3c.

Request Parameters

name type description default
cartId path The ID of the cart whose items to retrieve. n/a
$expand query The OData expand parameter. $expand=context is used to inject context path collection to each cart item n/a
$filter query -- Reserved for future use. -- n/a
$orderby query The OData order by n/a
$skip query The number of items to skip for the start of this page. n/a
$top query The number of objects to return in this page. n/a

Response Codes

code condition
404 Returned when a cart is not found for the given cart ID.

Response Body

media type data type
application/vnd.ptc.sc+json SCList (JSON)

POST /wishlists/{cartId}/items

Add a list of cart items to an existing cart. The item added to the cart can be internal or external to InService.

Example of an external item to be added to the cart

{
"items": [
{
"attributes": {
"description": "",
"partNumber": "",
"quantity": ""
}
}]}

For internal items "e3cNavLink.itemId" attribute needs to be included in addition to quantity and description attribute. Internal items can also include a context that can be found as part of the NavLink information on the part.

Example of an internal item without context JSON structure

{
"items": [
{
"attributes": {
"description": "",
"e3cNavLink.itemId": "",
"quantity": ""
}
}]}

Example of an internal item with context

{
"items": [
{
"attributes": {
"description": "",
"e3cNavLink.contextId": "",
"e3cNavLink.itemId": "",
"e3cNavLink.itemParentId": "",
"quantity": ""
}
}]}

Request Parameters

name type description default
cartId path The ID of the cart to add the items to. n/a
$expand query The OData expand parameter. $expand=pricing is used to inject pricing and availability n/a

Request Body

media type data type description
application/vnd.ptc.sc+json SCList (JSON) The list of items to be added to the cart.

Response Codes

code condition
400 Returned when the content does not contain data or the cartId is not of valid ID format.
404 Returned when a cart is not found for the given cart ID.
415 Returned if the Content-Type is not application/vnd.ptc.sc+json;version=n

Response Body

media type data type
application/vnd.ptc.sc+json SCList (JSON)

GET /wishlists/{cartId}/items/pricing

Retrieves the cart items total pricing of a specific cart.

Request Parameters

name type description default
cartId path The ID of the cart whose items pricing to retrieve. n/a
$expand query The OData expand parameter. $expand=totalCartPricing is used in the case when there is more objects in the cart then the one return. n/a
$top query The number of objects to return in this page. n/a

Response Codes

code condition
404 Returned when a cart is not found for the given cart ID.

Response Body

media type data type
application/vnd.ptc.sc+json SCList (JSON)

POST /wishlists/{cartId}/items/update

Updates a list of cart items.

Request Parameters

name type description default
cartId path The ID of the cart that owns the items. n/a
$expand query The OData expand parameter. $expand=pricing is used to inject pricing and availability n/a

Request Body

media type data type description
application/vnd.ptc.sc+json SCList (JSON) The SCList of cart items to be updated.

Response Codes

code condition
400 Returned when the content does not contain data or the cartId is not of valid ID format.
404 Returned when a cart is not found for the given cart ID.
415 Returned if the Content-Type is not application/vnd.ptc.sc+json;version=n

Response Body

media type data type
application/vnd.ptc.sc+json SCList (JSON)

PUT /wishlists/{cartId}/items/{itemId}

Updates a cart item.

Request Parameters

name type description default
cartId path The ID of the cart that owns the cart item. n/a
itemId path The ID of the cart item. n/a
$expand query The OData expand parameter. $expand=pricing is used to inject pricing and availability n/a

Request Body

media type data type description
application/vnd.ptc.sc+json SCItem (JSON) The cart item to be updated.

Response Codes

code condition
400 Returned when the content does not contain the correct cart item data for the update or the cartId or itemID are not of valid ID format.
404 Returned when a cart item is not found for the given cart ID and item ID.
415 Returned if the Content-Type is not application/vnd.ptc.sc+json;version=n

Response Body

media type data type
application/vnd.ptc.sc+json SCItem (JSON)

POST /wishlists/{cartId}/items/remove

Delete a list of existing cart items from the given cart.

Request Parameters

name type description default
cartId path The ID of the cart that owns the items. n/a
$expand query The OData expand parameter. $expand=pricing is used to inject pricing and availability n/a

Request Body

media type data type description
application/vnd.ptc.sc+json SCList (JSON) The SCList of cart items to be deleted.

Response Codes

code condition
204 Returned if a list of cart items were successfully deleted.
400 Returned when the content does not contain data or the cartId is not of valid ID format.
404 Returned when a cart is not found for the given cart ID.
415 Returned if the Content-Type is not application/vnd.ptc.sc+json;version=n

Response Body

media type data type
application/vnd.ptc.sc+json SCList (JSON)

DELETE /wishlists/{cartId}/items/{itemId}

Deletes a cart item from the given cart.

Request Parameters

name type description default
cartId path The ID of the cart that owns the cart item. n/a
itemId path The ID of the cart item to be deleted. n/a
$expand query The OData expand parameter. $expand=pricing is used to inject pricing and availability n/a

Response Codes

code condition
204 Returned if the cart item was successfully deleted.
400 Returned when the cartId or itemId are not of valid ID format.
404 Returned when a cart item is not found for the given cart ID and item ID.

Response Body

media type data type
application/vnd.ptc.sc+json SCItem (JSON)

POST /wishlists/{cartId}/moveOrCopy

Copy/Move a list of existing cart/list items from the given cart/list.

Request Parameters

name type description default
cartId path The ID of the cart that owns the items. n/a

Request Body

media type data type description
application/vnd.ptc.sc+json SCItem (JSON) The SCItem having attributes shouldCopy and targetId, and list of items to be copied/moved.

Response Codes

code condition
200 Returned if items were able to be moved/copied based on shouldCopy flag.
400 Returned when the content does not contain data or the cartId is not of valid ID format.
404 Returned when a cart is not found for the given cart ID.
415 Returned if the Content-Type is not application/vnd.ptc.sc+json;version=n

Response Body

media type data type
application/vnd.ptc.sc+json SCList (JSON)

POST /wishlists/moveOrCopyCarts

Copy/Move a list of existing cart/list items from the given cart/list.

Request Body

media type data type description
application/vnd.ptc.sc+json SCItem (JSON) The SCItem having attributes shouldCopy and targetId, and list of items to be copied/moved.

Response Codes

code condition
200 Returned if items were able to be moved/copied based on shouldCopy flag.
400 Returned when the content does not contain data or the cartId is not of valid ID format.
404 Returned when a cart is not found for the given cart ID.
415 Returned if the Content-Type is not application/vnd.ptc.sc+json;version=n

Response Body

media type data type
application/vnd.ptc.sc+json SCList (JSON)