LogoLogo
CommunitySupport PortalYouTubeStart a free trial
  • Welcome
  • Commerce Engine
  • Orchestration Engine
  • API Documentation
  • Release Notes
  • Changelog
  • Emporix API
  • OpenAPI Generator
  • Standard Practices
    • General Info
    • Mixins
    • Query Parameter
    • Translations
    • Custom ID
    • Upsert
    • B2B Token
  • API Guides and References
    • Authorization
      • OAuth Service
        • API Reference
          • Customer Token
          • Anonymous Token
          • Service Access Token
          • Models
        • Download API Specification
    • Artificial Intelligence
      • AI Service
        • AI Tutorials
        • API Reference
          • Text Generation
          • AI Completions
          • Models
        • Download API Specification
    • Configuration
      • Configuration Service
        • Language Tutorials
        • API Reference
          • Tenant configurations
          • Client configurations
          • Global configurations
          • Models
        • Download API Specification
      • Country Service
        • Country Tutorial
        • API Reference
          • Countries
          • Regions
          • Models
        • Download API Specification
      • Currency Service
        • Currency Tutorial
        • API Reference
          • Currencies
          • Currency exchange
          • Models
        • Download API Specification
      • Unit Handling Service
        • Unit Handling Tutorial
        • API Reference
          • Unit management
          • Unit conversion
          • Type management
          • Models
        • Download API Specification
      • Site Settings Service
        • Site Settings Tutorial
        • API Reference
          • Mixins
          • Site settings
          • Models
        • Download API Specification
      • Indexing Service
        • Indexing Tutorial
        • API Reference
          • Configuration
          • Public Configuration
          • Reindex
          • Models
        • Download API Specification
    • Catalogs and Categories
      • Catalog Service
        • Catalog Tutorials
        • API Reference
          • List catalogs
          • Catalog management
          • Models
        • Download API Specification
      • Category Service
        • Category Tutorials
        • API Reference
          • Category Resources
          • Category Assignment Resources
          • Assignment Resources
          • Category Tree Resources
          • Models
        • Download API Specification
    • Products, Labels and Brands
      • Product Service
        • Product Tutorial
        • API Reference
          • Products
          • Product Templates
          • Models
        • Download API Specification
      • Label Service
        • Label Tutorial
        • API Reference
          • Label
          • Media
          • Models
        • Download API Specification
      • Brand Service
        • Brand Tutorial
        • API Reference
          • Brands
          • Media
          • Models
        • Download API Specification
    • Prices and Taxes
      • Price Service
        • Price Tutorials
        • API Reference
          • Price lists
          • Price matching
          • Price models
          • Prices
          • Prices assigned to price lists
          • Models
        • Download API Specification
      • Tax Service
        • Tax Tutorials
        • API Reference
          • Taxes
          • Tax calculation
          • Models
        • Download API Specification
    • Users and Permissions
      • IAM Service
        • IAM Tutorial
        • API Reference
          • Access Controls
          • Group Assignments
          • Groups
          • Permissions
          • Resources
          • Roles
          • Access Control Templates
          • Users
          • Management Dashboard Users
          • Models
        • Download API Specification
      • Session-context Service
        • Session-context Tutorial
        • API Reference
          • Session management
          • Session context modification
          • Own session management
          • Own session context modification
          • Models
        • Download API Specification
    • Companies and Customers
      • Customer Management
        • Customer Management Tutorial
        • API Reference
          • Locations
          • Contact Assignments
          • Legal Entities
          • Models
        • Download API Specification
      • Customer Service (Customer Managed)
        • API Reference
          • Addresses
          • Account and profile
          • Authentication and authorization
          • Double opt In
          • Credentials
          • Models
        • Download API Specification
      • Customer Service (Tenant Managed)
        • API Reference
          • Account and profile
          • Addresses
          • Models
        • Download API Specification
      • Customer Segments
        • Segments Tutorial
        • API Reference
          • Segments
          • Items Assignments
          • Customers Assignments
          • Models
        • Download API Specification
      • Approval Service
        • Approval Tutorials
        • API Reference
          • Approvals
          • Approval
          • Search
          • Models
        • Download API Specification
    • Delivery and Shipping
      • Shipping Service
        • Shipping Tutorial
        • API Reference
          • Customer Group Relations
          • Delivery Windows
          • Shipping Cost
          • Shipping Zones
          • Shipping Methods
          • Shipping Groups
          • Sites
          • Delivery Times Management
          • Delivery Times Slots Management
          • Delivery Cycles
          • Models
        • Download API Specification
      • Delivery Providers Service
        • API Reference
          • Delivery Orders
          • Delivery Plan
          • Models
        • Download API Specification
    • Rewards and Promotions
      • Coupon Service
        • Coupon Tutorial
        • API Reference
          • Coupon Management
          • Coupon Validation
          • Coupon Redemption
          • Referral Coupon Management
          • Models
        • Download API Specification
      • Reward-points Service
        • Reward-points Tutorial
        • API Reference
          • Redeem Options Management
          • Reward Points Management
          • Signed In Customer Reward Points
          • Models
        • Download API Specification
    • Quotes
      • Quote Service
        • Quote Tutorial
        • API Reference
          • Quote management
          • Quote history
          • Quote pdf
          • Quote reason
          • Models
        • Download API Specification
    • Checkout
      • Cart Service
        • Cart Tutorial
        • API Reference
          • Carts
          • Cart items
          • Discounts
          • Models
        • Download API Specification
      • Payment-gateway Service
        • Payment-gateway Tutorial
        • API Reference
          • Payment
          • Payment mode
          • Payment frontend
          • Payment mode frontend
          • Transaction
          • Models
        • Download API Specification
      • Checkout Service
        • Checkout Tutorial
        • API Reference
          • Checkouts
          • Models
        • Download API Specification
      • Fee Service
        • Fee Tutorial
        • API Reference
          • Fee management
          • Item Fee management
          • Product Fees management
          • Item Fee search
          • Models
        • Download API Specification
      • Shopping List
        • API Reference
          • Shopping Lists
          • Models
        • Download API Specification
    • Orders
      • Availability Service
        • Availability Tutorial
        • API Reference
          • Locations
          • Availabilities
          • Models
        • Download API Specification
      • Order Service
        • Order Tutorial
        • API Reference
          • Orders (tenant Managed)
          • Orders (customer Managed)
          • Models
        • Download API Specification
      • Pick-pack Service
        • API Reference
          • Orders
          • Order cycles
          • Assignees
          • Recalculations
          • Events
          • Models
        • Download API Specification
      • Invoice Service
        • Invoice Tutorial
        • API Reference
          • Invoice Jobs
          • Models
        • Download API Specification
      • Returns Service
        • Returns Tutorial
        • API Reference
          • Returns
          • Models
        • Download API Specification
      • SEPA Export Service
        • API Reference
          • Files
          • Jobs
          • Models
        • Download API Specification
    • Utilities
      • Schema Service
        • Schema Tutorial
        • API Reference
          • Schema
          • Type
          • Reference
          • Custom Schema Type
          • Custom Instance
          • Models
        • Download API Specification
      • Sequential-id Service
        • Sequential-id Tutorial
        • API Reference
          • Sequential IDs management
          • Models
        • Download API Specification
    • Media
      • Media Service
        • Media Tutorial
        • API Reference
          • Assets
          • Models
        • Download API Specification
    • Webhooks
      • Webhook Service
        • Webhooks Tutorial
        • API Reference
          • Config
          • Events
          • Svix Emporix Shared Account
          • Models
        • Download API Specification
      • Events-Availability
      • Events-Cart
      • Events-Catalog
      • Events-Category
      • Events-Client Management
      • Events-Customer
      • Events-Index
      • Events-Order
      • Events-Price
      • Events-Product
      • Events-Quote
      • Events-Product
    • Integrations
      • Emporix and Make
      • Identity Providers
      • Workflow Automation
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. API Guides and References
  2. Checkout
  3. Cart Service
  4. API Reference

