This is the early access documentation preview for Custom Views. This documentation might not be in sync with our official documentation.
commercetools 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
commercetools Checkout messages are JavaScript objects with the following properties.
code String | The message code for the event. |
type String | A string with the following pattern |
message String | A human-readable description of the event. |
payload Object | An object containing additional data about the event. |
{"type": "error:init:bad_config","code": "project_deactivated","message": "commercetools Checkout {projectKey} is deactivated.","payload": {"project": {"key": "{projectKey}"}}}
{"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 |
|
message String | Application |
payload Object | An object containing |
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 |
|
message String | Application |
payload Object | An object containing |
Cart messages
CartEmpty
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 |
|
message String | Cart |
payload Object | An object containing |
CartNotFound
code String | "cart_not_found" |
type String |
|
message String | Cart |
payload Object | An object containing |
CartWithExistingPayment
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 |
|
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 |
|
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 |
|
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 |
|
message String | Checkout for |
payload Object | An object containing |
OrderCreated
Generated when an Order is created after a successful checkout process.
code String | "order_created" |
type String |
|
message String | Order |
payload Object | An object containing |
OrderCreationError
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 |
|
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 |
|
message String | Some fields are invalid. |
payload Object | An object containing an array of |
InvalidToken
Generated when the accessToken
is invalid.
code String | "invalid_token" |
type String |
|
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 |
|
message String | There are no shipping methods matching cart. |
payload Object | An object containing |
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 |
|
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 |
|
message String | Unallowed origin |
payload Object | An object containing |
DeprecatedFields
Generated when the checkoutConfig
object contains one or more deprecated fields.
code String | "deprecated_fields" |
type String |
|
message String | Some fields are deprecated. |
payload Object | An object containing an array of |
Payment Service Provider messages
AdyenInitError
Generated when the Adyen payment connector cannot be initialized.
code String | "adyen_init_error" |
type String |
|
message String | Could not initialise Adyen. |
payload Object | An object containing |
AdyenBadConfig
Generated when the configuration to initialize the Adyen payment connector contains at least one invalid field.
code String | "adyen_bad_config" |
type String |
|
message String | Some fields are invalid. |
payload Object | An object containing |
AdyenTimeout
Generated when a timeout error occurs while initializing the Adyen payment connector.
code String | "adyen_timeout" |
type String |
|
message String | Timeout while initialising Adyen. |
payload Object | An object containing |
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 |
|
message String | commercetools Checkout |
payload Object | An object containing |