Reference
Checkitout Javascript and TypeScript SDK Reference
Initializing Options
By default when initializing a Checkitout
instance, only an API token is required.
But it's also possible to specify custom endpoints, this is useful for self hosted instances. See full option here CheckitoutOptions
Create a checkout
To create a checkout is as simple as calling the create
method on the instance.
In this example, we only provided the required field. See the full options here CheckoutRequest
Enforcing the total
It is possible to pass in a total
value, this will be used to enforce the validity of the auto-calculated one.
In this case the SDK will check if the calculated total is equal to the value pass in or not. In the case
that it doesn't match, an error will be returned
Get checkout by ID
Querying checkout data using the checkitout.findOne()
method.