Carts

PreviousAPI ReferenceNextCart items

Was this helpful?

LogoLogo

Resources

  • Emporix.com
  • Developer Policy
  • Terms of Use

Find us

  • LinkedIn

© 2025 Emporix. All Rights Reserved.

Manage Carts

Retrieving cart details by ID

get

Retrieves specified cart details.


Required scopes

  • cart.cart_manage

    Note: This scope is only required for OAuth2 authorization method to authorize the request with the access_token.

Authorizations
Path parameters
cartIdstringRequired

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

tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
expandCalculationbooleanOptional

If set to true, a fully calculated cart is returned.

Default: true
zipCodestring · min: 1 · max: 9Optional

Zip code for cart filtering

countryCodestring · min: 2 · max: 2Optional

Country code for cart filtering

Responses
200
The request was successful. Cart details are returned.
application/json
Responseall of

Cart details.

400
The request was syntactically incorrect. Details will be provided in the response payload.
application/json
403
Given authorization scopes are not sufficient and do not match scopes required by the endpoint.
application/json
404
The requested resource does not exist.
application/json
500
Some server-side error occurred. Details will be provided in the response payload.
application/json
get
GET /cart/{tenant}/carts/{cartId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "id": "67f51d6c7bffa31e0f7a36ec",
  "yrn": "urn:yaas:hybris:cart:cart:b2b2cstage;67f51d6c7bffa31e0f7a36ec",
  "customerId": "45620894",
  "currency": "EUR",
  "siteCode": "GrossSite",
  "type": "shopping",
  "channel": {
    "name": "storefront",
    "source": "https://your-storefront.com/"
  },
  "items": [
    {
      "id": "0",
      "type": "INTERNAL",
      "itemYrn": "urn:yaas:saasag:caasproduct:product:b2b2cstage;samsung-galaxy-s24-gross",
      "quantity": 1,
      "effectiveQuantity": 1,
      "price": {
        "priceId": "679ca63dbcdefe5b380c98bc",
        "priceListId": "abc123",
        "originalAmount": 350,
        "effectiveAmount": 350,
        "currency": "EUR"
      },
      "unitPrice": {
        "netValue": 294.118,
        "grossValue": 350,
        "taxValue": 55.882,
        "taxCode": "STANDARD",
        "taxRate": 19
      },
      "itemPrice": {
        "amount": 350,
        "currency": "EUR"
      },
      "itemTaxInfo": [
        {
          "name": "STANDARD",
          "value": {
            "amount": 55.88
          },
          "rate": 19,
          "grossValue": 350,
          "netValue": 294.12
        }
      ],
      "fees": {
        "elements": [
          {
            "yrn": "urn:yaas:saasag:fee:fee:b2b2cstage;677d49ca3a421b451eab23f2",
            "taxCode": "REDUCED",
            "total": {
              "subTotal": 3.5,
              "totalTax": 0,
              "total": 3.15,
              "discount": 0.35
            },
            "name": {
              "de": "Apple Picking Fee",
              "en": "Apple Picking Fee"
            }
          }
        ],
        "total": {
          "subTotal": 3.5,
          "totalTax": 0,
          "total": 3.15,
          "discount": 0.35
        }
      },
      "authorizedAmount": {
        "amount": 350,
        "currency": "EUR"
      },
      "totalDiscount": {
        "amount": 35.35,
        "currency": "EUR"
      },
      "couponDiscounts": [
        {
          "couponId": "LS10PTOTAL",
          "value": 35.35
        }
      ],
      "externalDiscounts": [
        {
          "id": "ext-discount-001",
          "discountType": "PERCENT",
          "value": 15,
          "sequence": 1
        }
      ],
      "calculatedPrice": {
        "price": {
          "netValue": 294.118,
          "grossValue": 350,
          "taxValue": 55.882
        },
        "discountedPrice": {
          "netValue": 220.588,
          "grossValue": 262.5,
          "taxValue": 41.912,
          "taxCode": "STANDARD",
          "taxRate": 19,
          "appliedDiscounts": [
            {
              "id": "LS10PTOTAL",
              "value": 35,
              "discountType": "PERCENT"
            },
            {
              "id": "ext-discount-001",
              "value": 52.5,
              "discountType": "PERCENT"
            }
          ]
        },
        "fees": [
          {
            "id": "677d49ca3a421b451eab23f2",
            "type": "ABSOLUTE",
            "origin": "INTERNAL",
            "name": {
              "de": "Apple Picking Fee",
              "en": "Apple Picking Fee"
            },
            "price": {
              "netValue": 3.5,
              "grossValue": 3.745,
              "taxValue": 0.245,
              "taxCode": "REDUCED",
              "taxRate": 7
            },
            "discountedPrice": {
              "netValue": 3.15,
              "grossValue": 3.37,
              "taxValue": 0.22,
              "taxCode": "REDUCED",
              "taxRate": 7,
              "appliedDiscounts": [
                {
                  "id": "LS10PTOTAL",
                  "value": 0.375,
                  "discountType": "PERCENT"
                }
              ]
            }
          }
        ],
        "totalFee": {
          "netValue": 3.15,
          "grossValue": 3.37,
          "taxValue": 0.22,
          "taxCode": "REDUCED",
          "taxRate": 7,
          "appliedDiscounts": [
            {
              "id": "LS10PTOTAL",
              "value": 0.375,
              "discountType": "PERCENT"
            }
          ]
        },
        "totalDiscount": {
          "calculationType": "ApplyDiscountAfterTax",
          "value": 87.875,
          "appliedDiscounts": [
            {
              "id": "LS10PTOTAL",
              "value": 35.375,
              "discountType": "PERCENT",
              "origin": "INTERNAL"
            },
            {
              "id": "ext-discount-001",
              "value": 52.5,
              "discountType": "PERCENT",
              "origin": "EXTERNAL"
            }
          ]
        },
        "finalPrice": {
          "netValue": 223.738,
          "grossValue": 265.87,
          "taxValue": 42.132
        }
      }
    },
    {
      "id": "1",
      "type": "EXTERNAL",
      "product": {
        "id": "myTestId",
        "sku": "sku",
        "name": "myExternalProduct",
        "description": "testExternalProduct",
        "images": [
          {
            "id": "imageid",
            "url": "imageURL"
          }
        ]
      },
      "quantity": 2,
      "effectiveQuantity": 2,
      "price": {
        "originalAmount": 119,
        "effectiveAmount": 119,
        "currency": "EUR"
      },
      "unitPrice": {
        "netValue": 100,
        "grossValue": 119,
        "taxValue": 19,
        "taxCode": "STANDARD",
        "taxRate": 19
      },
      "itemPrice": {
        "amount": 238,
        "currency": "EUR"
      },
      "itemTaxInfo": [
        {
          "name": "STANDARD",
          "value": {
            "amount": 38
          },
          "rate": 19,
          "grossValue": 238,
          "netValue": 200
        }
      ],
      "fees": {
        "elements": [
          {
            "yrn": "urn:yaas:saasag:fee:fee:b2b2cstage;67f51da37bffa31e0f7a36ed",
            "total": {
              "subTotal": 5,
              "totalTax": 0,
              "total": 4.5,
              "discount": 0.5
            },
            "name": {
              "en": "Freight Fee"
            }
          }
        ],
        "total": {
          "subTotal": 5,
          "totalTax": 0,
          "total": 4.5,
          "discount": 0.5
        }
      },
      "authorizedAmount": {
        "amount": 238,
        "currency": "EUR"
      },
      "totalDiscount": {
        "amount": 24.3,
        "currency": "EUR"
      },
      "couponDiscounts": [
        {
          "couponId": "LS10PTOTAL",
          "value": 24.3
        }
      ],
      "externalFees": [
        {
          "id": "67f51da37bffa31e0f7a36ed",
          "yrn": "urn:yaas:saasag:fee:fee:b2b2cstage;67f51da37bffa31e0f7a36ed",
          "name": {
            "en": "Freight Fee"
          },
          "feeType": "ABSOLUTE",
          "feeAbsolute": {
            "currency": "EUR",
            "amount": 5
          },
          "taxable": false
        }
      ],
      "calculatedPrice": {
        "price": {
          "netValue": 200,
          "grossValue": 238,
          "taxValue": 38,
          "taxCode": "STANDARD",
          "taxRate": 19
        },
        "discountedPrice": {
          "netValue": 180,
          "grossValue": 214.2,
          "taxValue": 34.2,
          "taxCode": "STANDARD",
          "taxRate": 19,
          "appliedDiscounts": [
            {
              "id": "LS10PTOTAL",
              "value": 23.8,
              "discountType": "PERCENT"
            }
          ]
        },
        "fees": [
          {
            "id": "67f51da37bffa31e0f7a36ed",
            "type": "ABSOLUTE",
            "origin": "EXTERNAL",
            "name": {
              "en": "Freight Fee"
            },
            "price": {
              "netValue": 5,
              "grossValue": 5,
              "taxValue": 0
            },
            "discountedPrice": {
              "netValue": 4.5,
              "grossValue": 4.5,
              "taxValue": 0,
              "appliedDiscounts": [
                {
                  "id": "LS10PTOTAL",
                  "value": 0.5,
                  "discountType": "PERCENT"
                }
              ]
            }
          }
        ],
        "totalFee": {
          "netValue": 4.5,
          "grossValue": 4.5,
          "taxValue": 0,
          "appliedDiscounts": [
            {
              "id": "LS10PTOTAL",
              "value": 0.5,
              "discountType": "PERCENT"
            }
          ]
        },
        "totalDiscount": {
          "calculationType": "ApplyDiscountAfterTax",
          "value": 24.3,
          "appliedDiscounts": [
            {
              "id": "LS10PTOTAL",
              "value": 24.3,
              "discountType": "PERCENT",
              "origin": "INTERNAL"
            }
          ]
        },
        "finalPrice": {
          "netValue": 184.5,
          "grossValue": 218.7,
          "taxValue": 34.2
        }
      }
    }
  ],
  "discounts": [
    {
      "id": "0",
      "code": "LS10PTOTAL",
      "currency": "EUR",
      "discountRate": 10,
      "name": "LS10PTOTAL",
      "calculationType": "ApplyDiscountBeforeTax",
      "valid": true,
      "links": [
        {
          "rel": "validate",
          "title": "Coupon Validation",
          "href": "https://api-stage.emporix.io/coupon/b2b2cstage/coupons/LS10PTOTAL/validation",
          "type": "application/json"
        },
        {
          "rel": "redeem",
          "title": "Coupon Redemption",
          "href": "https://api-stage.emporix.io/coupon/b2b2cstage/coupons/LS10PTOTAL/redemptions",
          "type": "application/json"
        }
      ],
      "discountType": "PERCENT",
      "discountCalculationType": "TOTAL",
      "categoryRestricted": false
    }
  ],
  "feeYrnAggregate": {
    "elements": [
      {
        "yrn": "urn:yaas:saasag:fee:fee:b2b2cstage;677d49ca3a421b451eab23f2",
        "taxCode": "REDUCED",
        "total": {
          "subTotal": 3.5,
          "totalTax": 0,
          "total": 3.15,
          "discount": 0.35
        },
        "name": {
          "de": "Apple Picking Fee",
          "en": "Apple Picking Fee"
        }
      },
      {
        "yrn": "urn:yaas:saasag:fee:fee:b2b2cstage;67f51da37bffa31e0f7a36ed",
        "total": {
          "subTotal": 5,
          "totalTax": 0,
          "total": 4.5,
          "discount": 0.5
        },
        "name": {
          "en": "Freight Fee"
        }
      }
    ],
    "total": {
      "subTotal": 8.5,
      "totalTax": 0,
      "total": 7.65,
      "discount": 0.85
    }
  },
  "totalPrice": {
    "amount": 543.35,
    "currency": "EUR"
  },
  "subTotalPrice": {
    "amount": 588,
    "currency": "EUR"
  },
  "shipping": {
    "fee": {
      "amount": 7.22,
      "currency": "EUR"
    },
    "total": {
      "subTotal": 7.22,
      "totalTax": 0,
      "total": 6.5,
      "discount": 0.72
    }
  },
  "totalUnitsCount": 3,
  "metadata": {
    "createdAt": "2025-01-24T11:11:15.394438Z",
    "modifiedAt": "2025-01-24T11:11:15.394459Z",
    "calculatedAt": "2025-01-24T11:11:15.394459Z",
    "version": 1
  },
  "totalTax": {
    "amount": 0,
    "currency": "EUR"
  },
  "taxAggregate": {
    "lines": [
      {
        "name": "STANDARD",
        "amount": 93.88,
        "rate": 19,
        "taxable": 588
      }
    ]
  },
  "subtotalAggregate": {
    "currency": "EUR",
    "netValue": 494.12,
    "grossValue": 588,
    "taxValue": 93.88
  },
  "totalDiscount": {
    "amount": 60.37,
    "currency": "EUR"
  },
  "itemFeesTotal": {
    "subTotal": 8.5,
    "totalTax": 0,
    "total": 7.65,
    "discount": 0.85
  },
  "paymentFeesTotal": {
    "subTotal": 0,
    "totalTax": 0,
    "total": 0,
    "discount": 0
  },
  "leadTime": 0,
  "totalAuthorizedAmount": {
    "amount": 543.35,
    "currency": "EUR"
  },
  "calculatedPrice": {
    "price": {
      "netValue": 494.118,
      "grossValue": 588,
      "taxValue": 93.882,
      "taxCode": "STANDARD",
      "taxRate": 19
    },
    "discountedPrice": {
      "netValue": 400.588,
      "grossValue": 476.7,
      "taxValue": 76.112,
      "taxCode": "STANDARD",
      "taxRate": 19,
      "appliedDiscounts": [
        {
          "id": "LS10PTOTAL",
          "value": 58.8,
          "discountType": "PERCENT"
        },
        {
          "id": "ext-discount-001",
          "value": 52.5,
          "discountType": "PERCENT"
        }
      ]
    },
    "totalFee": {
      "netValue": 7.65,
      "grossValue": 7.87,
      "taxValue": 0.22,
      "appliedDiscounts": [
        {
          "id": "LS10PTOTAL",
          "value": 0.875,
          "discountType": "PERCENT"
        }
      ]
    },
    "totalDiscount": {
      "calculationType": "ApplyDiscountAfterTax",
      "value": 112.948,
      "appliedDiscounts": [
        {
          "id": "LS10PTOTAL",
          "value": 60.448,
          "discountType": "PERCENT",
          "origin": "INTERNAL"
        },
        {
          "id": "ext-discount-001",
          "value": 52.5,
          "discountType": "PERCENT",
          "origin": "EXTERNAL"
        }
      ]
    },
    "totalShipping": {
      "netValue": 6.497,
      "grossValue": 6.952,
      "taxValue": 0.455,
      "taxCode": "REDUCED",
      "taxRate": 7,
      "appliedDiscounts": [
        {
          "id": "LS10PTOTAL",
          "value": 0.773,
          "discountType": "PERCENT"
        }
      ]
    },
    "finalPrice": {
      "netValue": 414.735,
      "grossValue": 491.522,
      "taxValue": 76.787,
      "taxAggregate": {
        "lines": [
          {
            "netValue": 9.647,
            "grossValue": 10.322,
            "taxValue": 0.675,
            "taxCode": "REDUCED",
            "taxRate": 7
          },
          {
            "netValue": 400.588,
            "grossValue": 476.7,
            "taxValue": 76.112,
            "taxCode": "STANDARD",
            "taxRate": 19
          },
          {
            "netValue": 4.5,
            "grossValue": 4.5,
            "taxValue": 0
          }
        ]
      }
    }
  }
}

Deleting a cart

delete

Deletes a specified cart.


Required scopes

  • cart.cart_manage

    Note: This scope is only required for OAuth2 authorization method to authorize the request with the access_token.

Authorizations
Path parameters
cartIdstringRequired

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

tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Responses
204
The request was successful. The cart has been deleted.
400
The request was syntactically incorrect. Details will be provided in the response payload.
application/json
403
Given authorization scopes are not sufficient and do not match scopes required by the endpoint.
application/json
404
The requested resource does not exist.
application/json
500
Some server-side error occurred. Details will be provided in the response payload.
application/json
delete
DELETE /cart/{tenant}/carts/{cartId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*

No content

Refreshing a cart

put

Refreshes a specified cart and their items. In case the prices assigned to cart's items have been changed then these changes are recognized and reassigned to the cart.


Required scopes

  • cart.cart_manage

    Note: This scope is only required for OAuth2 authorization method to authorize the request with the access_token.

Authorizations
Path parameters
cartIdstringRequired

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

tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Responses
204
The request was successful. The cart has been refreshed.
400
The request was syntactically incorrect. Details will be provided in the response payload.
application/json
403
Given authorization scopes are not sufficient and do not match scopes required by the endpoint.
application/json
404
The requested resource does not exist.
application/json
409
The request could not be completed due to a conflict with the current state of the target resource.
application/json
500
Some server-side error occurred. Details will be provided in the response payload.
application/json
put
PUT /cart/{tenant}/carts/{cartId}/refresh HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*

No content

Retrieving lead time and non-delivery times for a cart

get

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


Required scopes

  • cart.cart_manage

    Note: This scope is only required for OAuth2 authorization method to authorize the request with the access_token.

Authorizations
Path parameters
cartIdstringRequired

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

tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Responses
200
The request was successful. Cart lead time and non delivery times are returned.
application/json
400
The request was syntactically incorrect. Details will be provided in the response payload.
application/json
403
Given authorization scopes are not sufficient and do not match scopes required by the endpoint.
application/json
404
The requested resource does not exist.
application/json
500
Some server-side error occurred. Details will be provided in the response payload.
application/json
get
GET /cart/{tenant}/carts/{cartId}/dtRestrictions HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "leadTime": 10,
  "nonDelivery": [
    "1",
    "3",
    "5"
  ]
}

