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.shipment.details | shipmentdetails | Shipment details 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. |
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.
Account and Profile Errors
| Message ID | Message Fields | Default debug message |
|---|---|---|
account.suspended | account-shared-id, account-business-name | The account you are transacting for is currently suspended. |
account.update.missing.keys | fields | Required account fields are missing. |
account.update.noneditable.keys | fields | Account fields are not available for edit. |
email.conflict | email | There is more than one user with the given email. |
profile.sharedId.already.exists | shared-id | User account with this shared id already exists. |
profile.update.missing.keys | fields | Required profile fields are missing. |
profile.update.noneditable.keys | fields | Profile fields are not available for edit. |
profile.userid.already.exists | user-id | User account with the user id already exists. |
purchase.user.account.not.active | shared-id | User account is not active. |
role.not.found | role | The specified role is not configured in the system. |
user.not.found | email | The user with the specified email does not exist. |
username.not.unique | field-name, update | A user with this username already exists. |
Cart Errors
| Message ID | Message Fields | Default debug message |
|---|---|---|
cart.delete.not.permitted | Cart cannot be deleted. | |
cart.descriptor.not-unique | Cart descriptor values are already in use by another shopping cart. | |
cart.item.auto.selected.in.bundle | item-code | Item is a bundle constituent that was automatically selected. |
cart.item.not.available | item-code | Item is not available for purchase. |
cart.missing.data | field-name | Cart is missing required data. |
purchase.cart.not.purchasable | Cart is not purchasable. |
Item Errors
| Message ID | Message Fields | Default debug message |
|---|---|---|
item.insufficient.inventory | item-code | Item does not have sufficient inventory. |
item.insufficient.inventory | item-code, inventory-available, quantity-requested | Item only has limited availability. |
item.invalid.bundle.structure | item-code | Requested item configuration does not have a valid bundle structure. |
item.is.configurable | field-name, field-value | Item has one or more required modifier fields. Please add it individually using additemtocart form. |
item.is.duplicate | field-name, field-value | Item has multiple entries. Please combine duplicate items into one entry. |
item.missing.price | item-code | Item does not have a price. |
item.no.longer.available | item-code, expiry-date | Item is no longer available for purchase. |
item.not.available | field-name | Missing required request body. |
item.not.available | field-name, field-value | Item with code does not exist. |
item.not.in.store.catalog | item-code | Item is not part of the current store's catalog. |
item.not.in.store.catalog | field-name, field-value | Item is not part of the current store's catalog. |
item.not.sold.separately | item-code | Item is not sold separately. |
item.not.visible | item-code | Item is not visible. |
item.not.yet.available | item-code, available-date | Item is not yet available for purchase. |
Bundle Errors
| Message ID | Message Fields | Default debug message |
|---|---|---|
bundle.exceeds.max.constituents | item-code, max-quantity, current-quantity | Bundle contains more than the maximum number of allowed bundle constituents. |
bundle.lineitem.constituent.quantity.mismatch | item-code, specified-quantity, permitted-quantity | Constituent of bundle has invalid quantity. |
bundle.lineitem.exceeds.max.constituents | item-code, max-quantity, current-quantity | Adding constituent to cart will cause it to go beyond its maximum constituents. |
Coupon Errors
| Message ID | Message Fields | Default debug message |
|---|---|---|
coupon.email.required | coupon-code, validation-failure-code, validation-failure-message | Email address is required for the coupon. |
coupon.no.longer.available | coupon-code, validation-failure-code, validation-failure-message | Coupon is no longer available. |
coupon.not.valid | coupon-code, validation-failure-code, validation-failure-message | Coupon is not valid. |
Payment Errors
| Message ID | Message Fields | Default debug message |
|---|---|---|
invalid.paymentInstrument.configuration | Payment configuration | Duplicate payment instruments are not permitted. |
invalid.paymentInstrument.configuration | Exactly one payment instrument must be configured as unlimited. | |
payment.capability.unsupported | Capability is not supported by payment provider. | |
payment.declined | Payment was declined. | |
payment.failed | Error occurred when processing payment. | |
payment.instrument.creation.failed | Payment instrument creation failed. | |
payment.instrument.name.required | Name must not be blank. | |
payment.insufficient.funds | Insufficient funds to process payment. | |
payment.method.missing | Payment method must be present. |
Shipping Errors
| Message ID | Message Fields | Default debug message |
|---|---|---|
invalid.shipping.option | shipping-option | Selected shipping option is not valid. |
shipping.options.unavailable | There was a problem retrieving shipping options from the shipping service. |
Order Errors
| Message ID | Message Fields | Default debug message |
|---|---|---|
order.already.submitted | Order has already been submitted and can't be resubmitted. |
Authentication Errors
| Message ID | Message Fields | Default debug message |
|---|---|---|
auth.oidc.user.disabled | OpenID Connect user is disabled. | |
authentication.account.disabled | The selected account is disabled. | |
authentication.account.not.associated | You are not authorized to shop on behalf of the selected account. | |
authentication.account.not.found | No account found for the provided shared ID. | |
authentication.customer.not.found | Customer not found. | |
authentication.missing.header | Missing role headers. | |
authentication.missing.scopes | Missing scope headers. | |
authentication.too.many.roles | Too many roles in request header. | |
authentication.too.many.scopes | Too many scopes in request header. | |
authentication.wrong.role | Current role is invalid. | |
oauth.token.exchange.failure | error | OAuth token exchange failure. |
oauth.token.exchange.failure.codechallenge.creation | OAuth token exchange failure during code challenge creation. | |
oauth.token.exchange.failure.malformed.url | OAuth token exchange failure due to malformed URL. | |
trusted.traits.not.enabled | trait-name | Trusted Traits are not enabled. |
Store Errors
| Message ID | Message Fields | Default debug message |
|---|---|---|
store.disabled | store-code | The selected store is disabled or not in an OPEN state. |
store.not.found | store-code | The selected store was not found. |
Catalog Errors
| Message ID | Message Fields | Default debug message |
|---|---|---|
category-code.not.found | category-code | Category with the specified code was not found. |