Cart Service

The Cart Service allows you to manage the cart and items added to it.

This is the documentation for version v1 of the API. Last update on Sep 14, 2021.

Base URL
https://api.emporix.io/cart

Carts

Retrieving a cart's details by criteria

Retrieves a cart's details based on the store's site code and criteria such as session ID or customer ID.


Required scopes
  • cart.cart_manage

    Note: Only required if the access_token used to authorize the request and the customerId passed in the query parameter belong to different customers.

Headers
  • Authorization Required / string

    Depending which type of cart you want to retrieve, a different access token needs to be used to authorize the request.
    | Cart type | Access token |
    |---|---|
    | Anonymous customer's cart | Anonymous token |
    | Logged in customer's cart | Customer's access token. |

Path parameters
  • tenant Required / string

    Name of the tenant.

    Note: Name of the tenant is always written in lowercase.

Query parameters
  • sessionId string

    Customer's unique session identifier.

    Note: The sessionId is only required if you want to retrieve an anonymous customer's cart.

  • customerId string

    Customer’s unique identifier generated when a customer’s account is created.

    Note: The customerId is only required if you want to create a cart for a logged in customer.

  • siteCode Required / string

    Site’s unique identifier. A site is a specific shop.

    If the tenant owns only one shop, the value should be set to main.

  • create boolean

    If set to true and no cart exists for the specified criteria, a new cart will be created.

Responses
  • 200 object

    The request was successful. Cart details are returned.

    • id string

      Cart’s unique identifier generated when a cart is created.

    • yrn string

      In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

      It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

    • customerId string

      Customer’s unique identifier generated when a customer’s account is created through the Customer Service.

    • currency string

      Three-letter currency code, compliant with the ISO 4217 standard.

    • deliveryWindowId string

      Delivery window's unique identifier, as defined in the Shipping Service.

    • siteCode Required / string

      Site’s unique identifier. A site is a specific shop.

    • type string

      Cart type.

    • zipCode string

      Customer's address - zip code.

    • countryCode string

      Two-letter country code, compliant with the ISO 3166 standard.

    • channel object

      Channel through which the cart was created.

      • name string
      • source string
    • items array[object]

      Items added to the cart.

      • id string

        Cart item's unique identifier generated when the item is added to cart.

      • yrn string

        In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

        It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

      • product object

        Product details.

        • id string

          Product’s unique identifier generated when the product is created through the Product Service.

        • sku string

          Product Stock Keeping Unit (SKU).

        • yrn string

          In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

          It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

        • name string

          Product name.

        • description string

          Product description.

        • images array[object]

          List of product images.

          • id Required / string

            Product image''s unique identifier, generated when the image is added through the Product Service.

          • url Required / string(uri)

            Product image's URL with the file extension specified.

        • metadata object
          • mixins object

            Links to mixin schemas.

        • mixins object
      • itemYrn string

        In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

        It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

      • quantity Required / number(double)

        Quantity of the product added to cart.

        Minimum value is 0.

      • effectiveQuantity Required / number(double)

        Effective quantity of the product added to cart.

        Minimum value is 0.

      • price object

        Price details.

        • priceId Required / string

          Price’s unique identifier generated when the price is created through the Price Service.

        • yrn string

          In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

          It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

        • originalAmount Required / number

          Product’s regular price per specified measurementUnit.

          Minimum value is 0.

        • effectiveAmount Required / number

          Actual amount the customer will pay per specified measurementUnit.

          Minimum value is 0.

        • currency Required / string

          Three-letter currency code, compliant with the ISO 4217 standard.

        • measurementUnit object

          Information about the unit by which the customer can order the product.

          • quantity Required / number(double)

            Quantity of the measurement unit.

            For example, if the customer can order a product by one piece, the value should be set to 1.

            Minimum value is 0.

          • unitCode string

            Code of the measurement unit by which the customer can order the product. The possible values for the unitCode field are explained in the table below:
            | | |
            | --- | --- |
            | Value | Measurement unit |
            | H87 | Pieces |
            | KGM | Kilograms |
            | GRM | Grams |
            | LTR | Liters |
            | MLT | Milliliters |
            | MTR | Meters |
            | RO | Rolls |

            For example, if the customer can order a product by pieces, the value should be set to H87.

            Values are kg, g, mg, l, ml, lb, qt, qtr, gal, pt, oz, MTR, XRO, MLT, LTR, H87, KGM, GRM, HLT, DL, DAG, and RO.

      • taxCode string

        Tax code. Tax indicated in this field overrides the site's default tax value.

      • itemPrice object
        • amount Required / number(double)

          Price.

          Minimum value is 0.

        • currency Required / string

          Three-letter currency code, compliant with the ISO 4217 standard.

      • totalTax number(double)

        Product's total tax amount.

        Minimum value is 0.

      • itemTaxInfo array[object]

        Product tax information.

        • name string

          Tax name.

        • value object
          • amount Required / number(double)

            Price.

            Minimum value is 0.

          • currency Required / string

            Three-letter currency code, compliant with the ISO 4217 standard.

        • rate number(double)

          Tax rate.

      • metadata object
        • mixins object

          Links to mixin schemas.

      • mixins object
      • fees object
        • lines array[object]
          • yrn string

            In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

            It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

          • taxCode string
          • amount Required / number(double)

            Minimum value is 0.

          • totalTax Required / number(double)

            Minimum value is 0.

          • total Required / object
            • subTotal number

              Subtotal for the products.

            • totalTax number

              Total tax for the products.

            • total number

              Total amount the customer will pay for the products.

          • taxValues array[object]
            • name string

              Tax name.

            • value object
              • amount Required / number(double)

                Price.

                Minimum value is 0.

              • currency Required / string

                Three-letter currency code, compliant with the ISO 4217 standard.

            • rate number(double)

              Tax rate.

        • total object
          • subTotal number

            Subtotal for the products.

          • totalTax number

            Total tax for the products.

          • total number

            Total amount the customer will pay for the products.

      • authorizedAmount object
        • amount Required / number(double)

          Price.

          Minimum value is 0.

        • currency Required / string

          Three-letter currency code, compliant with the ISO 4217 standard.

    • discounts array[object]

      Discounts applied to the cart.

      • id string

        Discount's unique identifier.

      • yrn string

        In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

        It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

      • couponYrn string

        In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

        It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

      • code Required / string

        Discount code generated when a discount coupon is created through the Coupon Service.

      • amount number(double)

        Discount expressed as fixed amount.

        Minimum value is 0.

      • currency string

        Three-letter currency code, compliant with the ISO 4217 standard.

      • discountRate number(double)

        Discount expressed as a percentage of the price.

        Minimum value is 0.

      • name string

        Discount's displayed name.

      • calculationType string

        Calculation type specifies how the discount should be calculated. Can be set to one of the following:

        • ApplyDiscountBeforeTax
        • ApplyDiscountAfterTax

        Values are ApplyDiscountBeforeTax and ApplyDiscountAfterTax. Default value is ApplyDiscountBeforeTax.

      • sequenceId integer

        The sequence number indicating at which point should the discount be applied to the cart.

        Note: This field is only required if there are multiple discounts which need to be applied in a specific order.

        Minimum value is 0. Default value is 1.

      • valid boolean

        Flag indicating whether the discount is valid.
        Invalid discounts are not taken into account when the cart is calculated.

        Default value is true.

      • links array[object]

        Links to Coupon Service endpoints used to validate and redeem the discount.

        • rel Required / string

          Action to be done using the endpoint provided in the href field.

          Values are validate and redeem.

        • title string

          Detailed link description.

        • href Required / string

          Endpoint used to validate or redeem the discount.

        • type Required / string

          Content type.

      • discountValidationDetails object
        • message string
        • details array[string]
    • feeYrnAggregate object
      • lines array[object]
        • yrn string

          In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

          It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

        • taxCode string
        • amount Required / number(double)

          Minimum value is 0.

        • totalTax Required / number(double)

          Minimum value is 0.

        • total Required / object
          • subTotal number

            Subtotal for the products.

          • totalTax number

            Total tax for the products.

          • total number

            Total amount the customer will pay for the products.

        • taxValues array[object]
          • name string

            Tax name.

          • value object
            • amount Required / number(double)

              Price.

              Minimum value is 0.

            • currency Required / string

              Three-letter currency code, compliant with the ISO 4217 standard.

          • rate number(double)

            Tax rate.

      • total object
        • subTotal number

          Subtotal for the products.

        • totalTax number

          Total tax for the products.

        • total number

          Total amount the customer will pay for the products.

    • totalPrice object
      • amount Required / number(double)

        Price.

        Minimum value is 0.

      • currency Required / string

        Three-letter currency code, compliant with the ISO 4217 standard.

    • subTotalPrice object
      • amount Required / number(double)

        Price.

        Minimum value is 0.

      • currency Required / string

        Three-letter currency code, compliant with the ISO 4217 standard.

    • shipping object

      Shipping cost information.

      • fee object
        • amount Required / number(double)

          Price.

          Minimum value is 0.

        • currency Required / string

          Three-letter currency code, compliant with the ISO 4217 standard.

    • totalUnitsCount number(double)

      Total number of items added to the cart.

    • sessionId string

      Customer's unique session identifier.

    • metadata object
      • createdAt Required / string

        Date and time when the object was created, compliant with the ISO 8601 format.

      • modifiedAt Required / string

        Date and time when the object was last modified, compliant with the ISO 8601 format.

      • version Required / integer

        Minimum value is 1.

      • mixins object
    • totalTax object
      • amount Required / number(double)

        Price.

        Minimum value is 0.

      • currency Required / string

        Three-letter currency code, compliant with the ISO 4217 standard.

    • taxAggregate object
      • lines array[object]
        • name string

          The tax name e.g.: CANADA GST/TPS

        • amount number(double)

          The tax amount for the line.

        • rate number(double)

          The tax rate is a percentage between 0 and 100, e.g.: 5.00

        • taxable number(double)

          The taxable amount.

    • totalDiscount object
      • amount Required / number(double)

        Price.

        Minimum value is 0.

      • currency Required / string

        Three-letter currency code, compliant with the ISO 4217 standard.

    • taxDescription string

      Information about the applied tax.

    • mixins object
    • itemFeesTotal object
      • subTotal number

        Subtotal for the products.

      • totalTax number

        Total tax for the products.

      • total number

        Total amount the customer will pay for the products.

    • paymentFeesTotal object
      • subTotal number

        Subtotal for the products.

      • totalTax number

        Total tax for the products.

      • total number

        Total amount the customer will pay for the products.

    • leadTime integer

      Time needed to prepare products for delivery, expressed in hours.

    • nonDelivery array[string]

      List of days on which the products cannot be delivered.

    • totalAuthorizedAmount object
      • amount Required / number(double)

        Price.

        Minimum value is 0.

      • currency Required / string

        Three-letter currency code, compliant with the ISO 4217 standard.

  • 400 object

    The request was syntactically incorrect. Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 401 object

    Given request is unauthorized - the authorization token is invalid or has expired.

    Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 403 object

    Given authorization scopes are not sufficient and do not match scopes required by the endpoint.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 500 object

    Some server-side error occurred. Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 503 object

    Service temporarily unavailable.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

GET /{tenant}/carts
$ curl \
 -X GET https://api.emporix.io/cart/{tenant}/carts?siteCode=string \
 -H "Authorization: Bearer {access_token}"
Response example (200)
{
  "id": "612c9ae63cff1d66f699b691",
  "yrn": "{cartYrn}",
  "customerId": "87413250",
  "currency": "EUR",
  "siteCode": "main",
  "sessionId": "YxXRjn9zSFM7gMq5dtNKarX7xYkIMV",
  "metadata": {
    "createdAt": "2021-08-30T08:46:30.780Z",
    "modifiedAt": "2021-08-30T08:46:30.786Z",
    "version": 1
  },
  "leadTime": 0
}
Response example (400)
{
  "status": 400,
  "message": "There are validation problems, see details section for more information",
  "moreInfo": "",
  "type": "validation_violation",
  "details": [
    {
      "field": "Accept-Language",
      "message": "not a language",
      "type": "invalid_header"
    }
  ]
}
Response example (401)
{
  "fault": {
    "faultstring": "Access Token expired",
    "detail": {
      "errorcode": "keymanagement.service.access_token_expired"
    }
  }
}
Response example (403)
{
  "type": "insufficient_permissions",
  "status": 403,
  "message": "User not authorized."
}
Response example (500)
{
  "type": "internal_service_error",
  "status": 500,
  "message": "Something went wrong while processing the request. The error has been logged under code 20210819_095055_677_vwurkrl."
}
Response example (503)
{
  "type": "service_temporarily_unavailable",
  "status": 503,
  "message": "Service is temporarily unavailable due to overload or maintenance, try again later"
}

Creating a new cart

Creates a new cart. When a cart is created, its status is set to open.

Note: There can be only one open cart per customer. If another cart needs to be created for a specific customer, you need to update the existing cart's status to closed.


Required scopes
  • cart.cart_manage

    Note: Only required if the following conditions are met:

    • You want to create a cart for a logged in customer.
    • The access_token used to authorize the request and the customerId in the request body belong to different customers.
Headers
  • Authorization Required / string

    Depending which type of cart you want to create, a different access token needs to be used to authorize the request.
    | Cart type | Access token |
    |---|---|
    | Anonymous customer's cart | Anonymous token |
    | Logged in customer's cart | Customer's access token. |

  • Content-Type Required / string

    Default value is application/json.

  • session-id string

    Anonymous customer's unique session identifier.

    Note: The session-id is only required if you want to create a cart for an anonymous customer.

  • saas-token string

    Customer’s saasToken generated when the customer token is generated.

    Note: The saas-token is only required if you want to create a cart for a logged in customer.

Path parameters
  • tenant Required / string

    Name of the tenant.

    Note: Name of the tenant is always written in lowercase.

Body
  • customerId string

    Customer’s unique identifier generated when a customer’s account is created through the Customer Service.

  • currency Required / string

    Three-letter currency code, compliant with the ISO 4217 standard.

  • deliveryWindowId string

    Delivery window's unique identifier, as defined in the Shipping Service.

  • siteCode string

    Site’s unique identifier. A site is a specific shop.

    If the tenant owns only one shop, the value should be set to main.

    Default value is default.

  • type string

    Cart type. You can use this field if your store offers different types of carts, such as shopping carts and wishlists.

  • channel object

    Channel through which the cart was created.

    • name string
    • source string
  • metadata object
    • mixins object

      Links to mixin schemas.

  • mixins object
  • sessionValidated boolean

    If set to true, endpoints will validate whether the session-id used to create the cart matches the session-id passed in the request header.

    Note: The sessionValidated parameter only applies to anonymous customers’ carts.

  • leadTime integer

    Time needed to prepare products for delivery, expressed in hours.

  • nonDelivery array[string]

    List of days on which the products cannot be delivered.

Responses
  • 201 object

    The request was successful. Cart details are returned.

    • Location string(uri)

      Location of the newly created cart.

    • Version integer

      Cart version.

    • cartId Required / string

      Cart's unique identifier.

    • yrn Required / string

      In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

      It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

  • 400 object

    The request was syntactically incorrect. Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 403 object

    Given authorization scopes are not sufficient and do not match scopes required by the endpoint.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 409 object

    The request could not be completed due to a conflict with the current state of the target resource.

    • code number

      Original HTTP error code. It should be consistent with the HTTP response code.

    • status string

      Classification of the error.

    • message string

      Descriptive error message for debugging purposes.

  • 500 object

    Some server-side error occurred. Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 503 object

    Service temporarily unavailable.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

POST /{tenant}/carts
$ curl \
 -X POST https://api.emporix.io/cart/{tenant}/carts \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer {access_token}" \
 -H "Content-Type: string" \
 -H "session-id: string" \
 -H "saas-token: string" \
 -d '{"siteCode":"main","currency":"EUR","type":"shopping","channel":{"name":"storefront","source":"https://your-storefront.com/"},"leadTime":24,"nonDelivery":["5","6"],"sessionValidated":true}'
Request payload example
# Headers
Authorization: Bearer {access_token}
Content-Type: string
session-id: string
saas-token: string

# Payload
{
  "siteCode": "main",
  "currency": "EUR",
  "type": "shopping",
  "channel": {
    "name": "storefront",
    "source": "https://your-storefront.com/"
  },
  "leadTime": 24,
  "nonDelivery": [
    "5",
    "6"
  ],
  "sessionValidated": true
}
Response example (201)
# Headers
Location: https://example.com
Version: 42

# Payload
{
  "cartId": "{cartId}",
  "yrn": "{cartYrn}"
}
Response example (400)
{
  "status": 400,
  "message": "There are validation problems, see details section for more information",
  "moreInfo": "",
  "type": "validation_violation",
  "details": [
    {
      "field": "Accept-Language",
      "message": "not a language",
      "type": "invalid_header"
    }
  ]
}
Response example (403)
{
  "type": "insufficient_permissions",
  "status": 403,
  "message": "User not authorized."
}
Response example (409)
{
  "code": 409,
  "status": "Conflict",
  "message": "The version of the object that you are trying to update has already changed. Please refresh and try again with the latest version!"
}
Response example (500)
{
  "type": "internal_service_error",
  "status": 500,
  "message": "Something went wrong while processing the request. The error has been logged under code 20210819_095055_677_vwurkrl."
}
Response example (503)
{
  "type": "service_temporarily_unavailable",
  "status": 503,
  "message": "Service is temporarily unavailable due to overload or maintenance, try again later"
}

Changesite

Changing a cart's site

Changes a specified cart's site. The following cart settings are changed according to the new site:

  • Language
  • Currency
  • Shipment
  • Tax
  • Payment

In case the new site uses a different currency, the endpoint sends a price match request to the Price Service. This ensures that items in cart display correct prices in the new site's currency.


Required scopes

No scopes are required.

Headers
  • Authorization Required / string

    Depending which type of cart you want to change the site for, a different access token needs to be used to authorize the request.
    | Cart type | Access token |
    |---|---|
    | Anonymous customer's cart | Anonymous token |
    | Logged in customer's cart | Customer's access token. |

  • Accept-Language string

    List of natural languages acceptable for the response.

  • Content-Language string

    List of acceptable natural languages of the customers.

  • languages string

    You can use the languages header to apply the request to carts for which a particular localization attribute (language) has been specified.

    You can specify multiple languages by separating them with commas.

Path parameters
  • tenant Required / string

    Name of the tenant.

    Note: Name of the tenant is always written in lowercase.

Body
  • siteCode Required / string

    Site’s unique identifier. A site is a specific shop.

Responses
  • 200

    All item's currencies are updated.

  • 400 object

    The request was syntactically incorrect. Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 403 object

    Given authorization scopes are not sufficient and do not match scopes required by the endpoint.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 404 object

    The requested resource does not exist.

    • code number

      Original HTTP error code. It should be consistent with the HTTP response code.

    • status string

      Classification of the error.

    • message string

      Descriptive error message for debugging purposes.

  • 500 object

    Some server-side error occurred. Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 503 object

    Service temporarily unavailable.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

POST /{tenant}/carts/{cartId}/changeSite
$ curl \
 -X POST https://api.emporix.io/cart/{tenant}/carts/{cartId}/changeSite \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer {access_token}" \
 -H "Accept-Language: string" \
 -H "Content-Language: string" \
 -H "languages: string" \
 -d '{"siteCode":"USA"}'
Request payload example
# Headers
Authorization: Bearer {access_token}
Accept-Language: string
Content-Language: string
languages: string

# Payload
{
  "siteCode": "USA"
}
Response example (400)
{
  "status": 400,
  "message": "There are validation problems, see details section for more information",
  "moreInfo": "",
  "type": "validation_violation",
  "details": [
    {
      "field": "Accept-Language",
      "message": "not a language",
      "type": "invalid_header"
    }
  ]
}
Response example (403)
{
  "type": "insufficient_permissions",
  "status": 403,
  "message": "User not authorized."
}
Response example (404)
{
  "code": 404,
  "status": "Not Found",
  "message": "Cart with code 612cc4783cff1d66f699b6a1 not found."
}
Response example (500)
{
  "type": "internal_service_error",
  "status": 500,
  "message": "Something went wrong while processing the request. The error has been logged under code 20210819_095055_677_vwurkrl."
}
Response example (503)
{
  "type": "service_temporarily_unavailable",
  "status": 503,
  "message": "Service is temporarily unavailable due to overload or maintenance, try again later"
}

Discounts

Applying a discount to cart

Applies a discount on the specified cart.


Required scopes

No scopes are required.

Headers
  • Content-Type Required / string

    Default value is application/json.

  • Authorization Required / string

    Depending which type of cart you want to apply the discount to, a different access token needs to be used to authorize the request.
    | Cart type | Access token |
    |---|---|
    | Anonymous customer's cart | Anonymous token |
    | Logged in customer's cart | Customer''s access token. |

Path parameters
  • tenant Required / string

    Name of the tenant.

    Note: Name of the tenant is always written in lowercase.

Body
  • id string

    Discount's unique identifier.

  • couponYrn string

    In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

    It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

  • code Required / string

    Discount code generated when a discount coupon is created through the Coupon Service.

  • currency Required / string

    Three-letter currency code, compliant with the ISO 4217 standard.

  • amount number(double)

    Discount expressed as fixed amount.

    Minimum value is 0.

  • name string

    Discount's displayed name.

  • discountRate number(double)

    Discount expressed as a percentage of the price.

    Minimum value is 0.

  • sequenceId integer

    The sequence number indicating at which point should the discount be applied to the cart.

    Note: This field is only required if there are multiple discounts which need to be applied in a specific order.

    Minimum value is 0. Default value is 0.

  • calculationType string

    Calculation type specifies how the discount should be calculated. Can be set to one of the following:

    • ApplyDiscountBeforeTax
    • ApplyDiscountAfterTax

    Values are ApplyDiscountBeforeTax and ApplyDiscountAfterTax. Default value is ApplyDiscountBeforeTax.

  • links array[object]

    Links to Coupon Service endpoints used to validate and redeem the discount.

    • rel Required / string

      Action to be done using the endpoint provided in the href field.

      Values are validate and redeem.

    • title string

      Detailed link description.

    • href Required / string

      Endpoint used to validate or redeem the discount.

    • type Required / string

      Content type.

Responses
  • 200 object

    The request was successful. The discount has been applied to cart.

    • yrn Required / string

      In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

      It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

    • discountId Required / string
  • 400 object

    The request was syntactically incorrect. Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 403 object

    Given authorization scopes are not sufficient and do not match scopes required by the endpoint.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 404 object

    The requested resource does not exist.

    • code number

      Original HTTP error code. It should be consistent with the HTTP response code.

    • status string

      Classification of the error.

    • message string

      Descriptive error message for debugging purposes.

  • 500 object

    Internal Server Error

    • code number

      Original HTTP error code. It should be consistent with the HTTP response code.

    • status string

      Classification of the error.

    • message string

      Descriptive error message for debugging purposes.

