This document provides a guide on how to use the WooCommerce Plugin API to initiate callbacks for plugin actions, especially for gateways and classes not initialized by default.
## Callback URL Structure
Before WooCommerce 2.0, use:
`https://example.com/?wc-api=CALLBACK`
In WooCommerce 2.0 or later, use the endpoint:
`https://example.com/wc-api/CALLBACK/`
## Behavior
When the callback URL is accessed, WooCommerce will:
- Initialize the `CALLBACK` class, if available
- Trigger the `woocommerce_api_callback` action
- Exit WordPress
## Hooking into the API Callback
To hook into the callback, add an action in your plugin: