ATUM REST API

Setting options

ATUM

The setting options API allows you to view and update the individual options within an ATUM settings group. To list the available groups, see Settings.

The setting options endpoints require the ATUM manage_settings capability. Only the options of the types text, number, color, switcher, textarea, select, button_group, wc_country and theme_selector are exposed through the API. Any other options (such as the script_runner ones used in the Tools group, or the multi_checkbox and time_picker options) are not listed and can't be retrieved or updated.

Setting option properties

AttributeTypeDescription
idstringA unique identifier for the setting. read-only
groupstringAn identifier for the group this setting belongs to. read-only
sectionstringAn identifier for the group section this setting belongs to. read-only
namestringA human readable name for the setting used in interfaces. read-only
descstringA human readable description for the setting used in interfaces. read-only
valuemixedSetting value.
defaultmixedDefault value for the setting. read-only
typestringType of setting. Options: text, number, color, switcher, textarea, select, wc_country, button_group and theme_selector. read-only
optionsobjectArray of options (key value pairs) for inputs such as select, multiselect, and radio buttons. For wc_country settings, it contains a values object with all the countries and states. read-only
dependencyobjectThe dependency config array for any depedent settings. read-only
confirm_msgstringThe message that is shown when a confirmation is needed when changing a setting. read-only
to_user_metastringOnly present in the user-level settings (such as the visual settings). The user meta key where the value is saved for the user that makes the request, instead of saving it globally. read-only

Retrieve a setting option

This API lets you retrieve and view a specific setting option.

HTTP request

GET/wp-json/wc/v3/atum/settings/<group_id>/<id>
curl https://example.com/wp-json/wc/v3/atum/settings/general/show_totals \
	-u consumer_key:consumer_secret
JSON response example
{
    "id": "show_totals",
    "group": "general",
    "section": "list_tables",
    "name": "Show totals row",
    "desc": "When enabled, ATUM will display new row at the bottom of all the List Tables. You will be able to preview page column totals of essential stock counters.",
    "type": "switcher",
    "default": "yes",
    "value": "yes",
    "_links": {
        "self": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/settings/general/show_totals"
            }
        ],
        "collection": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
            }
        ]
    }
}

List all setting options

This API helps you to view all the setting options within a group.

HTTP request

GET/wp-json/wc/v3/atum/settings/<group_id>
curl https://example.com/wp-json/wc/v3/atum/settings/general \
	-u consumer_key:consumer_secret
JSON response example
[
    {
        "id": "enable_admin_bar_menu",
        "group": "general",
        "section": "general",
        "name": "Enable admin bar menu",
        "desc": "When enabled, the ATUM menu will be accessible through the WP admin bar.",
        "type": "switcher",
        "default": "yes",
        "value": "yes",
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general/enable_admin_bar_menu"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
                }
            ]
        }
    },
    {
        "id": "out_stock_threshold",
        "group": "general",
        "section": "general",
        "name": "Out of stock threshold per product",
        "desc": "Activate the switch to enable the ATUM's out of stock threshold field per product. All products will use the product-level value (if any) or will inherit the WooCommerce's global value (if set) when you leave the product-level field empty.<br><br>Deactivate the switch to disable ATUM's out of stock threshold field per product and continue using the WooCommerce's global out of stock threshold. When you disable this option, you will be asked whether to leave all the current product-level values untouched in your database and ready for a future use in case you decide to return to the product-level control or to get rid of all the values.<br><br>We also have a specific tool to clear all the individual out of stock threshold values in the 'Tools' section.",
        "type": "switcher",
        "default": "no",
        "confirm_msg": "This will clear all the Out Stock Threshold values that have been set in all products",
        "value": "yes",
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general/out_stock_threshold"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
                }
            ]
        }
    },
    {
        "id": "stock_quantity_decimals",
        "group": "general",
        "section": "general",
        "name": "Decimals in stock quantity",
        "desc": "Enter the number of decimal places your shop needs in stock quantity fields. Set 0 to disable decimals or 1 and higher to override the default WooCommerce's NO decimal setting. Example: 2 would allow 2 decimals (1.00).",
        "type": "number",
        "default": 0,
        "options": {
            "min": 0,
            "max": 8
        },
        "value": 0,
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general/stock_quantity_decimals"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
                }
            ]
        }
    },
    {
        "id": "stock_quantity_step",
        "group": "general",
        "section": "general",
        "name": "Stock quantity steps",
        "desc": "Tells WooCommerce how much to increase/decrease the stock quantity value in frontend number inputs with each arrow click. Example: If set to '0.5', the stock will change from value '5' to value '5.5' when pressing the UP arrow. Pressing the DOWN arrow will reduce the stock to '4.5'. Leave it as '0' to set the step as 'any', so any number of decimals is preserved.",
        "type": "number",
        "default": 0,
        "options": {
            "min": 0,
            "max": 1,
            "step": 0.01
        },
        "value": 0,
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general/stock_quantity_step"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
                }
            ]
        }
    },
    {
        "id": "chg_stock_order_complete",
        "group": "general",
        "section": "general",
        "name": "Change stock on 'completed' status",
        "desc": "When enabling this option, the products' stock will be discounted only when any WooCommerce order's status is changed to 'Completed'. Any other status won't alter the stocks.",
        "type": "switcher",
        "default": "no",
        "value": "no",
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general/chg_stock_order_complete"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
                }
            ]
        }
    },
    {
        "id": "orders_search_by_sku",
        "group": "general",
        "section": "general",
        "name": "Search WC orders by SKU",
        "desc": "When enabled, you can search on the WC orders list by product SKU or supplier SKU and will return any WC order containing a product matching the specified term. Please, note that due to the complexity of this query, it could cause a delay in returning the searched results on dbs with many orders.",
        "type": "switcher",
        "default": "no",
        "value": "no",
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general/orders_search_by_sku"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
                }
            ]
        }
    },
    {
        "id": "enable_ajax_filter",
        "group": "general",
        "section": "list_tables",
        "name": "Enable filter autosearch",
        "desc": "When enabled, the manual search button disappears. Disable this function if you don't use or find the automatic search feature helpful.",
        "type": "switcher",
        "default": "yes",
        "value": "no",
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general/enable_ajax_filter"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
                }
            ]
        }
    },
    {
        "id": "enhanced_suppliers_filter",
        "group": "general",
        "section": "list_tables",
        "name": "Enhanced suppliers' filter",
        "desc": "When enabled, the List Tables Suppliers' filter will be replaced by an advanced search box. Recommended for sites with many suppliers.",
        "type": "switcher",
        "default": "no",
        "value": "yes",
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general/enhanced_suppliers_filter"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
                }
            ]
        }
    },
    {
        "id": "show_totals",
        "group": "general",
        "section": "list_tables",
        "name": "Show totals row",
        "desc": "When enabled, ATUM will display new row at the bottom of all the List Tables. You will be able to preview page column totals of essential stock counters.",
        "type": "switcher",
        "default": "yes",
        "value": "yes",
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general/show_totals"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
                }
            ]
        }
    },
    {
        "id": "gross_profit",
        "group": "general",
        "section": "list_tables",
        "name": "Gross profit",
        "desc": "Choose how to show up the gross profit column values in List Tables by default (the other value will show up on a tooltip when hovering each value).",
        "type": "button_group",
        "default": "percentage",
        "options": {
            "values": {
                "percentage": "Percentage",
                "monetary": "Monetary Value"
            }
        },
        "value": "percentage",
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general/gross_profit"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
                }
            ]
        }
    },
    {
        "id": "profit_margin",
        "group": "general",
        "section": "list_tables",
        "name": "Profit margin",
        "desc": "Your profit margin in percentage. We'll use this value to mark in red all the gross profit values that fall below this margin and in green all the values equal or greater than this margin.",
        "type": "number",
        "default": "50",
        "options": {
            "min": 0,
            "step": 1
        },
        "value": "50",
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general/profit_margin"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
                }
            ]
        }
    },
    {
        "id": "show_variations_stock",
        "group": "general",
        "section": "list_tables",
        "name": "Display stock info for variations",
        "desc": "When enabled, the variations' stock status and quantities will be displayed in the WooCommerce products' list (admin side) for variable products.",
        "type": "switcher",
        "default": "yes",
        "value": "yes",
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general/show_variations_stock"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
                }
            ]
        }
    },
    {
        "id": "unmanaged_counters",
        "group": "general",
        "section": "list_tables",
        "name": "Unmanaged product counters",
        "desc": "Add 'In Stock', 'Out of Stock' and 'Backorder' counters and views for Unmanaged by WooCommerce Products in all ATUM list tables. This option will also add these products to the Dashboard Stock Control Widget. Please note that enabling this option can affect the performance in stores with a large number of products.",
        "type": "switcher",
        "default": "no",
        "value": "no",
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general/unmanaged_counters"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
                }
            ]
        }
    },
    {
        "id": "sales_last_ndays",
        "group": "general",
        "section": "list_tables",
        "name": "Show sales in the last selected days",
        "desc": "Enter the number of days to calculate the number of sales in that period in ATUM List Tables.",
        "type": "number",
        "default": 14,
        "options": {
            "min": 1,
            "max": 31
        },
        "value": 14,
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general/sales_last_ndays"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
                }
            ]
        }
    }
]