POST /{tenant}/carts/{cartId}/discounts
$ curl \
 -X POST https://api.emporix.io/cart/{tenant}/carts/{cartId}/discounts \
 -H "Content-Type: application/json" \
 -H "Content-Type: string" \
 -H "Authorization: Bearer {access_token}" \
 -d '{"code":"DEVIZU","amount":10,"currency":"EUR","name":"Thanksgiving coupon for all orders","calculationType":"ApplyDiscountBeforeTax","links":[{"title":"THANKSGIVING10","rel":"validate","type":"application/json","href":"https://api.emporix.io/coupon/{tenant}/coupons/THANKSGIVING10"},{"title":"THANKSGIVING10 redeem","rel":"redeem","type":"application/json","href":"https://api.emporix.io/coupon/{tenant}/coupons/THANKSGIVING10/redemptions"}]}'
Request payload example
# Headers
Content-Type: string
Authorization: Bearer {access_token}

# Payload
{
  "code": "DEVIZU",
  "amount": 10,
  "currency": "EUR",
  "name": "Thanksgiving coupon for all orders",
  "calculationType": "ApplyDiscountBeforeTax",
  "links": [
    {
      "title": "THANKSGIVING10",
      "rel": "validate",
      "type": "application/json",
      "href": "https://api.emporix.io/coupon/{tenant}/coupons/THANKSGIVING10"
    },
    {
      "title": "THANKSGIVING10 redeem",
      "rel": "redeem",
      "type": "application/json",
      "href": "https://api.emporix.io/coupon/{tenant}/coupons/THANKSGIVING10/redemptions"
    }
  ]
}
Response example (200)
{
  "yrn": "{discountYrn}",
  "discountId": "1"
}
Response example (400)
{
  "status": 400,
  "message": "There are validation problems, see details section for more information",
  "moreInfo": "",
  "type": "validation_violation",
  "details": [
    {
      "field": "Accept-Language",
      "message": "not a language",
      "type": "invalid_header"
    }
  ]
}
Response example (403)
{
  "type": "insufficient_permissions",
  "status": 403,
  "message": "User not authorized."
}
Response example (404)
{
  "code": 404,
  "status": "Not Found",
  "message": "Cart with code 612cc4783cff1d66f699b6a1 not found."
}
Response example (500)
{
  "code": 500,
  "status": "Internal Server Error",
  "message": "Discount currency is CAD and is not equal to cart currency EUR."
}

Removing all discounts from cart

Removes all discounts applied to the specified cart.


Required scopes

No scopes are required.

Headers
  • Authorization Required / string

    Depending which type of cart you want to remove discounts from, a different access token needs to be used to authorize the request.
    | Cart type | Access token |
    |---|---|
    | Anonymous customer's cart | Anonymous token |
    | Logged in customer's cart | Customer's access token. |

Path parameters
  • tenant Required / string

    Name of the tenant.

    Note: Name of the tenant is always written in lowercase.

Responses
  • 204

    The request was successful. Discounts have been removed.

  • 400 object

    The request was syntactically incorrect. Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 403 object

    Given authorization scopes are not sufficient and do not match scopes required by the endpoint.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 404 object

    The requested resource does not exist.

    • code number

      Original HTTP error code. It should be consistent with the HTTP response code.

    • status string

      Classification of the error.

    • message string

      Descriptive error message for debugging purposes.

  • 500 object

    Some server-side error occurred. Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

DELETE /{tenant}/carts/{cartId}/discounts
$ curl \
 -X DELETE https://api.emporix.io/cart/{tenant}/carts/{cartId}/discounts \
 -H "Authorization: Bearer {access_token}"
Response example (400)
{
  "status": 400,
  "message": "There are validation problems, see details section for more information",
  "moreInfo": "",
  "type": "validation_violation",
  "details": [
    {
      "field": "Accept-Language",
      "message": "not a language",
      "type": "invalid_header"
    }
  ]
}
Response example (403)
{
  "type": "insufficient_permissions",
  "status": 403,
  "message": "User not authorized."
}
Response example (404)
{
  "code": 404,
  "status": "Not Found",
  "message": "Cart with code 612cc4783cff1d66f699b6a1 not found."
}
Response example (500)
{
  "type": "internal_service_error",
  "status": 500,
  "message": "Something went wrong while processing the request. The error has been logged under code 20210819_095055_677_vwurkrl."
}

Dtrestrictions

Retrieving lead time and non-delivery times for a cart

Retrieves the lead time and non-delivery times for a specified cart.


Required scopes
  • cart.cart_manage

    Note: Only required if the access_token used to authorize the request and the customerId passed in the query parameter belong to different customers.

Headers
  • Authorization Required / string

    Depending which type of cart you want to retrieve lead time and non-delivery windows for, a different access token needs to be used to authorize the request.
    | Cart type | Access token |
    |---|---|
    | Anonymous customer's cart | Anonymous token |
    | Logged in customer's cart | Customer's access token. |

Path parameters
  • tenant Required / string

    Name of the tenant.

    Note: Name of the tenant is always written in lowercase.

Responses
  • 200 object

    The request was successful. Cart lead time and non delivery times are returned.

    • leadTime integer

      Time needed to prepare products for delivery, expressed in hours.

    • nonDelivery array[string]

      List of days on which the products cannot be delivered.

  • 400 object

    The request was syntactically incorrect. Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 403 object

    Given authorization scopes are not sufficient and do not match scopes required by the endpoint.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 404 object

    The requested resource does not exist.

    • code number

      Original HTTP error code. It should be consistent with the HTTP response code.

    • status string

      Classification of the error.

    • message string

      Descriptive error message for debugging purposes.

  • 500 object

    Some server-side error occurred. Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

GET /{tenant}/carts/{cartId}/dtRestrictions
$ curl \
 -X GET https://api.emporix.io/cart/{tenant}/carts/{cartId}/dtRestrictions \
 -H "Authorization: Bearer {access_token}"