Validating cart items

get

Validates the cart items, checking for pricing issues and other potential problems.

The endpoint checks for two specific validation issues:

  1. CART-ITEM-UNIT-PRICE-100001 - Returns this error when a cart contains a price that is no longer valid or not found in the price match.

  2. CART-ITEM-UNIT-PRICE-100002 - Returns this error when there are duplicated prices for the same product in the cart.


Required scopes

  • cart.cart_manage

    Note: This scope is only required for OAuth2 authorization method to authorize the request with the access_token.

Authorizations
Path parameters
cartIdstringRequired

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

tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Responses
200
The request was successful. Returns the validation status of the cart.
application/json
400
The request was syntactically incorrect. Details will be provided in the response payload.
application/json
403
Given authorization scopes are not sufficient and do not match scopes required by the endpoint.
application/json
404
The requested resource does not exist.
application/json
500
Some server-side error occurred. Details will be provided in the response payload.
application/json
get
GET /cart/{tenant}/carts/{cartId}/validate HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "isValid": true
}
  • GETRetrieving cart details by criteria
  • POSTCreating a new cart
  • POSTSearching for carts
  • GETRetrieving cart details by ID
  • PUTUpdating a cart
  • DELETEDeleting a cart
  • PUTRefreshing a cart
  • POSTChanging a cart site
  • POSTChanging a cart currency
  • POSTMerging carts
  • GETRetrieving lead time and non-delivery times for a cart
  • GETValidating cart items

