Introduction

Starting with release 2017-05-16, merchants can now use the Checkout
JavaScript API to access data and functionality previously internal to the checkout.
For the time being, this primarily concerns reloading payment methods and observing changes in the state and data model.
Please note that the API is still considered a work in progress and might see significant changes in the coming few releases.

API entry point

window.scoApi is the root object for the API and contains all the operations available.

Listening for API readiness

The checkout raises an event when ready, which can be used to safely access the API.

observeModel(propertyString, handlerFunction) => function

Obsolete.
Preserved for backwards compatibility but may be removed in a future version.
Please, use observeEvent instead.

setCheckoutEnabled(value) => void

Pass a false-ish value to disable the checkout. While disabled, the merchant can safely perform updates to the cart. When finished, call setCheckoutEnabled(true) to re-enable the checkout and make it reflect the changes made.