Response example (200)
{
  "leadTime": 10,
  "nonDelivery": [
    "1",
    "3",
    "5"
  ]
}
Response example (400)
{
  "status": 400,
  "message": "There are validation problems, see details section for more information",
  "moreInfo": "",
  "type": "validation_violation",
  "details": [
    {
      "field": "Accept-Language",
      "message": "not a language",
      "type": "invalid_header"
    }
  ]
}
Response example (403)
{
  "type": "insufficient_permissions",
  "status": 403,
  "message": "User not authorized."
}
Response example (404)
{
  "code": 404,
  "status": "Not Found",
  "message": "Cart with code 612cc4783cff1d66f699b6a1 not found."
}
Response example (500)
{
  "type": "internal_service_error",
  "status": 500,
  "message": "Something went wrong while processing the request. The error has been logged under code 20210819_095055_677_vwurkrl."
}

Items

Retrieving all products added to a cart

Retrieves all items added to the specified cart.


Required scopes
  • cart.cart_manage

    Note: Only required if the access_token used to authorize the request and the customerId passed in the query parameter belong to different customers.

Headers
  • Authorization Required / string

    Depending which type of cart you want to retrieve items for, a different access token needs to be used to authorize the request.
    | Cart type | Access token |
    |---|---|
    | Anonymous customer's cart | Anonymous token |
    | Logged in customer's cart | Customer's access token. |

Path parameters
  • tenant Required / string

    Name of the tenant.

    Note: Name of the tenant is always written in lowercase.

Responses
  • 200 array[object]

    The request was successful. Cart items are returned.

    • id string

      Cart item's unique identifier.

    • product object

      Product details.

      • id string

        Product’s unique identifier generated when the product is created through the Product Service.

      • sku string

        Product Stock Keeping Unit (SKU).

      • yrn string

        In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

        It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

      • name string

        Product name.

      • description string

        Product description.

      • images array[object]

        List of product images.

        • id Required / string

          Product image''s unique identifier, generated when the image is added through the Product Service.

        • url Required / string(uri)

          Product image's URL with the file extension specified.

      • metadata object
        • mixins object

          Links to mixin schemas.

      • mixins object
    • itemYrn string

      In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

      It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

    • taxCode string

      Tax code. Tax indicated in this field overrides the site's default tax value.

    • quantity Required / number(double)

      Quantity of the product added to cart.

      Minimum value is 0.

    • price Required / object

      Price details.

      • priceId Required / string

        Price’s unique identifier generated when the price is created through the Price Service.

      • yrn string

        In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

        It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

      • originalAmount Required / number

        Product’s regular price per specified measurementUnit.

        Minimum value is 0.

      • effectiveAmount Required / number

        Actual amount the customer will pay per specified measurementUnit.

        Minimum value is 0.

      • currency Required / string

        Three-letter currency code, compliant with the ISO 4217 standard.

      • measurementUnit object

        Information about the unit by which the customer can order the product.

        • quantity Required / number(double)

          Quantity of the measurement unit.

          For example, if the customer can order a product by one piece, the value should be set to 1.

          Minimum value is 0.

        • unitCode string

          Code of the measurement unit by which the customer can order the product. The possible values for the unitCode field are explained in the table below:
          | | |
          | --- | --- |
          | Value | Measurement unit |
          | H87 | Pieces |
          | KGM | Kilograms |
          | GRM | Grams |
          | LTR | Liters |
          | MLT | Milliliters |
          | MTR | Meters |
          | RO | Rolls |

          For example, if the customer can order a product by pieces, the value should be set to H87.

          Values are kg, g, mg, l, ml, lb, qt, qtr, gal, pt, oz, MTR, XRO, MLT, LTR, H87, KGM, GRM, HLT, DL, DAG, and RO.

    • metadata object
      • mixins object

        Links to mixin schemas.

    • mixins object
    • weightDependent boolean

      If set to true, the storefront displays a hint that the total price of the product may vary depending on the product’s actual weight.

  • 400 object

    The request was syntactically incorrect. Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 403 object

    Given authorization scopes are not sufficient and do not match scopes required by the endpoint.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 404 object

    The requested resource does not exist.

    • code number

      Original HTTP error code. It should be consistent with the HTTP response code.

    • status string

      Classification of the error.

    • message string

      Descriptive error message for debugging purposes.

  • 500 object

    Some server-side error occurred. Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

GET /{tenant}/carts/{cartId}/items
$ curl \
 -X GET https://api.emporix.io/cart/{tenant}/carts/{cartId}/items \
 -H "Authorization: Bearer {access_token}"
Response example (200)
[
  {
    "id": "0",
    "yrn": "{cartItemYrn}",
    "itemYrn": "{productYrn}",
    "quantity": 6,
    "effectiveQuantity": 6,
    "price": {
      "priceId": "5f5a3b45fb29e20020be9976",
      "originalAmount": 2.29,
      "effectiveAmount": 2.29,
      "currency": "EUR"
    }
  },
  {
    "id": "1",
    "yrn": "{cartItemYrn}",
    "itemYrn": "{productYrn}",
    "quantity": 2,
    "effectiveQuantity": 2,
    "price": {
      "priceId": "5f59fe70fb29e20020be8f12",
      "originalAmount": 9.49,
      "effectiveAmount": 9.49,
      "currency": "EUR"
    }
  }
]
Response example (400)
{
  "status": 400,
  "message": "There are validation problems, see details section for more information",
  "moreInfo": "",
  "type": "validation_violation",
  "details": [
    {
      "field": "Accept-Language",
      "message": "not a language",
      "type": "invalid_header"
    }
  ]
}
Response example (403)
{
  "type": "insufficient_permissions",
  "status": 403,
  "message": "User not authorized."
}
Response example (404)
{
  "code": 404,
  "status": "Not Found",
  "message": "Cart with code 612cc4783cff1d66f699b6a1 not found."
}
Response example (500)
{
  "type": "internal_service_error",
  "status": 500,
  "message": "Something went wrong while processing the request. The error has been logged under code 20210819_095055_677_vwurkrl."
}

Adding a product to cart

Adds a product to the specified cart and creates a cart item.


Required scopes
  • cart.cart_manage

    Note: Only required if the access_token used to authorize the request and the customerId passed in the query parameter belong to different customers.

