Carts | Checkout

Checkout: convert cart to order with optional selective validation. Optionally applies a cart patch (which can attach payments / shipments) in the same call.

Converts a cart to an order in a single call. You can optionally patch the cart - including attaching payments and shipments via the patch - avoiding the need for separate PatchCart / AddPayments / AddShipments requests beforehand.

The cart is never persisted by this operation: mutations are applied in-memory only and consumed by the order creation. On validation failure the cart in storage is untouched.

Patching payments and shipments: use {cartPatch.orderForm.paymentsMergeMode} and {cartPatch.orderForm.shipmentsMergeMode} to control list behaviour: <list type="bullet"><item>{UpdateOnly} (default) - match existing by ID; unknown IDs counted in NotFoundCount.</item><item>{AddOrUpdate} - match existing by ID; unknown IDs appended as new.</item><item>{Replace} - wipe existing list; use the supplied list wholesale.</item></list>{cartPatch.orderForm.discounts} and {cartPatch.orderForm.couponCodes} support the same merge modes via {discountsMergeMode} and {couponCodesMergeMode} (discounts default to {AddOrUpdate}; coupon codes default to legacy replace-when-non-empty).

Example - Minimal checkout (all defaults, no body required):

POST /api/carts/{cartId}/Checkout
        

Example - Checkout with a consumer-specified order ID and order type:

POST /api/carts/{cartId}/Checkout
{
    "orderId": "PO-2026-000123",
    "cartPatch": { "orderType": "ClickAndCollect" }
}
        

Example - Checkout adding a new payment and a new shipment via patch (common case): {paymentsMergeMode} and {shipmentsMergeMode} are set to {AddOrUpdate} so the new items are appended to the cart's existing lists (if any).

POST /api/carts/{cartId}/Checkout
{
    "cartPatch": {
        "orderForm": {
            "paymentsMergeMode": "AddOrUpdate",
            "payments": [
                {
                    "amount": 499.00,
                    "paymentMethodName": "Klarna",
                    "status": "Processed",
                    "transactionId": "klarna-txn-abc123",
                    "transactionType": "Authorization"
                }
            ],
            "shipmentsMergeMode": "AddOrUpdate",
            "shipments": [
                {
                    "shipmentId": "1",
                    "shippingMethodName": "Bring_SERVICEPAKKE",
                    "warehouseCode": "central-warehouse-oslo-01"
                }
            ]
        }
    }
}
        

Example - Checkout that replaces the cart's payments and shipments wholesale: {paymentsMergeMode} and {shipmentsMergeMode} are set to {Replace} so any existing entries on the cart are discarded and the supplied lists take their place.

POST /api/carts/{cartId}/Checkout
{
    "cartPatch": {
        "orderForm": {
            "paymentsMergeMode": "Replace",
            "payments": [
                {
                    "amount": 499.00,
                    "paymentMethodName": "Vipps",
                    "status": "Processed",
                    "transactionId": "vipps-txn-xyz789",
                    "transactionType": "Authorization"
                }
            ],
            "shipmentsMergeMode": "Replace",
            "shipments": [
                {
                    "shipmentId": "1",
                    "shippingMethodName": "Bring_SERVICEPAKKE",
                    "warehouseCode": "central-warehouse-oslo-01"
                }
            ]
        }
    }
}
        

Example - Checkout with customer data patched and a new payment, all in one call:

POST /api/carts/{cartId}/Checkout
{
    "cartPatch": {
        "customerEmail": "ola.nordmann@example.com",
        "customerPhone": "+4790000000",
        "billingAddress": {
            "name": "Ola Nordmann",
            "line1": "Lille Grensen 3",
            "postalCode": "0159",
            "city": "Oslo",
            "countryCode": "NO"
        },
        "properties": [
            { "keyGroup": "checkout", "key": "consentId", "value": "c-12345" }
        ],
        "orderForm": {
            "paymentsMergeMode": "AddOrUpdate",
            "payments": [
                {
                    "amount": 499.00,
                    "paymentMethodName": "Vipps",
                    "status": "Processed",
                    "transactionId": "vipps-txn-final",
                    "transactionType": "Authorization"
                }
            ]
        }
    }
}
        

Validator selection via {validators}: <list type="bullet"><item>Omitted or {null} - all configured validators are executed.</item><item>Empty array {[]} - no validators are run (the consumer has opted out of validation).</item><item>Non-empty array - only the named validators are run.</item></list> Use GET {/api/carts/Validators} to discover the available validator names for the current tenant.

Example - Checkout running only selected validators:

POST /api/carts/{cartId}/Checkout
{
    "validators": ["StockValidator", "PriceValidator"],
}
        

Example - Checkout skipping all validation (consumer opts out):

POST /api/carts/{cartId}/Checkout
{
    "validators": [],
}
post/api/Cart/{cartId}/Checkout

Request

  • Base URL: https://api.omnium.no (the document declares no server; this is the origin it was published from)
  • URL: https://api.omnium.no/api/Cart/{cartId}/Checkout
  • Auth: API key in header Authorization

Path parameters

cartIdstring nullable required

Cart ID

Request body

validatorsstring[] nullable

Optional list of validator names to run during checkout. If null (or omitted), all configured validators will be executed. If an empty array, no validators will be run (the consumer has opted out of validation). If non-empty, only the named validators will be run. Use GET /api/carts/Validators to discover available validator names.

orderIdstring nullable

Optional. Consumer-specified ID for the resulting order. When set, this value is used as the order ID directly (and as the order number), bypassing any fallback to cart.OrderNumber, tenant settings or auto-generation. When not set (null or empty), Omnium generates the order ID automatically using the tenant's configured order number service.

Response

Checkout succeeded. Result contains the created order and any validation warnings.

isValidatedSuccessfulboolean
validationMessagestring nullable

Changes

No recorded changes to this operation across all 1 revision of this API.