Unlike cart events, checkout operations use strict error handling with specific status codes. When an error occurs, the operation fails with a corresponding error code and message.
Status Enums
enum ENUM_CHECKOUT_STATUS_CODE_ERROR {
REQUEST_DEFAULT_ERROR = 5480,
REQUEST_LOCATION_OOS_ERROR = 5481,
REQUEST_LOCATION_MISMATCH_ERROR = 5482,
REQUEST_BIRTHDATE_ERROR = 5483,
REQUEST_CART_NOT_AVAILABLE_ERROR = 5484,
REQUEST_CART_ID_ERROR = 5485,
REQUEST_CART_ITEM_ERROR = 5486,
REQUEST_VALIDATION_ERROR = 5487,
REQUEST_TAX_ERROR = 5488,
REQUEST_COMPLETE_TOKEN = 5489,
REQUEST_DEFAULT_COMPLETE_ERROR = 5490,
REQUEST_CHECKOUT_COMPLETE_UPDATE_ERROR = 5491,
REQUEST_CHECKOUT_COMPLETE_SAVE_ERROR = 5492,
REQUEST_CHECKOUT_HAS_COMPLETE_ERROR = 5493,
REQUEST_NO_CART_ITEM_ERROR = 5494,
REQUEST_NO_CUSTOMER_FOUND_ERROR = 5495,
REQUEST_PAYMENT_ATTACHED_ERROR = 5496,
REQUEST_SHIPPING_ADDRESS_ERROR = 5497,
REQUEST_BILLING_ADDRESS_ERROR = 5498,
REQUEST_PAYMENT_NOT_FOUND_ERROR = 5499,
REQUEST_CART_UPDATED_ERROR = 5501,
REQUEST_ADDRESS_DEFAULT_ERROR = 5502,
REQUEST_TIPS_ERROR = 5503,
}
enum ENUM_CHECKOUT_STATUS_CODE_MESSAGE {
REQUEST_DEFAULT_ERROR = "There's been an error with your checkout request.",
REQUEST_LOCATION_OOS_ERROR = 'The requested items are out of stock at this location.',
REQUEST_LOCATION_MISMATCH_ERROR = "The selected location doesn't match your cart items.",
REQUEST_BIRTHDATE_ERROR = 'Please verify your birthdate and try again.',
REQUEST_CART_NOT_AVAILABLE_ERROR = 'This cart is no longer available.',
REQUEST_CART_ID_ERROR = 'The cartId requested is invalid, check and try again.',
REQUEST_CART_ITEM_ERROR = "There's an issue with one or more items in your cart.",
REQUEST_VALIDATION_ERROR = "There's been an error with your request parameters, check and try again.",
REQUEST_TAX_ERROR = 'There was an error calculating tax for your order.',
REQUEST_COMPLETE_TOKEN = 'The checkout token provided is invalid, check and try again.',
REQUEST_DEFAULT_COMPLETE_ERROR = 'There was an error completing your checkout, confirm through the (prepare) method and try again.',
REQUEST_CHECKOUT_COMPLETE_UPDATE_ERROR = 'Unable to update your checkout status.',
REQUEST_CHECKOUT_COMPLETE_SAVE_ERROR = 'Unable to save your completed checkout.',
REQUEST_CHECKOUT_HAS_COMPLETE_ERROR = 'This checkout has already been processed, create a new cart to process a new checkout.',
REQUEST_NO_CART_ITEM_ERROR = 'No items found in your cart.',
REQUEST_NO_CUSTOMER_FOUND_ERROR = 'The customer account was not found.',
REQUEST_PAYMENT_ATTACHED_ERROR = 'The payment attached to the checkout is not a valid payment method for this customer.',
REQUEST_SHIPPING_ADDRESS_ERROR = 'The address in your cart has changed, check and try again.',
REQUEST_BILLING_ADDRESS_ERROR = 'The billing address in your checkout is not valid, check and try again.',
REQUEST_PAYMENT_NOT_FOUND_ERROR = 'The payment method provided was not found.',
REQUEST_CART_UPDATED_ERROR = 'The cart requested was updated during your checkout.',
REQUEST_ADDRESS_DEFAULT_ERROR = "There's been an error with your address configurations in cart and/or billing address, check and try again.",
REQUEST_TIPS_ERROR = "There's been an error applying your tips to the checkout.",
}