Headers
  • Authorization Required /

    Depending which type of cart you want to add a product to, a different access token needs to be used to authorize the request.
    | Cart type | Access token |
    |---|---|
    | Anonymous customer's cart | Anonymous token |
    | Logged in customer's cart | Customer's access token. |

  • Content-Type Required / string

    Default value is application/json.

Path parameters
  • tenant Required / string

    Name of the tenant.

    Note: Name of the tenant is always written in lowercase.

Query parameters
  • siteCode Required / string

    Site’s unique identifier. A site is a specific shop.

    If the tenant owns only one shop, the value should be set to main.

Body
  • id string

    Cart item's unique identifier.

  • product object

    Product details.

    • id string

      Product’s unique identifier generated when the product is created through the Product Service.

    • sku string

      Product Stock Keeping Unit (SKU).

    • yrn string

      In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

      It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

    • name string

      Product name.

    • description string

      Product description.

    • images array[object]

      List of product images.

      • id Required / string

        Product image''s unique identifier, generated when the image is added through the Product Service.

      • url Required / string(uri)

        Product image's URL with the file extension specified.

    • metadata object
      • mixins object

        Links to mixin schemas.

    • mixins object
  • itemYrn string

    In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

    It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

  • taxCode string

    Tax code. Tax indicated in this field overrides the site's default tax value.

  • quantity Required / number(double)

    Quantity of the product added to cart.

    Minimum value is 0.

  • price Required / object

    Price details.

    • priceId Required / string

      Price’s unique identifier generated when the price is created through the Price Service.

    • yrn string

      In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

      It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

    • originalAmount Required / number

      Product’s regular price per specified measurementUnit.

      Minimum value is 0.

    • effectiveAmount Required / number

      Actual amount the customer will pay per specified measurementUnit.

      Minimum value is 0.

    • currency Required / string

      Three-letter currency code, compliant with the ISO 4217 standard.

    • measurementUnit object

      Information about the unit by which the customer can order the product.

      • quantity Required / number(double)

        Quantity of the measurement unit.

        For example, if the customer can order a product by one piece, the value should be set to 1.

        Minimum value is 0.

      • unitCode string

        Code of the measurement unit by which the customer can order the product. The possible values for the unitCode field are explained in the table below:
        | | |
        | --- | --- |
        | Value | Measurement unit |
        | H87 | Pieces |
        | KGM | Kilograms |
        | GRM | Grams |
        | LTR | Liters |
        | MLT | Milliliters |
        | MTR | Meters |
        | RO | Rolls |

        For example, if the customer can order a product by pieces, the value should be set to H87.

        Values are kg, g, mg, l, ml, lb, qt, qtr, gal, pt, oz, MTR, XRO, MLT, LTR, H87, KGM, GRM, HLT, DL, DAG, and RO.

  • metadata object
    • mixins object

      Links to mixin schemas.

  • mixins object
  • weightDependent boolean

    If set to true, the storefront displays a hint that the total price of the product may vary depending on the product’s actual weight.

Responses
  • 201 object

    The request was successful. The product has been added to the cart.

    • Location string

      Location of the newly created cart item.

    • itemId Required / string

      Cart item's unique identifier.

    • yrn Required / string

      In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

      It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

  • 400 object

    The request was syntactically incorrect. Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 401 object

    Given request is unauthorized - the authorization token is invalid or has expired.

    Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 403 object

    Given authorization scopes are not sufficient and do not match scopes required by the endpoint.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 409 object

    The request could not be completed due to a conflict with the current state of the target resource.

    • code number

      Original HTTP error code. It should be consistent with the HTTP response code.

    • status string

      Classification of the error.

    • message string

      Descriptive error message for debugging purposes.

  • 500 object

    Some server-side error occurred. Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 503 object

    Service temporarily unavailable.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

POST /{tenant}/carts/{cartId}/items
$ curl \
 -X POST https://api.emporix.io/cart/{tenant}/carts/{cartId}/items?siteCode=string \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer {access_token}" \
 -H "Content-Type: string" \
 -d '{"itemYrn":"{productYrn}","price":{"priceId":"{priceId}","effectiveAmount":0.3582,"originalAmount":0.3582,"currency":"EUR"},"quantity":6}'
Request payload example
# Headers
Authorization: Bearer {access_token}
Content-Type: string

# Payload
{
  "itemYrn": "{productYrn}",
  "price": {
    "priceId": "{priceId}",
    "effectiveAmount": 0.3582,
    "originalAmount": 0.3582,
    "currency": "EUR"
  },
  "quantity": 6
}
Response example (201)
# Headers
Location: string

# Payload
{
  "itemId": "{cartItemId}",
  "yrn": "{cartItemYrn}"
}
Response example (400)
{
  "status": 400,
  "message": "There are validation problems, see details section for more information",
  "moreInfo": "",
  "type": "validation_violation",
  "details": [
    {
      "field": "Accept-Language",
      "message": "not a language",
      "type": "invalid_header"
    }
  ]
}
Response example (401)
{
  "fault": {
    "faultstring": "Access Token expired",
    "detail": {
      "errorcode": "keymanagement.service.access_token_expired"
    }
  }
}
Response example (403)
{
  "type": "insufficient_permissions",
  "status": 403,
  "message": "User not authorized."
}
Response example (409)
{
  "code": 409,
  "status": "Conflict",
  "message": "The version of the object that you are trying to update has already changed. Please refresh and try again with the latest version!"
}
Response example (500)
{
  "type": "internal_service_error",
  "status": 500,
  "message": "Something went wrong while processing the request. The error has been logged under code 20210819_095055_677_vwurkrl."
}
Response example (503)
{
  "type": "service_temporarily_unavailable",
  "status": 503,
  "message": "Service is temporarily unavailable due to overload or maintenance, try again later"
}

Deleting all products added to a cart

Removes all products from the specified cart and deletes the cart items.


Required scopes
  • cart.cart_manage

    Note: Only required if the access_token used to authorize the request and the customerId passed in the query parameter belong to different customers.

Headers
  • Authorization Required / string

    Depending which type of cart you want to delete products from, a different access token needs to be used to authorize the request.
    | Cart type | Access token |
    |---|---|
    | Anonymous customer's cart | Anonymous token |
    | Logged in customer's cart | Customer's access token. |

Path parameters
  • tenant Required / string

    Name of the tenant.

    Note: Name of the tenant is always written in lowercase.

Responses
  • 204

    The request was successful. Products have been deleted from the cart.

  • 400 object

    The request was syntactically incorrect. Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 403 object

    Given authorization scopes are not sufficient and do not match scopes required by the endpoint.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 404 object

    The requested resource does not exist.

    • code number

      Original HTTP error code. It should be consistent with the HTTP response code.

    • status string

      Classification of the error.

    • message string

      Descriptive error message for debugging purposes.

  • 500 object

    Some server-side error occurred. Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

DELETE /{tenant}/carts/{cartId}/items
$ curl \
 -X DELETE https://api.emporix.io/cart/{tenant}/carts/{cartId}/items \
 -H "Authorization: Bearer {access_token}"
Response example (400)
{
  "status": 400,
  "message": "There are validation problems, see details section for more information",
  "moreInfo": "",
  "type": "validation_violation",
  "details": [
    {
      "field": "Accept-Language",
      "message": "not a language",
      "type": "invalid_header"
    }
  ]
}
Response example (403)
{
  "type": "insufficient_permissions",
  "status": 403,
  "message": "User not authorized."
}
Response example (404)
{
  "code": 404,
  "status": "Not Found",
  "message": "Cart with code 612cc4783cff1d66f699b6a1 not found."
}
Response example (500)
{
  "type": "internal_service_error",
  "status": 500,
  "message": "Something went wrong while processing the request. The error has been logged under code 20210819_095055_677_vwurkrl."
}

Itemsbatch

Adding multiple products to cart

Adds multiple products to the specified cart and creates cart items.


Required scopes

No scopes are required.

Headers
  • Authorization Required / string

    Depending which type of cart you want to add products to, a different access token needs to be used to authorize the request.
    | Cart type | Access token |
    |---|---|
    | Anonymous customer's cart | Anonymous token |
    | Logged in customer's cart | Customer''s access token. |

Path parameters
  • tenant Required / string

    Name of the tenant.

    Note: Name of the tenant is always written in lowercase.

Body
  • id string

    Cart item's unique identifier.

  • product object

    Product details.

    • id string

      Product’s unique identifier generated when the product is created through the Product Service.

    • sku string

      Product Stock Keeping Unit (SKU).

    • yrn string

      In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

      It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

    • name string

      Product name.

    • description string

      Product description.

    • images array[object]

      List of product images.

      • id Required / string

        Product image''s unique identifier, generated when the image is added through the Product Service.

      • url Required / string(uri)

        Product image's URL with the file extension specified.

    • metadata object
      • mixins object

        Links to mixin schemas.

    • mixins object
  • itemYrn string

    In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

    It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

  • taxCode string

    Tax code. Tax indicated in this field overrides the site's default tax value.

  • quantity Required / number(double)

    Quantity of the product added to cart.

    Minimum value is 0.

  • price Required / object

    Price details.

    • priceId Required / string

      Price’s unique identifier generated when the price is created through the Price Service.

    • yrn string

      In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

      It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

    • originalAmount Required / number

      Product’s regular price per specified measurementUnit.

      Minimum value is 0.

    • effectiveAmount Required / number

      Actual amount the customer will pay per specified measurementUnit.

      Minimum value is 0.

    • currency Required / string

      Three-letter currency code, compliant with the ISO 4217 standard.

    • measurementUnit object

      Information about the unit by which the customer can order the product.

      • quantity Required / number(double)

        Quantity of the measurement unit.

        For example, if the customer can order a product by one piece, the value should be set to 1.

        Minimum value is 0.

      • unitCode string

        Code of the measurement unit by which the customer can order the product. The possible values for the unitCode field are explained in the table below:
        | | |
        | --- | --- |
        | Value | Measurement unit |
        | H87 | Pieces |
        | KGM | Kilograms |
        | GRM | Grams |
        | LTR | Liters |
        | MLT | Milliliters |
        | MTR | Meters |
        | RO | Rolls |

        For example, if the customer can order a product by pieces, the value should be set to H87.

        Values are kg, g, mg, l, ml, lb, qt, qtr, gal, pt, oz, MTR, XRO, MLT, LTR, H87, KGM, GRM, HLT, DL, DAG, and RO.

  • metadata object
    • mixins object

      Links to mixin schemas.

  • mixins object
  • weightDependent boolean

    If set to true, the storefront displays a hint that the total price of the product may vary depending on the product’s actual weight.

Responses
  • 200 array[object]

    The request was successful. Items have been added to the cart.

    • status Required / integer

      HTTP response status code.

    • id string

      Cart item's unique identifier.

    • errorMessage string

      Descriptive error message for debugging purposes.

    • headers object
      • location string

        Cart item location.

    • yrn string

      In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.

      It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.

  • 400 object

    The request was syntactically incorrect. Details will be provided in the response payload.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.

      Note: The error type should be written in lowercase and include underscores, for example validation_failure.

    • message string

      Descriptive error message for debugging purposes.

    • moreInfo string

      More information (such as a link to the documentation) for investigating further and getting support.

    • details array[object]

      List of problems causing the error.

      • field string

        Element in request data which is causing the error, for example category.name.

        If the violation was not field-specific, this field will be empty.

      • type string

        Classification of the specific error cause. This value should always be interpreted within the context of the general error type.

        Note: The error type should be written in lowercase and include underscores, for example missing_value.

      • message string

        Descriptive error message for debugging purposes.

      • moreInfo string(uri)

        More information (such as a link to the documentation) for investigating further and getting support.

  • 403 object

    Given authorization scopes are not sufficient and do not match scopes required by the endpoint.

    • status integer

      Original HTTP error code. It should be consistent with the HTTP response code.

    • type string

      Classification of the error type.</