Retrieving cart details by criteria

get

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

As a response only one cart is returned, so all required criteria needs to be provided to fetch the unique cart. Uniqueness of the cart is defined by combination of siteCode, type, legalEntityId and (sessionId or customerId)


Required scopes

  • cart.cart_manage

    Note: This scope is only required for OAuth2 authorization method to authorize the request with the access_token.

Authorizations
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
sessionIdstringOptional

Customer's unique session identifier.

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

customerIdstringOptional

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.

siteCodestringRequired

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

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

legalEntityIdstringOptional

Id of the legal entity to which customer is assigned. Should not be provided for B2C business model.

Note: The query param is optional, but if not provided, the cart without legalEntity assigned is returned.

createbooleanOptional

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

typestringOptional

Type of the cart.

Note: The query param is optional, but if not provided then only cart without type is returned.

zipCodestring · min: 1 · max: 9Optional

Zip code for cart filtering

countryCodestring · min: 2 · max: 2Optional

Country code for cart filtering

Responses
200
The request was successful. Cart details are returned.
application/json
Responseall of

Cart details.

400
The request was syntactically incorrect. Details will be provided in the response payload.
application/json
401
Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.
application/json
403
Given authorization scopes are not sufficient and do not match scopes required by the endpoint.
application/json
404
The requested resource does not exist.
application/json
500
Some server-side error occurred. Details will be provided in the response payload.
application/json
get
GET /cart/{tenant}/carts HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "6793753b7d4bba47e2a99800",
  "customerId": "45620894",
  "currency": "EUR",
  "siteCode": "GrossSite",
  "type": "shopping",
  "channel": {
    "name": "storefront",
    "source": "https://your-storefront.com/"
  },
  "items": [
    {
      "id": "0",
      "type": "EXTERNAL",
      "itemYrn": "urn:yaas:saasag:caasproduct:product:test;samsung-galaxy-s24-gross",
      "quantity": 1,
      "effectiveQuantity": 1,
      "price": {
        "originalAmount": 110,
        "effectiveAmount": 110,
        "currency": "EUR"
      },
      "itemPrice": {
        "amount": 110,
        "currency": "EUR"
      },
      "unitPrice": {
        "netValue": 100,
        "grossValue": 110,
        "taxValue": 10,
        "taxCode": "STANDARD",
        "taxRate": 10
      },
      "itemTaxInfo": [
        {
          "name": "STANDARD",
          "value": {
            "amount": 10
          },
          "rate": 10,
          "grossValue": 110,
          "netValue": 100
        }
      ],
      "fees": {
        "elements": [
          {
            "yrn": "urn:yaas:saasag:fee:fee:test;6793753e7d4bba47e2a99801",
            "total": {
              "subTotal": 5,
              "totalTax": 0,
              "total": 4.5,
              "discount": 0.5
            },
            "name": {
              "en": "Freight Fee"
            }
          }
        ],
        "total": {
          "subTotal": 5,
          "totalTax": 0,
          "total": 4.5,
          "discount": 0.5
        }
      },
      "authorizedAmount": {
        "amount": 143,
        "currency": "EUR"
      },
      "totalDiscount": {
        "amount": 11.5,
        "currency": "EUR"
      },
      "couponDiscounts": [
        {
          "couponId": "LS10PTOTAL",
          "value": 11.5
        }
      ],
      "externalFees": [
        {
          "id": "6793753e7d4bba47e2a99801",
          "yrn": "urn:yaas:saasag:fee:fee:test;6793753e7d4bba47e2a99801",
          "name": {
            "en": "Freight Fee"
          },
          "feeType": "ABSOLUTE",
          "feeAbsolute": {
            "currency": "EUR",
            "amount": 5
          },
          "taxable": false
        }
      ],
      "calculatedPrice": {
        "price": {
          "netValue": 100,
          "grossValue": 110,
          "taxValue": 10,
          "taxCode": "STANDARD",
          "taxRate": 10
        },
        "upliftValue": {
          "netValue": 30,
          "grossValue": 33,
          "taxValue": 3,
          "taxCode": "STANDARD",
          "taxRate": 10
        },
        "discountedPrice": {
          "netValue": 90,
          "grossValue": 99,
          "taxValue": 9,
          "taxCode": "STANDARD",
          "taxRate": 10,
          "appliedDiscounts": [
            {
              "id": "LS10PTOTAL",
              "value": 10,
              "discountType": "PERCENT",
              "origin": "INTERNAL"
            }
          ]
        },
        "fees": [
          {
            "id": "6793753e7d4bba47e2a99801",
            "type": "ABSOLUTE",
            "name": {
              "en": "Freight Fee"
            },
            "price": {
              "netValue": 5,
              "grossValue": 5,
              "taxValue": 0
            },
            "discountedPrice": {
              "netValue": 4.5,
              "grossValue": 4.5,
              "taxValue": 0,
              "appliedDiscounts": [
                {
                  "id": "LS10PTOTAL",
                  "value": 0.5,
                  "discountType": "PERCENT",
                  "origin": "INTERNAL"
                }
              ]
            }
          }
        ],
        "totalFee": {
          "netValue": 4.5,
          "grossValue": 4.5,
          "taxValue": 0,
          "appliedDiscounts": [
            {
              "id": "LS10PTOTAL",
              "value": 0.5,
              "discountType": "PERCENT",
              "origin": "INTERNAL"
            }
          ]
        },
        "totalDiscount": {
          "calculationType": "ApplyDiscountBeforeTax",
          "value": 10.5,
          "appliedDiscounts": [
            {
              "id": "LS10PTOTAL",
              "value": 10.5,
              "discountType": "PERCENT",
              "origin": "INTERNAL"
            }
          ]
        },
        "finalPrice": {
          "netValue": 94.5,
          "grossValue": 103.5,
          "taxValue": 9
        }
      }
    }
  ],
  "discounts": [
    {
      "id": "0",
      "code": "LS10PTOTAL",
      "currency": "EUR",
      "discountRate": 10,
      "name": "LS10PTOTAL",
      "calculationType": "ApplyDiscountBeforeTax",
      "valid": true,
      "links": [
        {
          "rel": "validate",
          "title": "Coupon Validation",
          "href": "https://api.emporix.io/caas-coupon/test/coupons/LS10PTOTAL/validation",
          "type": "application/json"
        },
        {
          "rel": "redeem",
          "title": "Coupon Redemption",
          "href": "https://api.emporix.io/caas-coupon/test/coupons/LS10PTOTAL/redemptions",
          "type": "application/json"
        }
      ],
      "discountType": "PERCENT",
      "discountCalculationType": "TOTAL",
      "categoryRestricted": false
    }
  ],
  "feeYrnAggregate": {
    "elements": [
      {
        "yrn": "urn:yaas:saasag:fee:fee:test;6793753e7d4bba47e2a99801",
        "total": {
          "subTotal": 5,
          "totalTax": 0,
          "total": 4.5,
          "discount": 0.5
        },
        "name": {
          "en": "Freight Fee"
        }
      }
    ],
    "total": {
      "subTotal": 5,
      "totalTax": 0,
      "total": 4.5,
      "discount": 0.5
    }
  },
  "totalPrice": {
    "amount": 110,
    "currency": "EUR"
  },
  "subTotalPrice": {
    "amount": 110,
    "currency": "EUR"
  },
  "shipping": {
    "fee": {
      "amount": 7.22,
      "currency": "EUR"
    },
    "total": {
      "subTotal": 7.22,
      "totalTax": 0,
      "total": 6.5,
      "discount": 0.72
    }
  },
  "totalUnitsCount": 1,
  "metadata": {
    "createdAt": "2025-01-24T11:11:15.394438Z",
    "modifiedAt": "2025-01-24T11:11:15.394459Z",
    "calculatedAt": "2025-01-24T11:11:15.394459Z",
    "version": 1
  },
  "totalTax": {
    "amount": 0,
    "currency": "EUR"
  },
  "taxAggregate": {
    "lines": [
      {
        "name": "STANDARD",
        "amount": 10,
        "rate": 10,
        "taxable": 110
      }
    ]
  },
  "subtotalAggregate": {
    "currency": "EUR",
    "netValue": 100,
    "grossValue": 110,
    "taxValue": 10
  },
  "totalDiscount": {
    "amount": 12.22,
    "currency": "EUR"
  },
  "itemFeesTotal": {
    "subTotal": 5,
    "totalTax": 0,
    "total": 4.5,
    "discount": 0.5
  },
  "paymentFeesTotal": {
    "subTotal": 0,
    "totalTax": 0,
    "total": 0,
    "discount": 0
  },
  "leadTime": 0,
  "totalAuthorizedAmount": {
    "amount": 143,
    "currency": "EUR"
  },
  "calculatedPrice": {
    "price": {
      "netValue": 100,
      "grossValue": 110,
      "taxValue": 10,
      "taxCode": "STANDARD",
      "taxRate": 10
    },
    "upliftValue": {
      "netValue": 30,
      "grossValue": 33,
      "taxValue": 3,
      "taxCode": "STANDARD",
      "taxRate": 10
    },
    "discountedPrice": {
      "netValue": 90,
      "grossValue": 99,
      "taxValue": 9,
      "taxCode": "STANDARD",
      "taxRate": 10,
      "appliedDiscounts": [
        {
          "id": "LS10PTOTAL",
          "value": 10,
          "discountType": "PERCENT",
          "origin": "INTERNAL"
        }
      ]
    },
    "totalFee": {
      "netValue": 4.5,
      "grossValue": 4.5,
      "taxValue": 0,
      "appliedDiscounts": [
        {
          "id": "LS10PTOTAL",
          "value": 0.5,
          "discountType": "PERCENT",
          "origin": "INTERNAL"
        }
      ]
    },
    "totalDiscount": {
      "calculationType": "ApplyDiscountBeforeTax",
      "value": 11.22,
      "appliedDiscounts": [
        {
          "id": "LS10PTOTAL",
          "value": 11.22,
          "discountType": "PERCENT",
          "origin": "INTERNAL"
        }
      ]
    },
    "totalShipping": {
      "netValue": 6.5,
      "grossValue": 6.955,
      "taxValue": 0.455,
      "taxCode": "REDUCED",
      "taxRate": 7,
      "appliedDiscounts": [
        {
          "id": "LS10PTOTAL",
          "value": 0.72,
          "discountType": "PERCENT",
          "origin": "INTERNAL"
        }
      ]
    },
    "finalPrice": {
      "netValue": 101,
      "grossValue": 110.455,
      "taxValue": 9.455
    }
  }
}