Update a setting option

This API lets you make changes to a setting option. Only its value can be changed, and it's validated and sanitized in the same way as when saving the ATUM settings page.

The options that have a to_user_meta key (such as the visual settings) are saved for the user that makes the request, not globally.

HTTP request

PUT/wp-json/wc/v3/atum/settings/<group_id>/<id>
curl -X PUT https://example.com/wp-json/wc/v3/atum/settings/general/show_totals \
	-u consumer_key:consumer_secret \
	-H "Content-Type: application/json" \
	-d '{
  "value": "no"
}'
JSON response example
{
    "id": "show_totals",
    "group": "general",
    "section": "list_tables",
    "name": "Show totals row",
    "desc": "When enabled, ATUM will display new row at the bottom of all the List Tables. You will be able to preview page column totals of essential stock counters.",
    "type": "switcher",
    "default": "yes",
    "value": "no",
    "_links": {
        "self": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/settings/general/show_totals"
            }
        ],
        "collection": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
            }
        ]
    }
}

Batch update setting options

This API helps you to batch update multiple setting options.

Note: Only the update action is supported. By default it's limited to up to 100 objects. To update options from different groups at once, use the settings batch endpoint.

HTTP request

POST/wp-json/wc/v3/atum/settings/<group_id>/batch
curl -X POST https://example.com/wp-json/wc/v3/atum/settings/general/batch \
	-u consumer_key:consumer_secret \
	-H "Content-Type: application/json" \
	-d '{
      "update": [
        {
          "id": "enable_ajax_filter",
          "value": "yes"
        },
        {
          "id": "enhanced_suppliers_filter",
          "value": "yes"
        },
        {
          "id": "show_totals",
          "value": "yes"
        }
      ]
    }'
JSON response example
{
    "update": [
        {
            "id": "enable_ajax_filter",
            "group": "general",
            "section": "list_tables",
            "name": "Enable filter autosearch",
            "desc": "When enabled, the manual search button disappears. Disable this function if you don't use or find the automatic search feature helpful.",
            "type": "switcher",
            "default": "yes",
            "value": "yes",
            "_links": {
                "self": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/settings/general/enable_ajax_filter"
                    }
                ],
                "collection": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
                    }
                ]
            }
        },
        {
            "id": "enhanced_suppliers_filter",
            "group": "general",
            "section": "list_tables",
            "name": "Enhanced suppliers' filter",
            "desc": "When enabled, the List Tables Suppliers' filter will be replaced by an advanced search box. Recommended for sites with many suppliers.",
            "type": "switcher",
            "default": "no",
            "value": "yes",
            "_links": {
                "self": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/settings/general/enhanced_suppliers_filter"
                    }
                ],
                "collection": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
                    }
                ]
            }
        },
        {
            "id": "show_totals",
            "group": "general",
            "section": "list_tables",
            "name": "Show totals row",
            "desc": "When enabled, ATUM will display new row at the bottom of all the List Tables. You will be able to preview page column totals of essential stock counters.",
            "type": "switcher",
            "default": "yes",
            "value": "yes",
            "_links": {
                "self": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/settings/general/show_totals"
                    }
                ],
                "collection": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/settings/general"
                    }
                ]
            }
        }
    ]
}

On this page