CartFileResource

The Cart File Resource provides import/export functionality to the shopping carts in InService.

The following resources are applicable:

GET /cartfiles/formats

Retrieves all supported file formats that can be used in exporting or importing shopping cart items. Each SCValue contains:

  • title : localized title of extension that client can display to user such as "Microsoft Excel Spreadsheet"
  • key : actual extension such as (csv , xml , etc)
  • value : extension mime type such as (text/csv , application/xml, etc)

Response Body

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

POST /cartfiles

Creates a shopping cart from each attached file.

Request Body

media type data type description
multipart/form-data (custom) container of files sent from client

Response Codes

code condition
400 Returned if extension or formInput is empty
415 Returned if the mime-type of any attached files are not supported

Response Body

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

POST /cartfiles/legacy

Creates a cart or wishlist for a single file uploaded. Legacy support for iFrame transport.

Request Body

media type data type description
multipart/form-data (custom) container of files sent from client

Response Body

media type data type
text/html (custom)

POST /cartfiles/iframe

Creates a cart or wishlist for a single file uploaded.

Request Body

media type data type description
multipart/form-data (custom) container of files sent from client

Response Body

media type data type
text/html (custom)

GET /cartfiles/{shoppingCartId}/{filename}

Export a shopping cart to a specified file type.

Request Parameters

name type description default
User-Agent header The header parameter automatically sent by browser to identify type and version of browser n/a
filename path Desired name for resulting file n/a
shoppingCartId path The ID of the shopping cart to be exported n/a

Response Codes

code condition
400 if the shopping cart id is not formatted correctly
404 if no shopping cart with the given id exists
415 Returned if the Content-Type (or content-type as represented by the extension) is not supported

Response Body

media type data type
application/json object (JSON)
application/xml anyType (XML)