Skip to main content

Commerce API (v0)

Download OpenAPI specification:Download

The Commerce Service API

Availabilities

Availability and price search

Search for availability and price for a set of bookable products based on a search specification. Consumption of bookable products will start at some time and continue for a duration. The search specification allows for specifying a time interval for when consumption can start. The duration is of consumption is always specified as a fixed value in the search specification.

Returns a quotation containing information about availability and price for products satisfying the search specification. The returned quotation is valid for a limited period if time, and the response contains the expiration time for the quotation. When the expiration time has passed the client should redo the availability search to ensure that always valid information can be presented to the user.

The response can optionally be paginated through the page and maxresults parameters. The default value for page returns the first result page. The default value for maxresults returns all results. page can be set to the value returned in the nextpage property of the response to retrieve the next page of results. There is no guarantee that maxpage results will be returned even if a sufficient number of items are remaining. The nextpage property is not present in the response for the last result page.

This method supports grouping of products. Groping is enabled by specifying at least one attribute name in the GroupProducts field. All products with identical product category and identical values for all of these attributes will be grouped together. In the response the grouped products will be represented by a single product and one availability map entry per requested price and start date for consumption. The product returned will only contain the category identifier and the values of the grouping attributes. Grouping is not supported if pagination is used.

Authorizations:
oauth2
query Parameters
page
string

Token indicating the result page to retrieve, default is first page

maxresults
integer <int32>

Maximum number of availabilities to return for a result page

tenantId
string

Identifier which tenant we are working against. Will be prioritized over the Cenium-Tenant-Id

header Parameters
Cenium-Tenant-Id
string

Identifier which tenant we are working against.

Request Body schema:

Availability search specification

productCategoryId
required
string <uuid>

Products in this category will be considered for a match

searchFrom
required
string <date-time> non-empty

Matching products must be available to start consumption on or after this time

searchTo
required
string <date-time> non-empty

Matching products must be available to start consumption before this time

productId
string or null <uuid>

Restrict availability search to a specific product.

parentProductId
string or null <uuid>
Deprecated

Obsolete property, do not use

parentQuotationId
string or null <uuid>
Deprecated

Obsolete property, do not use

durationCount
integer or null <int32>

Used to indicate the length of stay. Size of DurationCount is defined by DurationIncrement, making it possible to book 2 days or 2 hours.

required
object (AttributeSearchSpecification)

Contains search specifications we need to get the correct products. Attributes defined will be used to filter products in commerce as well as in the adapter layer.

object (GroupAvailability)

Specification of how availability should be grouped in the response

Responses

Request samples

Content type
{
  • "productCategoryId": "1e32231d-b8a1-4145-b539-820301c2af64",
  • "searchFrom": "2019-08-24T14:15:22Z",
  • "searchTo": "2019-08-24T14:15:22Z",
  • "productId": "dcd53ddb-8104-4e48-8cc0-5df1088c6113",
  • "parentProductId": "1ffe8af3-a0f6-480d-b0be-350ab24a5fb9",
  • "parentQuotationId": "4261cdd9-02fd-4d98-9a4a-c018d49e36f7",
  • "durationCount": 0,
  • "searchSpecification": {
    },
  • "groupBy": {
    }
}

Response samples

Content type
No sample

Products

Get category

Returns a single product category related to the supplied id.

Authorizations:
oauth2
path Parameters
id
required
string <uuid>

Category identifier.

query Parameters
tenantId
string

Identifier which tenant we are working against. Will be prioritized over the Cenium-Tenant-Id

header Parameters
Cenium-Tenant-Id
string

Identifier which tenant we are working against.

Responses

Response samples

Content type
No sample

Get all products with pagination

Get all products, optionally filtered by a product category.

Results can optionally be paginated by specifying the page and maxresults parameters. The default valye for page returns the first result page. The default value for maxresults returns all results. page can be set to the value of the nextpage property fro a response to return the next page of results.

There is no guarantee that maxresults results will be returned even if more results are available, but at least one result will always be returned. The nextpage property is not defined for the last result page.

Authorizations:
oauth2
query Parameters
category
string <uuid>

Optionally return only products from a product category

includeDisabled
boolean
Default: false

Include products that are currently disabled

page
string

Token indicating which result page to retrieve, default is first page

maxresults
integer <int32>
Default: 100

Maximum number of results to return for a result page, default is 100

tenantId
string

Identifier which tenant we are working against. Will be prioritized over the Cenium-Tenant-Id

header Parameters
Cenium-Tenant-Id
string

Identifier which tenant we are working against.

Responses

Response samples

Content type
No sample

ShoppingCarts

Get shopping cart

Retrieve a shopping cart based on its identifier.

Authorizations:
oauth2
path Parameters
cartId
required
string <uuid>
query Parameters
tenantId
string

Identifier which tenant we are working against. Will be prioritized over the Cenium-Tenant-Id

header Parameters
Cenium-Tenant-Id
string

Identifier which tenant we are working against.

Responses

Response samples

Content type
No sample

Emptiy shopping cart

Remove all products in the cart but retains the empty cart.

Authorizations:
oauth2
path Parameters
cartId
required
string <uuid>

id of the user

