Browse Plugins

Developer Hooks

The plugin provides action hooks and filter hooks for developers who need to run custom code when events happen or modify plugin behavior.

Action Hooks

These fire after the plugin processes a webhook event. Use them to run custom code – like syncing data to a CRM, sending custom notifications, or updating external systems.

wcls_order_created
wcls_order_refunded
wcls_subscription_created
wcls_subscription_updated
wcls_subscription_cancelled
wcls_subscription_paused
wcls_subscription_unpaused
wcls_subscription_resumed
wcls_subscription_expired
wcls_subscription_payment_success
wcls_subscription_payment_failed
wcls_subscription_payment_recovered
wcls_license_key_created
wcls_license_key_updated

All action hooks receive three parameters: $order (WooCommerce order object), $event_data (Lemon Squeezy event data), and $full_payload (complete webhook payload). wcls_license_key_created receives $order, $license_key and $event_data; wcls_license_key_updated receives $order and $event_data.

With WooCommerce Subscriptions

For every subscription event, wcls_wcs_{event} also runs (for example wcls_wcs_subscription_payment_success) with $subscription (the WooCommerce Subscriptions subscription), $event_data and $full_payload. The wcls_{event} hooks still run with the parent order.

Filter Hooks

Use these to customize plugin behavior without editing plugin files.

Filter What It Does Default
wcls_button_color Change the checkout button color #7C3AED
wcls_is_available Control when the payment gateway shows up true (when enabled)
wcls_icon Swap the gateway icon shown at checkout Credit card icons
wcls_checkout_expiry_seconds How long payment links stay valid. Lemon Squeezy’s cart reminder emails open this same link. Receives $order 604800 (7 days)
wcls_default_variant_id Set a fallback variant ID when none is configured. Receives $order Empty string
wcls_checkout_data Change everything sent to Lemon Squeezy, just before the checkout is created. Receives $checkout_data, $order –
wcls_checkout_locale The checkout language. Receives the setting and $order auto
wcls_checkout_media The image URLs sent to the checkout (empty sends none). Receives $media, $order From the image settings
wcls_checkout_media_hosts Servers whose images the checkout may show; others are left out Lemon Squeezy’s own
wcls_skip_checkout Whether a cart skips the WooCommerce checkout page (Skip the Checkout Page on). Receives $qualifies, $cart The plugin’s own rules
wcls_direct_checkout_order_data The order data used when an order is made straight from the cart –
wcls_first_payment_discount The one-time Lemon Squeezy discount that carries a coupon on a subscription’s first payment. Receives $body, $order –
wcls_license_email_note A line under the license key in order emails, for example where to paste the key in your product. Receives $note, $order, $email Empty (no line)
wcls_receipt_lists_items Whether the thank you note on Lemon Squeezy’s receipt email lists the order’s items. Receives $list, $order true when the order holds more than one item
wcls_receipt_note The thank you note on the receipt email Lemon Squeezy sends the buyer. Plain text: a blank line starts a new paragraph, a single line break does not show. Receives $note, $order “Thank you for your purchase!” and the item list
wcls_order_variant The Lemon Squeezy variant an order of different products is sold on (an empty string sells it on its main product). Receives $variant, $order, $anchor_variant From Product for Several Products

Was this page helpful?

Still stuck? Ask us