Creating a new cart

post

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

Note: A customer can have multiple carts opened, but they have to be of a different type. The cart type is specified in the payload in the type property. It allows for different types of carts, such as shopping carts and wishlists.


Required scopes

  • cart.cart_manage

    Note: This scope is only required for OAuth2 authorization method to authorize the request with the access_token. Use when you want to create a cart for a logged in customer.

Authorizations
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Header parameters
session-idstringOptional

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-tokenstringOptional

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.

Body
customerIdstring · max: 200Optional

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

currencystring · min: 3 · max: 3Required

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

Pattern: [A-Z]{3}
legalEntityIdstringOptional

Id of the legal entity to which customer is assigned.

deliveryWindowIdstringOptional

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

siteCodestringOptional

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: default
typestringOptional

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

sessionValidatedbooleanOptional

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.

Default: false
Responses
201
The request was successful. Cart details are returned.
application/json
400
The request was syntactically incorrect. Details will be provided in the response payload.
application/json
403
Given authorization scopes are not sufficient and do not match scopes required by the endpoint.
application/json
409
The request could not be completed due to a conflict with the current state of the target resource.
application/json
500
Some server-side error occurred. Details will be provided in the response payload.
application/json
post
POST /cart/{tenant}/carts HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 150

{
  "siteCode": "main",
  "currency": "EUR",
  "type": "shopping",
  "channel": {
    "name": "storefront",
    "source": "https://your-storefront.com/"
  },
  "sessionValidated": true
}
{
  "cartId": "65141d687308095e25ca0671",
  "yrn": "urn:yaas:hybris:cart:cart-item:saastest2;65141d687308095e25ca0671"
}

