Checkout Messages

commercetools Checkout sends Messages to provide feedback about events.

To receive push notification Messages from commercetools Checkout, use the subscribe method.

Message structure

Checkout Messages are JSON objects with the following properties.

code
String

The Message code for the event.

type
String

A string with the following pattern {level}:{entity}:{subtype} where {level} can be info, warn, or error. This field allows filtering Messages from a more generic to a more specific type. Messages for different events can be of the same type.

message
String

A human-readable description of the event.

payload
Object

An object containing additional data about the event.

Example: error Messagejson
{
"type": "error:init:bad_config",
"code": "project_deactivated",
"message": "commercetools Checkout {projectKey} is deactivated.",
"payload": {
"project": {
"key": "{projectKey}"
}
}
}
Example: success Messagejson
{
"type": "info:order:status",
"code": "order_created",
"message": "Order {orderId} created.",
"payload": {
"order": {
"id": "{orderId}"
}
}
}

Message types

Application Messages

ApplicationDeactivated

Generated when the requested Application is deactivated. Activate the Application in the Merchant Center to continue.

code
String
"application_disabled"
type
String

error:init:bad_config

message
String

Application {applicationKey} for commercetools Checkout {projectKey} is disabled.

payload
Object

An object containing projectKey and applicationKey.

ApplicationNotFound

Generated when the requested Application is not found. The Application may have been deleted or its configuration is incorrect.

code
String
"application_not_found"
type
String

error:init:bad_config

message
String

Application {applicationKey} for commercetools Checkout {projectKey} not found.

payload
Object

An object containing projectKey and applicationKey.

Cart Messages

CartEmpty

Generated when the Cart for the current checkout is empty. The Cart must contain at least one Line Item.

code
String
"cart_empty"
type
String

error:cart:empty

message
String

Cart {cartId} is empty.

payload
Object

An object containing cartId.

CartEmptiedDuringCheckout

Generated when the Cart was emptied during the checkout process. It is not possible to recover from this, the customer must restart the checkout process.

code
String
"cart_emptied_during_checkout"
type
String

error:cart:empty

message
String

Cart {cartId} was emptied during checkout.

payload
Object

An object containing cartId.

CartNotFound

Generated when the Cart is not found. To start the checkout process, a valid Cart with at least one Line Item is required.

code
String
"cart_not_found"
type
String

error:cart:not_found

message
String

Cart {cartId} for commercetools Checkout {projectKey} and application {applicationKey} not found.

payload
Object

An object containing projectKey, applicationKey, and cartId.

CartWithExistingPayment

Generated when trying to add a Payment to a Cart that already references an approved Payment.

code
String
"cart_with_exisiting_payment"
type
String

error:payment:failed

message
String

Cart with existing approved payment.

payload
Object

An object containing cartId.

UnsupportedCountry

Generated when the country of the shipping address and/or billing address associated with the Cart does not match the countries set for the Application.

code
String
"unsupported_country"
type
String

error:init:bad_config

message
String

Cart {cartId} has unsupported country.

payload
Object

An object containing cart, shippingCountry, billingCountry, and the supportedCountries array.

Checkout Messages

CheckoutLoaded

Generated when Checkout has been loaded successfully and is waiting for the configuration parameters passed in the checkoutConfig object.

code
String
"checkout_loaded"
type
String

info:app:status

message
String

Checkout loaded.

payload
Object

An object containing additional data about the event.

CheckoutStarted

Generated when the configuration parameters are passed successfully through the checkoutConfig object and the checkout process starts.

code
String
"checkout_started"
type
String

info:app:status

message
String

Checkout started.

payload
Object

An object containing additional data about the event.

CheckoutCancelled

Generated when the customer cancels the checkout process.

code
String
"checkout_cancelled"
type
String

info:app:status

message
String

Checkout cancelled.

payload
Object

An object containing additional data about the event.

CheckoutCompleted

Generated when the customer completes the checkout process.

code
String
"checkout_completed"
type
String

info:app:status

message
String

Checkout for {orderId} completed.

payload
Object

An object containing orderId.

OrderCreated

Generated when an Order is created after a successful checkout process.

code
String
"order_created"
type
String

info:order:status

message
String

Order {orderId} created.

payload
Object

An object containing orderId.

OrderCreationError

Generated when an Order that references an approved Payment cannot be created.

code
String
"order_creation_error"
type
String

error:order:failed

message
String

Order creation failed with approved payment.

payload
Object

An object containing cartId and errors.

Configuration Messages

InitTimeout

Generated when Checkout has not received the configuration parameters passed through the checkoutConfig object on time.

code
String
"init_timeout"
type
String

error:init:timeout

message
String

Timeout error, no init message received.

payload
Object

An object containing additional data about the event.

BadInputData

Generated when the checkoutConfig object contains one or more invalid fields.

code
String
"invalid_fields"
type
String

error:init:bad_config

message
String

Some fields are invalid.

payload
Object

An object containing an array of field, message, and invalidValue.

InvalidToken

Generated when the accessToken is invalid.

code
String
"invalid_token"
type
String

error:token:invalid

message
String

The token is invalid.

payload
Object

An object containing additional data about the event.

NoShippingMethods

Generated when no Shipping Method is available for the shipping address of the Cart. This may indicate an incomplete configuration.

code
String
"no_shipping_methods"
type
String

warn:init:bad_config

message
String

There are no shipping methods matching cart.

payload
Object

An object containing cartId.

NoPaymentMethods

Generated when no payment method is set up for an Application. Add at least one Payment method to the Application in the Merchant Center.

code
String
"no_payment_methods"
type
String

error:init:bad_config

message
String

There are no payment methods configured.

payload
Object

An object containing additional data about the event.

UnallowedOrigin

Generated when Checkout cannot be initialized because the URL that is trying to initialize it is not in the list of the allowed URLs for the Application. Add the URL to the Origin URLs list in your Application settings in the Merchant Center.

code
String
"unallowed_origin"
type
String

error:init:bad_config

message
String

Unallowed origin {origin}, allowed origins {allowedOrigins}.

payload
Object

An object containing origin and allowedOrigins.

UnavailableLocale

Generated when the provided locale is not available for localization. The localization falls back to English.

code
String
"unavailable_locale"
type
String

error:init:bad_config

message
String

The provided locale {locale} is not available for translated definitions.

payload
Object

An object containing locale.

DeprecatedFields

Generated when the checkoutConfig object contains one or more deprecated fields.

code
String
"deprecated_fields"
type
String

warn:init:bad_config

message
String

Some fields are deprecated.

payload
Object

An object containing an array of field and message.

Project Messages

ProjectIsDeactivated

Generated when the commercetools Checkout projectKey is deactivated and cannot be initialized. Contact support via the Support Portal.

code
String
"project_deactivated"
type
String

error:init:bad_config

message
String

commercetools Checkout {projectKey} is deactivated.

payload
Object

An object containing projectKey.