This page describes how to add a custom checkbox to the Kustom Checkout (KCO) process. This allows for features like newsletter opt-ins during checkout.
To add a custom checkbox, include a checkbox object within the options part of the order creation call. The checkbox's text can be defined using Markdown formatting (e.g., [link text](checkboxes/url.md)).
The status of the checkbox can be retrieved via the merchant_requested object in a Retrieve Order call or through the checkbox_change event. More details on the checkbox object are in the API Reference.
{
//...
"options": {
"additional_checkbox": {
"text": "Lorem ipsum dollar sit amet. [Link](https://kustom.co)",
"checked": true,
"required": false
}
}
}When reading the order from the API, the additional_checkbox field within the merchant_requested object will be true if the checkbox was checked.
{
"merchant_requested": {
"additional_checkbox": true
}
}