Searching for carts

post

Returns all carts that match provided criteria.


Required scopes

  • cart.cart_manage

    Note: This scope is only required for OAuth2 authorization method to authorize the request with the access_token.

Authorizations
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
pageSizestringOptional

The number of documents to be retrieved per page.

pageNumberstringOptional

The page number to be retrieved. The size of the pages should be specified by the pageSize parameter.

sortstringOptional

List of properties used to sort the results, separated by colons.

fieldsstringOptional

Fields to be returned in the response.

Header parameters
X-Total-CountbooleanOptional

Flag indicating whether the total number of retrieved results should be returned.

Body
qstringOptional

A standard query parameter is used to search for specific values.

See: Standard practises - Query parameter

Responses
200
The request was successful. Carts are returned.
application/json
400
The request was syntactically incorrect. Details will be provided in the response payload.
application/json
401
Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.
application/json
403
Given authorization scopes are not sufficient and do not match scopes required by the endpoint.
application/json
500
Some server-side error occurred. Details will be provided in the response payload.
application/json
post
POST /cart/{tenant}/carts/search HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "q": "status:OPEN"
}
[
  {
    "id": "6793753b7d4bba47e2a99800",
    "status": "OPEN",
    "customerId": "45620894",
    "siteCode": "GrossSite",
    "items": [
      {
        "id": "0",
        "type": "EXTERNAL",
        "itemYrn": "urn:yaas:saasag:caasproduct:product:test;samsung-galaxy-s24-gross",
        "quantity": 1,
        "effectiveQuantity": 1,
        "unitPrice": {
          "netValue": 100,
          "grossValue": 110,
          "taxValue": 10,
          "taxCode": "STANDARD",
          "taxRate": 10
        },
        "couponDiscounts": [
          {
            "couponId": "LS10PTOTAL",
            "value": 11.5
          }
        ],
        "calculatedPrice": {
          "price": {
            "netValue": 100,
            "grossValue": 110,
            "taxValue": 10,
            "taxCode": "STANDARD",
            "taxRate": 10
          },
          "upliftValue": {
            "netValue": 30,
            "grossValue": 33,
            "taxValue": 3,
            "taxCode": "STANDARD",
            "taxRate": 10
          },
          "discountedPrice": {
            "netValue": 90,
            "grossValue": 99,
            "taxValue": 9,
            "taxCode": "STANDARD",
            "taxRate": 10,
            "appliedDiscounts": [
              {
                "id": "LS10PTOTAL",
                "value": 10,
                "discountType": "PERCENT"
              }
            ]
          },
          "fees": [
            {
              "id": "6793753e7d4bba47e2a99801",
              "type": "ABSOLUTE",
              "name": {
                "en": "Freight Fee"
              },
              "price": {
                "netValue": 5,
                "grossValue": 5,
                "taxValue": 0
              },
              "discountedPrice": {
                "netValue": 4.5,
                "grossValue": 4.5,
                "taxValue": 0,
                "appliedDiscounts": [
                  {
                    "id": "LS10PTOTAL",
                    "value": 0.5,
                    "discountType": "PERCENT"
                  }
                ]
              }
            }
          ],
          "totalFee": {
            "netValue": 4.5,
            "grossValue": 4.5,
            "taxValue": 0,
            "appliedDiscounts": [
              {
                "id": "LS10PTOTAL",
                "value": 0.5,
                "discountType": "PERCENT"
              }
            ]
          },
          "totalDiscount": {
            "calculationType": "ApplyDiscountBeforeTax",
            "value": 10.5,
            "appliedDiscounts": [
              {
                "id": "LS10PTOTAL",
                "value": 10.5,
                "discountType": "PERCENT"
              }
            ]
          },
          "finalPrice": {
            "netValue": 94.5,
            "grossValue": 103.5,
            "taxValue": 9
          }
        }
      }
    ],
    "discounts": [
      {
        "id": "0",
        "code": "LS10PTOTAL",
        "currency": "EUR",
        "discountRate": 10,
        "name": "LS10PTOTAL",
        "calculationType": "ApplyDiscountBeforeTax",
        "valid": true,
        "links": [
          {
            "rel": "validate",
            "title": "Coupon Validation",
            "href": "https://api.emporix.io/caas-coupon/test/coupons/LS10PTOTAL/validation",
            "type": "application/json"
          },
          {
            "rel": "redeem",
            "title": "Coupon Redemption",
            "href": "https://api.emporix.io/caas-coupon/test/coupons/LS10PTOTAL/redemptions",
            "type": "application/json"
          }
        ],
        "discountType": "PERCENT",
        "discountCalculationType": "TOTAL",
        "categoryRestricted": false
      }
    ],
    "totalUnitsCount": 1,
    "metadata": {
      "createdAt": "2025-01-24T11:11:15.394438Z",
      "modifiedAt": "2025-01-24T11:11:15.394459Z",
      "calculatedAt": "2025-01-24T11:11:15.394459Z",
      "version": 1
    },
    "totalTax": {
      "amount": 0,
      "currency": "EUR"
    },
    "leadTime": 0,
    "calculatedPrice": {
      "price": {
        "netValue": 100,
        "grossValue": 110,
        "taxValue": 10,
        "taxCode": "STANDARD",
        "taxRate": 10
      },
      "upliftValue": {
        "netValue": 30,
        "grossValue": 33,
        "taxValue": 3,
        "taxCode": "STANDARD",
        "taxRate": 10
      },
      "discountedPrice": {
        "netValue": 90,
        "grossValue": 99,
        "taxValue": 9,
        "taxCode": "STANDARD",
        "taxRate": 10,
        "appliedDiscounts": [
          {
            "id": "LS10PTOTAL",
            "value": 10,
            "discountType": "PERCENT"
          }
        ]
      },
      "totalFee": {
        "netValue": 4.5,
        "grossValue": 4.5,
        "taxValue": 0,
        "appliedDiscounts": [
          {
            "id": "LS10PTOTAL",
            "value": 0.5,
            "discountType": "PERCENT"
          }
        ]
      },
      "totalDiscount": {
        "calculationType": "ApplyDiscountBeforeTax",
        "value": 11.22,
        "appliedDiscounts": [
          {
            "id": "LS10PTOTAL",
            "value": 11.22,
            "discountType": "PERCENT"
          }
        ]
      },
      "totalShipping": {
        "netValue": 6.5,
        "grossValue": 6.955,
        "taxValue": 0.455,
        "taxCode": "REDUCED",
        "taxRate": 7,
        "appliedDiscounts": [
          {
            "id": "LS10PTOTAL",
            "value": 0.72,
            "discountType": "PERCENT"
          }
        ]
      },
      "finalPrice": {
        "netValue": 101,
        "grossValue": 110.455,
        "taxValue": 9.455
      }
    }
  }
]