query Parameters
tenantId
string

Identifier which tenant we are working against. Will be prioritized over the Cenium-Tenant-Id

header Parameters
Cenium-Tenant-Id
string

Identifier which tenant we are working against.

Responses

Response samples

Content type
No sample

Create shopping cart

Create a new empty shopping cart. The shopping cart has an ID that can be used in subsequent calls to the shopping cart APIs to manipulate or inspect the shopping cart. The shopping cart is valid for 6 hours after creation.

Authorizations:
oauth2
path Parameters
currency
required
string
query Parameters
tenantId
string

Identifier which tenant we are working against. Will be prioritized over the Cenium-Tenant-Id

header Parameters
Cenium-Tenant-Id
string

Identifier which tenant we are working against.

Request Body schema:
Array
salesChannel
string or null

Responses

Request samples

Content type
[
  • {
    }
]

Response samples

Content type
No sample

Checkout shopping cart

Checking out the shopping cart places orders for all products in the cart.

Authorizations:
oauth2
path Parameters
cartId
required
string <uuid>
query Parameters
tenantId
string

Identifier which tenant we are working against. Will be prioritized over the Cenium-Tenant-Id

header Parameters
Cenium-Tenant-Id
string

Identifier which tenant we are working against.

Request Body schema:
profileId
string or null
primaryGuestName
string or null
Deprecated

Deprecated. PrimaryGuestName is misleading. Use CardholderName instead.

cardholderName
string or null
email
string or null
phone
string or null
notes
string or null
paymentIsOptional
boolean
createConfirmedBookings
boolean
Array of objects or null (ConsumerUpdateDTO)
Array of objects or null (OrderLineUpdateDto)

Responses

Request samples

Content type
{
  • "profileId": "string",
  • "primaryGuestName": "string",
  • "cardholderName": "string",
  • "email": "string",
  • "phone": "string",
  • "notes": "string",
  • "paymentIsOptional": true,
  • "createConfirmedBookings": true,
  • "consumerUpdates": [
    ],
  • "orderLineUpdates": [
    ]
}

Response samples

Content type
No sample

Cancel the shopping cart and reservations

Cancel the shopping cart and any order that has been placed in the corresponding fulfillment system.

Authorizations:
oauth2
path Parameters
cartId
required
string <uuid>
query Parameters
tenantId
string

Identifier which tenant we are working against. Will be prioritized over the Cenium-Tenant-Id

header Parameters
Cenium-Tenant-Id
string

Identifier which tenant we are working against.

Request Body schema:
reason
required
string non-empty

Responses

Request samples

Content type
{
  • "reason": "string"
}

Response samples

Content type
No sample

Register payment

Register information about a payment transaction on the cart. Multiple payment transactions can be registered. A payment transaction is uniquely identified by the combination of the fields cardType and reference. The paymentStatus can be updated from Pending to Paid by calling this method again with the same cardType, reference and amount.

No information is sent to fulfillment systems for pending payments. Information about paid payments is sent to the fulfillment system to the extent this is supported by the relevant fulfillment system.

Authorizations:
oauth2
path Parameters
cartId
required
string <uuid>

Shopping cart identifier

query Parameters
tenantId
string

Identifier which tenant we are working against. Will be prioritized over the Cenium-Tenant-Id

header Parameters
Cenium-Tenant-Id
string

Identifier which tenant we are working against.

Request Body schema:

Payment to be registered

amount
required
number <double>

Payment amount

cardType
string or null

Card type, not used by the platform except together with Reference as an indeitifer for the payment

reference
required
string non-empty

Payment reference, not used by the platform except together with CardType as an identifier for the payment

timestamp
required
string <date-time> non-empty

Payment information timestamp, not used by the platform

paymentStatus
required
string (PaymentStatus)
Enum: "Pending" "Paid"

Status of a payment transaction

Responses

Request samples

Content type
{
  • "amount": 0.1,
  • "cardType": "string",
  • "reference": "fulfillmentReference value from /v0/ShoppingCarts/{cartId}/Checkout response",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "paymentStatus": "Pending"
}

Response samples

Content type
No sample

Delete product from cart

Deletes a shopping cart item in the selected cart.

Authorizations:
oauth2
path Parameters
cartId
required
string <uuid>

id of the cart

cartItemId
required
string <uuid>

id of the cart item

query Parameters
tenantId
string

Identifier which tenant we are working against. Will be prioritized over the Cenium-Tenant-Id

header Parameters
Cenium-Tenant-Id
string

Identifier which tenant we are working against.

Responses

Response samples

Content type
No sample

Add product to cart

Adds a product to the cart. The product is identified by an availability price map identifier obtained from a call to availability and price search. See the Availabilities API.

Authorizations:
oauth2
path Parameters
cartId
required
string <uuid>

id of the shopping cart

availabilityPriceMapId
required
string <uuid>

Availability price map containing information about what we are adding to the cart

qty
required
integer <int32>
query Parameters
tenantId
string

Identifier which tenant we are working against. Will be prioritized over the Cenium-Tenant-Id

header Parameters
Cenium-Tenant-Id
string

Identifier which tenant we are working against.

Responses

Response samples

Content type
No sample