OrderResource

The Orders resource provides read/write access to orders within InService. Orders are created when a cart is passed to the order processing service. Items within an order can potentially be updated e.g. you could in theory increment the count of items, or add a textual comment even after the order has been submitted. Order history is managed per-user. Customizable delegates provide the capability for the user to link the InService order objects up to an external order processing and tracking system.

Named Objects & Collections

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

Action Links

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

Data Model Objects

  • SCEOrder
  • SCCartItem

Customization Points

ClassMethodDescription
com.ptc.sc.services.plugins.CommerceDelegate placeOrder Takes the SCEOrder item and can hand the contents over to whatever back-office order processing system exists.
com.ptc.sc.services.plugins.CommerceDelegate getOrder The getOrder method can be used to add additional details to the order. For example, you could call an external system to include the order status.

The following resources are applicable:

GET /orders

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

Retrieves all orders with in specific dealerships. For example:

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

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

Retrieves all orders that are unaffiliated. For example:

$filter=dealerReference eq 'unaffiliated'

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

Orders in dealer wt.inf.library.WTLibrary-33096 and unaffiliated orders

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


Request Parameters

name type description default
$expand query 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 n/a

Response Body

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

POST /orders

-- NOT IMPLEMENTED -- Creates a list of orders.

Request Body

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

Response Codes

code condition
501 A Not Implemented status code.

Response Body

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

DELETE /orders/{orderId}

-- NOT IMPLEMENTED -- Deletes a provided order

Request Parameters

name type description default
orderId path The ID of the order to delete. n/a

Response Codes

code condition
501 A Not Implemented status code.

Response Body

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

POST /orders/{orderId}/items

-- NOT IMPLEMENTED -- Adds an item to an order.

Request Parameters

name type description default
orderId path The ID of the order order 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 SCList of items to be added to the order.

Response Codes

code condition
501 A Not Implemented status code.

Response Body

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

GET /orders/{orderId}/items

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

Request Parameters

name type description default
orderId path The ID of the order 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 order is not found for the given order ID.

Response Body

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

POST /orders/{orderId}/items/update

-- NOT IMPLEMENTED --Updates a list of order items.

Request Parameters

name type description default
orderId path The ID of the order 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 order items to be updated.

Response Codes

code condition
501 A Not Implemented status code.

Response Body

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

PUT /orders/{orderId}/items/{itemId}

-- NOT IMPLEMENTED --Updates a order item.

Request Parameters

name type description default
itemId path The ID of the order item. n/a
orderId path The ID of the order that owns the order 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 order item to be updated.

Response Codes

code condition
501 A Not Implemented status code.

Response Body

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

POST /orders/{orderId}/items/remove

-- NOT IMPLEMENTED --Delete a list of existing order items from the given order.

Request Parameters

name type description default
orderId path The ID of the order 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 order items to be deleted.

Response Codes

code condition
501 A Not Implemented status code.

Response Body

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

DELETE /orders/{orderId}/items/{itemId}

-- NOT IMPLEMENTED --Deletes a order item from the given order.

Request Parameters

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

Response Codes

code condition
501 A Not Implemented status code.

Response Body

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

PUT /orders/{orderId}

-- NOT IMPLEMENTED -- Updates an existing order.

Request Parameters

name type description default
orderId path The ID of the order 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 order to be updated.

Response Codes

code condition
501 A Not Implemented status code.

Response Body

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

GET /orders/{orderId}

Retrieves a specific order by the given order ID.

Available Since
InService 6.0

Request Parameters

name type description default
orderId path the ID of the cart 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 order use: $expand=items

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

Response Codes

code condition
400 returned when the orderId is not of valid ID for a order
404 returned when a order is not found for the given order ID

Response Body

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

GET /orders/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)

GET /orders/{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 /orders/{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 /orders/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)