Updating a cart

put

Updates specified cart details.


Required scopes

  • cart.cart_manage

    Note: This scope is only required for OAuth2 authorization method to authorize the request with the access_token.

Authorizations
Path parameters
cartIdstringRequired

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

tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Body
customerIdstringOptional

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

currencystring · min: 3 · max: 3Optional

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

Pattern: [A-Z]{3}
legalEntityIdstringOptional

Id of the legal entity to which customer is assigned.

deliveryWindowIdstringOptional

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

typestringOptional

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

zipCodestring · max: 9Optional

Customer's address - zip code.

countryCodestring · min: 2 · max: 2Optional

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

Pattern: [a-zA-Z]{2}
orderIdstringOptional

Order’s unique identifier generated when a checkout is triggered through the Checkout Service.

statusstring · enumOptional

Cart status.

Possible values:
Responses
204
The request was successful. The cart has been updated.
400
The request was syntactically incorrect. Details will be provided in the response payload.
application/json
403
Given authorization scopes are not sufficient and do not match scopes required by the endpoint.
application/json
404
The requested resource does not exist.
application/json
409
The request could not be completed due to a conflict with the current state of the target resource.
application/json
500
Some server-side error occurred. Details will be provided in the response payload.
application/json
put
PUT /cart/{tenant}/carts/{cartId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 704

{
  "customerId": "87413250",
  "currency": "EUR",
  "deliveryWindowId": "60006da77ec20a807cd6f065",
  "type": "wishlist",
  "zipCode": "10115",
  "countryCode": "DE",
  "status": "OPEN",
  "deliveryWindow": {
    "id": "5b5572a61cf31a000f31eee4",
    "deliveryDate": "2023-06-06T12:00:00.000Z",
    "slotId": "5678-8756-3321-1234"
  },
  "channel": {
    "name": "storefront",
    "source": "https://your-storefront.com/"
  },
  "metadata": {
    "mixins": {
      "generalAttributes": "https://res.cloudinary.com/saas-ag/raw/upload/schemata/orderGeneralAttributesMixIn.v9.json",
      "deliveryTime": "https://res.cloudinary.com/saas-ag/raw/upload/schemata/deliveryTimeMixIn.v2.json"
    }
  },
  "mixins": {
    "deliveryTime": {
      "deliveryDate": "2021-06-08T12:00:00.000Z",
      "deliveryTimeId": "5f5a3da02d48b9000d39798c"
    }
  }
}

No content

Changing a cart site

post

Changes a specified cart 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

  • cart.cart_manage

    Note: This scope is only required for OAuth2 authorization method to authorize the request with the access_token.

Authorizations
Path parameters
cartIdstringRequired

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

tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Header parameters
Accept-LanguagestringOptional

List of natural languages acceptable for the response.

Content-LanguagestringOptional

List of acceptable natural languages of the customers.

languagesstringOptional

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.

Body
siteCodestringRequired

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

Responses
200
All item's currencies are updated.
400
The request was syntactically incorrect. Details will be provided in the response payload.
application/json
403
Given authorization scopes are not sufficient and do not match scopes required by the endpoint.
application/json
404
The requested resource does not exist.
application/json
500
Some server-side error occurred. Details will be provided in the response payload.
application/json
post
POST /cart/{tenant}/carts/{cartId}/changeSite HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 18

{
  "siteCode": "USA"
}

No content

Changing a cart currency

post

Changes a specified cart currency. The endpoint sends a price match request to the Price Service. This ensures that items in cart display correct prices in the new currency.


Required scopes

  • cart.cart_manage

    Note: This scope is only required for OAuth2 authorization method to authorize the request with the access_token.

Authorizations
Path parameters
cartIdstringRequired

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

tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Header parameters
Accept-LanguagestringOptional

List of natural languages acceptable for the response.

Content-LanguagestringOptional

List of acceptable natural languages of the customers.

languagesstringOptional

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.

Body
currencystringOptional
Responses
200
All item's currencies are updated.
400
The request was syntactically incorrect. Details will be provided in the response payload.
application/json
403
Given authorization scopes are not sufficient and do not match scopes required by the endpoint.
application/json
404
The requested resource does not exist.
application/json
500
Some server-side error occurred. Details will be provided in the response payload.
application/json
post
POST /cart/{tenant}/carts/{cartId}/changeCurrency HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 18

{
  "currency": "USD"
}

No content

Merging carts

post

Merges a list of anonymous carts with the specified customer cart.

Note: The cart specified in the path parameter must belong to a logged in customer. Carts listed in the request body must belong to anonymous customers.


Required scopes

  • cart.cart_manage

    Note: This scope is only required for OAuth2 authorization method to authorize the request with the access_token.

Authorizations
Path parameters
cartIdstringRequired

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

tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Header parameters
Accept-LanguagestringOptional

List of natural languages acceptable for the response.

Content-LanguagestringOptional

List of acceptable natural languages of the customers.

languagesstringOptional

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.

Body
cartsstring[] · min: 1Required

List of anonymous carts to merge with the customer cart.

Responses
200
The request was successful. Carts have been merged.
400
The request was syntactically incorrect. Details will be provided in the response payload.
application/json
403
Given authorization scopes are not sufficient and do not match scopes required by the endpoint.
application/json
404
The requested resource does not exist.
application/json
500
Some server-side error occurred. Details will be provided in the response payload.
application/json
post
POST /cart/{tenant}/carts/{cartId}/merge HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 38

{
  "carts": [
    "60effb93e5545f246574fde2"
  ]
}

No content