TMF663 Shopping Cart API REST Specification R17.0.1
TMF663 Shopping Cart API REST Specification R17.0.1
Shopping Cart
API REST Specification
TMF663
Release 17.0.1
November 2017
NOTICE
This document and translations of it may be copied and furnished to others, and derivative works that
comment on or otherwise explain it or assist in its implementation may be prepared, copied, published,
and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice
and this section are included on all such copies and derivative works. However, this document itself may
not be modified in any way, including by removing the copyright notice or references to TM FORUM,
except as needed for the purpose of developing any document or deliverable produced by a TM FORUM
Collaboration Project Team (in which case the rules applicable to copyrights, as set forth in the TM
FORUM IPR Policy, must be followed) or as required to translate it into languages other than English.
The limited permissions granted above are perpetual and will not be revoked by TM FORUM or its
successors or assigns.
This document and the information contained herein is provided on an "AS IS" basis and TM FORUM
DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY
OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE.
TM FORUM invites any TM FORUM Member or any other party that believes it has patent claims that
would necessarily be infringed by implementations of this TM Forum Standards Final Deliverable, to notify
the TM FORUM Team Administrator and provide an indication of its willingness to grant patent licenses to
such patent claims in a manner consistent with the IPR Mode of the TM FORUM Collaboration Project
Team that produced this deliverable.
The TM FORUM invites any party to contact the TM FORUM Team Administrator if it is aware of a claim
of ownership of any patent claims that would necessarily be infringed by implementations of this TM
FORUM Standards Final Deliverable by a patent holder that is not willing to provide a license to such
patent claims in a manner consistent with the IPR Mode of the TM FORUM Collaboration Project Team
that produced this TM FORUM Standards Final Deliverable. TM FORUM may include such claims on its
website, but disclaims any obligation to do so.
TM FORUM takes no position regarding the validity or scope of any intellectual property or other rights
that might be claimed to pertain to the implementation or use of the technology described in this TM
FORUM Standards Final Deliverable or the extent to which any license under such rights might or might
not be available; neither does it represent that it has made any effort to identify any such rights.
Information on TM FORUM's procedures with respect to rights in any document or deliverable produced
by a TM FORUM Collaboration Project Team can be found on the TM FORUM website. Copies of claims
of rights made available for publication and any assurances of licenses to be made available, or the result
of an attempt made to obtain a general license or permission for the use of such proprietary rights by
implementers or users of this TM FORUM Standards Final Deliverable, can be obtained from the TM
FORUM Team Administrator. TM FORUM makes no representation that any information or list of
intellectual property rights will at any time be complete, or that any claims in such list are, in fact, Essential
Claims.
TABLE OF CONTENTS
NOTICE ........................................................................................................................................ 2
Table of Contents.......................................................................................................................... 4
Introduction ................................................................................................................................... 6
API OPERATIONS...................................................................................................................... 22
API NOTIFICATIONS.................................................................................................................. 33
AcknowledGments ...................................................................................................................... 36
LIST OF TABLES
N/A
INTRODUCTION
Shopping Cart is the necessary component in modern sales channel both for online channel of e-
commerce and call center and physical stores. It allows visitors to the shopping site to select items for
eventual purchase. It provides a means of capturing a user purchase requirements, to accumulate a list of
items for purchase, described as “placing items in the shopping cart” or “adding to cart.” It typically
calculates a total charge for the cart including chosen goods or service, shipping and handling charges
and the associated taxes are typically calculated during the checkout. Shopping cart supports purchase of
both tangible and intangible good and service (e.g. mobile device or family plan). The charge includes the
one-off fee such as the fee for handset and the recurring fee. The customer will be informed about the fee
information, but only pay the one-off fee after confirming the shopping cart. The recurring fee may be paid
when reaching the bill cycle.
Shopping Cart Item is a contained sub resource. Cart item is the product offering which has been
selected and added into the shopping cart with its price calculation. This item represents the customer’s
request to order, but not finally decided.
The Shopping Cart API provides a standardized mechanism for the management of shopping carts.
Including creation, update, retrieval, deletion and notification of event. Shopping Cart entity is used for the
temporary selection and reservation of product offerings in e-commerce and retail purchase. Shopping
cart supports purchase of both tangible and intangible goods and services (e.g. handset, telecom network
service). The charge includes the one-off fee such as the fee for handset and the recurring fee such as
the fee of a network service. Shopping Cart contains a list of cart items, a reference to party or party role
(e.g. customer) or contact medium in case of unknown customer, and also the calculated total items price
including promotions.
Summary This case describes the prospect selects and purchases the offering using the
shopping cart, and finally submits the request to generate the order.
Pre- 1. Online shopping portal is available, including the offerings and integration
Conditions with external systems such as payment, logistics.
Begins When When all pre-conditions have been met and the prospect starts adding the
offering into the shopping cart.
2. The prospect browses the offering and chooses what he/she wants to
purchase, and add it into the shopping cart.
3. The shopping cart is created for the prospect with the added items and visible
for the prospect to operate on it.
4. The customer can also remove the existing item in the cart, or empty it
completely.
5. The prospect checks out the shopping cart to generate the product order in
draft status (Checkout Flow).
10. The customer comments on the purchase process or shares the experience.
Summary This case describes the customer selects and purchases the offering using the
shopping cart, and finally submits the request to generate the order.
Pre- 1. Online shopping portal is available, including the offerings and integration
Conditions with external systems such as payment, logistics.
2. Customer has logged into the online shopping portal.
Begins When When all pre-conditions have been met and the customer starts adding the offering
into the shopping cart.
RESOURCE MODEL
Resource model
Field descriptions
ShoppingCart fields
validFor A time period. The period for which the shopping cart is valid (e.g. 90 if no
activity or 7 days if cart is empty).
contactMedium A list of contact mediums (ContactMedium [*]). Indicates the contact medium
that could be used to contact the party.
cartTotalPrice A list of cart prices (CartPrice [*]). An amount, usually of money, that
represents the actual price paid by the customer for this item. May represent
the total price of the shopping cart or the total of the cart item depending on the
relation.
cartItem A list of cart items (CartItem [*]). An identified part of the shopping cart. A
shopping cart is decomposed into one or more shopping cart item. Cart item
represents a product offering or bundled product offering that user wish to
purchase, as well as the pricing of the product offering, reference to product in
case of configured characteristic or installation address. Cart items can be
related to other cart item to related bundled offerings or reference cart Items to
a shipping options.
relatedParty A list of related party references (RelatedPartyRef [*]). A related party defines
party or party role linked to a specific entity.
CartItem sub-resource
An identified part of the shopping cart. A shopping cart is decomposed into one or more shopping cart
item. Cart item represents a product offering or bundled product offering that user wish to purchase, as
well as the pricing of the product offering, reference to product in case of configured characteristic or
installation address. Cart items can be related to other cart item to related bundled offerings or reference
cart Items to a shipping options.
id A string. Identifier of the cart item (generally it is a sequence number 01, 02,
03, ...) in the shopping cart.
cardItem A list of cart items (CartItem [*]). An identified part of the shopping cart. A
shopping cart is decomposed into one or more shopping cart item. Cart item
represents a product offering or bundled product offering that user wish to
purchase, as well as the pricing of the product offering, reference to product in
case of configured characteristic or installation address. Cart items can be
related to other cart item to related bundled offerings or reference cart Items to
a shipping options.
note A list of notes (Note [*]). Extra information about a given entity.
totalItemPrice A list of cart prices (CartPrice [*]). An amount, usually of money, that
represents the actual price paid by the customer for this item. May represent
the total price of the shopping cart or the total of the cart item depending on the
relation.
itemPrice A list of cart prices (CartPrice [*]). An amount, usually of money, that
represents the actual price paid by the customer for this item. May represent
the total price of the shopping cart or the total of the cart item depending on the
relation.
CartItemRelationship sub-resource
Relationship among cart items mainly other than hierarchical relationships such as "RelyOn",
"DependentOn", "Shipping" etc.
cartItem A list of cart item references (CartItemRef [*]). CartIIem reference. A CartItem
is an identified part of the shopping cart.
CartPrice sub-resource
An amount, usually of money, that represents the actual price paid by the customer for this item. May
represent the total price of the shopping cart or the total of the cart item depending on the relation.
description A string. A narrative that explains in detail the semantics of this order item
price.
priceType A string. A category that describes the price, such as recurring, discount,
allowance, penalty, and so forth.
price A price (Price). Provides all amounts (tax included, duty free, tax rate), used
currency and percentage to apply for Price Alteration.
ContactMedium sub-resource
Indicates the contact medium that could be used to contact the party.
type A string. Type of the contact medium, such as: email address, telephone
number, postal address.
validFor A time period. The time period that the contact medium is valid for.
MediumCharacteristic sub-resource
Describes the contact medium characteristics that could be used to contact a party (an individual or an
organization).
Money sub-resource
unit A string. Currency (ISO4217 norm uses 3 letters to define the currency).
Note sub-resource
Price sub-resource
Provides all amounts (tax included, duty free, tax rate), used currency and percentage to apply for Price
Alteration.
dutyFreeAmount A money (Money). All taxes excluded amount (expressed in the given
currency).
taxIncludedAmount A money (Money). All taxes included amount (expressed in the given
currency).
PriceAlteration sub-resource
Is an amount, usually of money, that modifies the price charged for an order item.
applicationDuration An integer. Duration during which the alteration applies on the order item price
(for instance 2 months free of charge for the recurring charge).
description A string. A narrative that explains in detail the semantics of this order item
price alteration.
priceType A string. A category that describes the price such as recurring, one time and
usage.
priority An integer. Priority level for applying this alteration among all the defined
alterations on the order item price.
validFor A time period. The period for which the price alteration is valid.
price A price (Price). Provides all amounts (tax included, duty free, tax rate), used
currency and percentage to apply for Price Alteration.
ProductCharacteristic sub-resource
ProductRefOrValue sub-resource
Product reference. Configure the product characteristics (only configurable characteristics and necessary
only if a non default value is selected) and/or identify the product that needs to be modified/deleted.
place A list of place references (PlaceRef [*]). Place defines the places where the
products are sold or delivered.
relatedParty A list of related party references (RelatedPartyRef [*]). A related party defines
party or party role linked to a specific entity.
ProductRefOrValueRelationship sub-resource
Represents a relationship between products - which potentially holds an entire product object or a product
reference (with partial content).
- "bundled" if the product is a bundle and you want to describe the "bundled"
products inside this bundle
- "reliesOn" if the product needs another already owned product to rely on
(e.g. an option on an already owned mobile access product)
"targets" or "isTargeted" (depending on the way of expressing the link) for any
other kind of links that may be useful.
BundledProductOfferingRef relationship
CartItemRef relationship
PlaceRef relationship
Place reference. Place defines the places where the products are sold or delivered.
name A string. A user-friendly name for the place, such as "Paris Store", "London
Store", "Main Home".
role A string. Role of the place (for instance: 'home delivery', 'shop retrieval').
ProductOfferingRef relationship
ProductOffering reference. A product offering represents entities that are orderable from the provider of
the catalog, this resource includes pricing information.
ProductSpecificationRef relationship
RelatedPartyRef relationship
RelatedParty reference. A related party defines party or party role linked to a specific entity.
href A string. Reference of the related party, could be a party reference or a party
role reference.
{
"href": "https://host:port/shoppingCart/v1/shoppingCart/1203",
"id": "1203",
"validFor": {
"startDateTime": "2017-03-27T00:00",
"endDateTime": "2017-10-24T00:00"
},
"contactMedium": [
{
"type": "email",
"characteristic": {
"emailAddress": "JackSmith@mail.com"
}
}
],
"cartTotalPrice": [
{
"description": "Total Recurring Price.",
}
]
},
"productOffering": {
"href": "https://host:port/productCatalog/productOffering/14277",
"id": "14277",
"name": "Talk Simple 25"
}
}
]
}
The notification structure for all notifications in this API follow the pattern depicted by the figure below.
A notification resource (depicted by "SpecificNotification" placeholder) is a sub class of a generic
Notification structure containing an id of the event occurrence (eventId), an event timestamp (eventTime),
and the name of the notification resource (eventType).
This notification structure owns an event structure ("SpecificEvent" placeholder) linked to the resource
concerned by the notification using the resource name as access field ("resourceName" placeholder).
{
"eventId":"00001",
"eventTime":"2015-11-16T16:42:25-04:00",
"eventType":"ShoppingCartCreationNotification",
"event": {
"shoppingCart" :
{-- SEE ShoppingCart RESOURCE SAMPLE --}
}
}
{
"eventId":"00001",
"eventTime":"2015-11-16T16:42:25-04:00",
"eventType":"ShoppingCartChangeNotification",
"event": {
"shoppingCart" :
{-- SEE ShoppingCart RESOURCE SAMPLE --}
}
}
API OPERATIONS
Remember the following Uniform Contract:
Other Request Methods POST on TASK Resource GET and POST must not be
used to tunnel other request
methods.
Filtering and attribute selection rules are described in the TMF REST Design Guidelines.
Description
Usage Samples
Request
GET /shoppingCart/v1/shoppingCart
Accept: application/json
Response
200
[
{
"href": "https://host:port/shoppingCart/v1/shoppingCart/1203",
"id": "1203",
"validFor": {
"startDateTime": "2017-03-27T00:00",
"endDateTime": "2017-10-24T00:00"
},
"contactMedium": [
{
"type": "email",
"characteristic": {
"emailAddress": "JackSmith@mail.com"
}
}
],
"cartTotalPrice": [
{
"description": "Total Recurring Price.",
"name": "Monthly Price",
"priceType": "recurring",
"recurringChargePeriod": "monthly",
"price": {
"dutyFreeAmount": {
"money": {
"unit": "EUR",
"value": 29
}
},
"taxIncludedAmount": {
"money": {
"unit": "EUR",
"value": 31.9
},
"taxRate": 10
}
},
"priceAlteration": [
{
"applicationDuration": 3,
"description": "First 3 month get 50% off",
"name": "3 month for half",
"priceCondition": "new customer",
"priceType": "recurring",
"recurringChargePeriod": "monthly",
"validFor": {
"startDateTime": "2017-03-26T00:00",
"endDateTime": "2017-10-24T00:00"
},
"price": {
"percentage": 50
}
}
]
}
],
"cartItem": [
{
"action": "add",
"id": "8307",
"quantity": 1,
"status": "Active",
"note": {
"author": "Mr Smith",
"date": "2017-03-28T00:00",
"text": "Please wrap with double bag"
},
"product": {
"name": "Talk Simple 25",
"place": [
{
"href": "https://host:port/placeManagement/place/7396",
"id": "7396",
"name": "Main Store",
"role": "default delivery"
}
]
},
"productOffering": {
"href": "https://host:port/productCatalog/productOffering/14277",
"id": "14277",
"name": "Talk Simple 25"
}
}
]
}
]
Usage Samples
Request
GET /shoppingCart/v1/shoppingCart/5074
Accept: application/json
Response
200
{
"href": "https://host:port/shoppingCart/v1/shoppingCart/1203",
"id": "1203",
"validFor": {
"startDateTime": "2017-03-27T00:00",
"endDateTime": "2017-10-24T00:00"
},
"contactMedium": [
{
"type": "email",
"characteristic": {
"email": "JackSmith@mail.com"
}
}
],
"cartTotalPrice": [
{
"description": "Total Recurring Price.",
"name": "Monthly Price",
"priceType": "recurring",
"recurringChargePeriod": "monthly",
"price": {
"dutyFreeAmount": {
"money": {
"unit": "EUR",
"value": 29
}
},
"taxIncludedAmount": {
"money": {
"unit": "EUR",
"value": 31.9
},
"taxRate": 10
}
},
"priceAlteration": [
{
"applicationDuration": 3,
"description": "First 3 month get 50% off",
"name": "3 month for half",
"priceCondition": "new customer",
"priceType": "recurring",
"recurringChargePeriod": "monthly",
"validFor": {
"startDateTime": "2017-03-26T00:00",
"endDateTime": "2017-10-24T00:00"
},
"price": {
"percentage": 50
}
}
]
}
],
"cartItem": [
{
"action": "add",
"id": "8307",
"quantity": 1,
"status": "Active",
"note": {
"author": "Mr Smith",
"date": "2017-03-28T00:00",
"text": "Please wrap with double bag"
},
"product": {
"name": "Talk Simple 25",
"place": [
{
"href": "https://host:port/placeManagement/place/7396",
"id": "7396",
"name": "Main Store",
"role": "default delivery"
}
]
},
"productOffering": {
"href": "https://host:port/productCatalog/productOffering/14277",
"id": "14277",
"name": "Talk Simple 25"
}
}
]
}
The following tables provides the list of mandatory and non mandatory attributes when creating a
ShoppingCart, including any possible rule conditions and applicable default values. Notice that it is up to
an implementer to add additional mandatory attributes.
Additional Rules
The following table provides additional rules indicating mandatory fields in sub-resources or relationships
when creating a ShoppingCart resource.
When creating the resource, the following table summarizes the default values applicable to optional
attributes of the resource (or sub-resources).
Usage Samples
Here's an example of a request for creating a ShoppingCart resource. In this example the request only
passes mandatory attributes.
Request
POST /shoppingCart/v1/shoppingCart
Content-Type: application/json
{
"cartItem": [
{
"action": "add",
"id": "8307",
"quantity": 1,
"status": "Active",
"note": {
"author": "Mr Smith",
"date": "2017-03-28T00:00",
"text": "Please wrap with double bag"
},
"product": {
"name": "Talk Simple 25",
"place": [
{
"href": "https://host:port/placeManagement/place/7396",
"id": "7396",
"name": "Main Store",
"role": "default delivery"
}
]
},
"productOffering": {
"href": "https://host:port/productCatalog/productOffering/14277",
"id": "14277",
"name": "Talk Simple 25"
}
}
]
}
Response
201
{
"href": "https://host:port/shoppingCart/v1/shoppingCart/1203",
"id": "1203", "cartItem": [
{
"action": "add",
"id": "8307",
"quantity": 1,
"status": "Active",
"note": {
"author": "Mr Smith",
"date": "2017-03-28T00:00",
"text": "Please wrap with double bag"
},
"product": {
"name": "Talk Simple 25",
"place": [
{
"href": "https://host:port/placeManagement/place/7396",
"id": "7396",
"name": "Main Store",
"role": "default delivery"
}
]
},
"productOffering": {
"href": "https://host:port/productCatalog/productOffering/14277",
"id": "14277",
"name": "Talk Simple 25"
}
}
]
}
This operation allows partial updates of a shopping cart entity. Support of json/merge
(https://tools.ietf.org/html/rfc7386) is mandatory, support of json/patch (http://tools.ietf.org/html/rfc5789) is
optional.
Note: If the update operation yields to the creation of sub-resources or relationships, the same rules
concerning mandatory sub-resource attributes and default value settings in the POST operation applies to
the PATCH operation. Hence these tables are not repeated here.
The tables below provide the list of patchable and non patchable attributes, including constraint rules on
their usage.
Usage Samples
Here's an example of a request for patching a ShoppingCart resource. It is a request for changing the
contact medium.
Request
PATCH /shoppingCart/v1/shoppingCart/5074
Content-Type: application/merge-patch+json
{
"contactMedium": [
{
"type": "email",
"characteristic": {
"emailAddress": "jack_smith@newmail.com"
}
}
]
}
Response
201
{
"href": "https://host:port/shoppingCart/v1/shoppingCart/1203",
"id": "1203",
"validFor": {
"startDateTime": "2017-03-27T00:00",
"endDateTime": "2017-10-24T00:00"
},
"contactMedium": [
{
"type": "email",
"characteristic": {
"emailAddress": "jack_smith@newmail.com"
}
}
],
"cartTotalPrice": [
{
"description": "Total Recurring Price.",
"name": "Monthly Price",
"priceType": "recurring",
"recurringChargePeriod": "monthly",
"price": {
"dutyFreeAmount": {
"money": {
"unit": "EUR",
"value": 29
}
},
"taxIncludedAmount": {
"money": {
"unit": "EUR",
"value": 31.9
},
"taxRate": 10
}
},
"priceAlteration": [
{
"applicationDuration": 3,
"description": "First 3 month get 50% off",
"name": "3 month for half",
"priceCondition": "new customer",
"priceType": "recurring",
"recurringChargePeriod": "monthly",
"validFor": {
"startDateTime": "2017-03-26T00:00",
"endDateTime": "2017-10-24T00:00"
},
"price": {
"percentage": 50
}
}
]
}
],
"cartItem": [
{
"action": "add",
"id": "8307",
"quantity": 1,
"status": "Active",
"note": {
"author": "Mr Smith",
"date": "2017-03-28T00:00",
"text": "Please wrap with double bag"
},
"product": {
"name": "Talk Simple 25",
"place": [
{
"href": "https://host:port/placeManagement/place/7396",
"id": "7396",
"name": "Main Store",
"role": "default delivery"
}
]
},
"productOffering": {
"href": "https://host:port/productCatalog/productOffering/14277",
"id": "14277",
"name": "Talk Simple 25"
}
}
]
}
Description
Usage Samples
Request
DELETE /shoppingCart/v1/shoppingCart/42
Response
204
API NOTIFICATIONS
For every single of operation on the entities use the following templates and provide sample REST
notification POST calls.
It is assumed that the Pub/Sub uses the Register and UnRegister mechanisms described in the REST
Guidelines reproduced below.
REGISTER LISTENER
POST /hub
Description
Sets the communication endpoint address the service instance must use to deliver information about its
health state, execution state, failures and metrics. Subsequent POST calls will be rejected by the service if
it does not support multiple listeners. In this case DELETE /api/hub/{id} must be called before an endpoint
can be created again.
Behavior
Usage Samples
Request
POST /api/hub
Accept: application/json
{"callback": "http://in.listener.com"}
Response
201
Content-Type: application/json
Location: /api/hub/42
{"id":"42","callback":"http://in.listener.com","query":null}
UNREGISTER LISTENER
DELETE /hub/{id}
Description
Clears the communication endpoint address that was set by creating the Hub.
Behavior
Usage Samples
Request
DELETE /api/hub/42
Accept: application/json
Response
204
POST /client/listener
Description
Clears the communication endpoint address that was set by creating the Hub.
Provides to a registered listener the description of the event that was raised. The /client/listener
url is the callback url passed when registering the listener.
Behavior
Returns HTTP/1.1 status code 201 if the service is able to set the configuration.
Usage Samples
Here's an example of a notification received by the listener. In this example “EVENT TYPE” should be
replaced by one of the notification types supported by this API (see Notification resources Models section)
and EVENT BODY refers to the data structure of the given notification type.
Request
POST /client/listener
Accept: application/json
{
"event": {
EVENT BODY
},
"eventType": "EVENT_TYPE"
}
Response
201
For detailed examples on the general TM Forum notification mechanism, see the TMF REST Design
Guidelines.
ACKNOWLEDGMENTS
RELEASE HISTORY
CONTRIBUTORS TO DOCUMENT