Checkout Service

Download OpenAPI specification:Download

Converts a cart into a sales order by executing a number of checkout steps in sequence.


Key Features:

  • Validates product availability, product prices
  • Automatically applies coupons and promotions
  • Captures payment and eventually creates a sales order
  • Support for Credit Card, Pay by Invoice, PayPal and a wide range of other payment methods including payment with reward points
  • Guest checkout functionality allows users to complete a purchase without a need for a customer account

Key Benefits:

  • Validation significantly reduces the number of orders that can't be fulfilled
  • Bring your own payment service provider
  • Offer customers a wide range of payment options
  • Minimize administrative costs by instantly letting customers know whether their order has been accepted or not
  • Reduce number of abandoned carts for occasional or first-time buyers

Checkouts

Triggering a checkout

This endpoint triggers a checkout for a given cart or for a given quote. Customer must be active while checkout is proceed. Checkout is an atomic operation either it succeeds or fails. When a checkout request fails a proper validation message will be returned. Depending of the issue the checkout payload or cart content can be corrected to satisfy the validation rules and the request can be retried.

The checkout process performs the following operations:

  • Validates checkout
    • checks if cart data is provided
    • checks if customer data is provided
    • checks if only one payment method is provided
    • checks if customer mixin is compliant with the customer mixin schema
    • checks if customer address mixin is compliant with the address mixin schema
  • Validates cart data
    • checks if product prices are valid (is existing, has valid date range, quantity is valid for a wholesale price)
    • checks if the free shipping discount is properly applied (it fails when cart contains a free shipping coupon but the shipping calculation is not equal to zero)
    • checks if products in cart are valid (is existing, has a valid tax code) and still in stock
    • checks if used coupons are valid
    • checks if the currency in the cart is the same as configured for the site
    • checks if the selected delivery window capacity is valid
    • checks if the cart's delivery window has all required fields
  • Creates an order.
  • Handles the payment.
  • Closes the cart.
SecurityCustomerAccessToken
Request
path Parameters
tenant
required
string [ 3 .. 16 ] characters ^[a-z][a-z0-9]+$

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

header Parameters
saas-token
string

Customer’s saasToken retrieved when logging in a customer. The header is required for customer's checkout. If the checkout is done by a guest then the header can be skipped.

Example: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI2MTQ0MzU2MyIsImV4cCI6MTY5Nzk3MDUyOH0.F0b5jr6KeSoBCj-suTLuasmydaJEudc1ZrESkQXSCGk
Request Body schema: application/json
One of:

Schema for triggering a checkout.

cartId
required
string >= 0 characters

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

required
Array of objects (requestPaymentMethod.json)

Methods chosen to process the payment for the order.

currency
string

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

required
object (shipping.json)

Information about the shipping.

deliveryWindowId
string
Deprecated

DEPRECATED This attribute is deprecated, please use the deliveryWindow attribute in cart service to setup the delivery window which will be used for the checkout.

Delivery window's unique identifier.

required
Array of objects (address.json) non-empty unique

List of addresses associated with the order.

required
object (customer.json) non-empty

Information about the customer.

Responses
200

The request was successful. A unique order ID is returned.

400

Request was syntactically incorrect. Details are be provided within the response payload.

401

Access forbidden. The authorization token has expired.

403

Authorization token's scopes do not match scopes required by the endpoint.

409

Selected delivery window does not have available capacity

500

Some server side exception occurred which prevented it from correctly returning the result.

post/{tenant}/checkouts/order
Request samples
application/json
{
  • "cartId": "9b36757a-5ea1-4689-9ed3-fb630eb5048c",
  • "paymentMethods": [
    ],
  • "currency": "EUR",
  • "shipping": {
    },
  • "deliveryWindowId": "cbda2a28-f0cc-11ed-a05b-0242ac120003",
  • "addresses": [
    ],
  • "customer": {
    }
}
Response samples
application/json
{
  • "orderId": "B702231",
  • "paymentDetails": null,
  • "checkoutId": ""
}