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

Discounts

Get discount assignments

Gets discount assignments filtered by productId and/or discountId. If no filters are provided, returns all assignments with pagination.

The shape of the response depends on which filters are supplied:

  • productId and discountId both set: returns a single assignment, or 404 if no such assignment exists.
  • productId only: returns an array of assignments for that product, or 404 if none exist.
  • supplierId only: returns an array of assignments for that supplier, or 404 if none exist.
  • discountId only: returns an array of assignments for that discount (200 with an empty array if none exist).
  • No filters: returns a paged envelope (pageNumber/pageSize). Note that totalCount in this envelope reflects the number of items on the current page, not the total row count across all pages.

Authentication: No access token is required for this endpoint.

query Parameters
productId
string <uuid>

Optional. Filter assignments by product identifier.

supplierId
string <uuid>

Optional. Filter assignments by supplier identifier.

discountId
string <uuid>

Optional. Filter assignments by discount identifier.

includeDisabled
boolean
Default: true

Optional. When true (default), includes inactive/disabled discounts.

pageNumber
integer <int32>
Default: 1

Optional. Page number for pagination (1-based). Only used when no productId, supplierId or discountId filter is supplied. Default is 1.

pageSize
integer <int32>
Default: 50

Optional. Number of items per page. Only used when no productId, supplierId or discountId filter is supplied. Default is 50, max 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

Get discount assignments (cursor pagination)

Gets all discount assignments with cursor-based pagination, ordered by updated date descending (ties broken by identifier).

page is an opaque cursor token; pass the nextPage value returned by a previous response to retrieve the next page. nextPage is only present in the response when the returned page is full (i.e. contains maxresults items), and is absent on the last page.

Authentication: No access token is required for this endpoint.

query Parameters
from
string <date-time>

Optional. Only return assignments updated or created on or after this date.

page
string

Optional. Cursor token from the previous response's nextPage field. Omit to retrieve the first page.

maxresults
integer <int32>
Default: 50

Optional. Maximum number of results per page. Default is 50, max is 100.

discountType
string
Enum: "Atomic" "PromoCode"

Optional. Filter assignments by the parent discount's type: Atomic for direct (automatically applied) discounts, or PromoCode for discounts that require a promo code at checkout. The filter is encoded into the returned nextPage cursor, so it stays in effect on later pages even if this parameter is omitted from the follow-up request. When omitted on the first page, assignments of both types are returned.

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

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)
promoCode
string or null

Promo code to apply to the cart as part of checkout. Optional; when provided, the code is validated and applied before the order is created.

Responses

Request samples

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

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

Validate a promo code against a shopping cart

Checks whether a promo code can be used on the given cart (exists, active, within its validity window, redemption limits not exceeded, and applicable to at least one product in the cart) without applying it or changing any pricing.

path Parameters
cartId
required
string <uuid>

id of the shopping cart

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:

the promo code to validate

code
required
string non-empty
customerEmail
string or null

Responses

Request samples

Content type
{
  • "code": "string",
  • "customerEmail": "string"
}

Response samples

Content type
No sample

Remove an applied promo code from a shopping cart

Clears any promo code applied to the cart: restores original pre-discount pricing on affected products and cancels the associated redemption. No-op if the cart has no applied promo code.

path Parameters
cartId
required
string <uuid>

id of the shopping cart

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