Structured Messages Returned by Cortex
Cortex returns the following types of Structured Messages:
- NeedInfo Messages
- Field Validation Errors
- Business State Errors
NeedInfo Messages
NeedInfo messages are returned on GET
operations with Status Code 200 OK
, or on POST
operations with Status Code 409 Conflict
. Messages optionally contain a link to an advised resource type for resolution of the message.
Message ID | Message Fields | Advised resources | Default debug message |
---|---|---|---|
bundle.does.not. contain.min. constituents | item-code , min-quantity , current-quantity | Bundle does not contain the minimum number of required bundle constituents. | |
cart.empty | Shopping cart is empty. | ||
need.billing.address | orders. billingaddress-info | Billing address must be specified. | |
need.datapolicy. consent | data-policy | Need user consent for data policy data-policy . | |
need.email | orders.email-info | Customer email address must be specified. | |
need.payment.method | paymentmethods. paymentmethod-info | Payment method must be specified. | |
need.shipping.address | shipmentdetails. destination-info | Shipping address must be specified. | |
need.shipping.option | shipmentdetails .shipping-option-info | Shipping option must be chosen. |
Warning Messages
Warning messages are returned on GET
operations with Status Code 200 OK
.
Message ID | Default debug message |
---|---|
cart.is.not.empty | Shopping cart already contains <#> item(s). Please consider clearing your shopping cart before continuing or you may continue and additional item(s) will be added or updated with the existing cart item(s). |
Field Validation Errors
Field validation errors can occur on POST
and PUT
operations. Errors are returned as Structured Messages with Status 400 Invalid Request
.
Message ID | Message Fields | Example Message Template |
---|---|---|
field.required | field-name | {field-name} value is required. |
field.invalid.size | field-name, min-size, max-size | {field-name} value must contain between {min-size} and {max-size} characters. |
field.invalid.format | field-name , invalid-value , reg-exp | {field-name} value '{invalid-value}' must match the following regular expression: {reg-exp} . |
field.invalid.email.format | field-name , invalid-value | {field-name} value {invalid-value} must be a valid email format. |
field.invalid.boolean.format | field-name , invalid-value | {field-name} value {invalid-value} must be a boolean (true or false). |
field.invalid.decimal.format | field-name , invalid-value | {field-name} value {invalid-value} must be a decimal. |
field.invalid.integer.format | field-name ,invalid-value | {field-name} value {invalid-value} must be an integer. |
field.invalid.datetime.format | field-name , invalid-value | {field-name} value {invalid-value} must be in ISO8601 date time format (YYYY-MM-DDThh:mm:ssTZD ). |
field.invalid.date.format | field-name , invalid-value | {field-name} value {invalid-value} must be in ISO8601 date format (YYYY-MM-DD ). |
field.invalid.option.value | field-name , invalid-value | {field-name} value {invalid-value} must match a valid option. |
field.invalid.minimum.value | field-name , min-value , invalid-value | {field-name} value {invalid-value} must be greater than or equal to {min-value} . |
field.invalid.minimum.value | field-name | Quantity field is missing or has invalid value. |
field.invalid.minimum.value | field-name | quantity value must be greater than or equal to 1 . |
field.invalid.integer.format | field-name | quantity value must be an integer. |
Request Entity Too Large Errors
Request entity too large errors can occur on POST
and PUT
operations. Errors are returned as Structured Messages with Status 413 Request Entity Too Large
.
Message ID | Message Fields | Example Message Template |
---|---|---|
cart.request.too.large | maximum-number-of-items | The request is too large. The maximum number of items that can be added to a cart in a single request is {maximum-number-of-items} . To add more items, create another request. |
Business State Errors
Business state errors can occur on POST
, PUT
and DELETE
operations. Errors are returned as Structured Messages with the HTTP status code 409 Conflict
.
Message ID | Message Fields | Default debug message |
---|---|---|
bundle.exceeds.max.constituents | item-code ,max-quantity ,requested-quantity | Bundle contains more than the maximum number of allowed bundle constituents. |
cart.gift.certificate.insufficient.balance | gift-certificate-code , gc-payment-required , gc-balance | Gift certificate {GC_CODE} does not have sufficient balance to process the payment. |
cart.gift.certificate.not.found | gift-certificate-code | Gift certificate {GC_CODE} not found. |
coupon.no.longer.available | coupon-code | Coupon {coupon-code} is no longer available. |
coupon.email.required | SKU_CODE | Email address is required for the coupon-code coupon. |
coupon.not.valid | coupon-code | Coupon {coupon-code} is not valid. |
item.insufficient.inventory | SKU_CODE | Item {SKU_CODE} does not have sufficient inventory. |
item.insufficient.inventory | SKU_CODE , quantity-requested , inventory-available | Item {SKU_CODE} only has {inventory-available} available but {quantity-requested} were requested. |
item.invalid.bundle.structure | SKU_CODE | Requested item configuration does not have a valid bundle structure. |
item.is.configurable | field-name ,field-value | Item {field-value} is a configurable product. Please add it individually using additemtocart form. |
item.is.duplicate | field-name , field-value | Item {field-value} has multiple entries. Please combine duplicate items into one entry. |
item.missing.price | SKU_CODE | Item {SKU_CODE} does not have a price. |
item.no.longer.available | SKU_CODE ,available-date | Item {SKU_CODE} is no longer available for purchase. |
item.not.available | field-name | Missing required request body. |
item.not.available | field-name | Code field is either missing or missing a value. |
item.not.available | field-name ,field-value | Item with code {field-value} does not exist. |
item.not.in.store.catalog | SKU_CODE | Item {SKU_CODE} is not part of the current store’s catalog. |
item.not.in.store.catalog | field-name , field-value | {field-value} is not part of the current store’s catalog. |
item.not.sold.separately | SKU_CODE | Item {SKU_CODE} is not sold separately. |
item.not.visible | SKU_CODE | Item {SKU_CODE} is not visible. |
item.not.yet.available | SKU_CODE , expiry-date | Item {SKU_CODE} is not yet available for purchase. |
order.already.submitted | Order has already been submitted and can’t be resubmitted. | |
payment.currency.not.supported | Payment currency is not supported by the store. | |
payment.declined | Payment was declined. | |
payment.failed | Error occurred when processing payment. | |
payment.insufficient.funds | Insufficient funds to process payment. | |
payment.method.expired | Payment method has expired. | |
payment.method.invalid | Payment method is invalid. | |
profile.userid.already.exists | user-id | User account with the user id {user-id} already exists. |
purchase.cart.is.empty | Shopping cart is empty. | |
purchase.cart.not.purchasable | Shopping cart cannot be purchased because one or more items are unavailable. | |
purchase.item.insufficient.inventory | item-code | Insufficient inventory for item {item-code} . |
purchase.item.minimum.quantity.required | item-code , minimum-quantity | A minimum quantity of {minimum-quantity} must be purchased for item {item-code} . |
purchase.item.not.available | item-code | Item {item-code} is not available for purchase. |
purchase.missing.shipping.address | A shipping address is required. | |
purchase.shipping.service.level.invalid | shipping-level | Invalid or missing shipping service level {shipping-level} . |
purchase.user.account.not.active | user-id | User account {user-id} is not active. |