Relayout

Get 10$ Discount on all products Use "THANKS10"
Copied!

How to integrate RLUS (Relayout License & Updates System) with WooCommerce and WooCommerce Subscriptions?

Two Approaches

Option A — Use RLUS Native Subscriptions (Recommended)

RLUS handles subscriptions completely on its own:

  1. Create a Plan → RLUS Admin → Subscriptions → Plans → Add New

    • Set name, price, billing cycle (monthly/yearly/lifetime)

    • Set max activations, trial days, grace period

  2. Connect a Payment Gateway → RLUS Admin → Subscriptions → Settings

    • Stripe: paste Secret Key + Webhook Secret

    • PayPal: paste Client ID + Secret

    • Razorpay: paste Key ID + Key Secret

  3. Customer buys → RLUS generates license key + subscription record automatically

  4. Your plugin checks with the SDK:

PHP
123
$sdk->subscription_active(); // is subscription paid/active?
$sdk->subscription_plan(); // monthly / yearly / lifetime
$sdk->is_grace_period(); // payment failed but in grace period?

Option B — WooCommerce as the Checkout, RLUS as License Server

If you want WooCommerce to handle the sale but RLUS to manage the license:

  1. Customer buys via WooCommerce checkout

  2. On WooCommerce order completion, call RLUS REST API to create the license:

PHP
123456789101112131415161718192021222324
add_action('woocommerce_order_status_completed', function($order_id) {
$order = wc_get_order($order_id);
$product_id = 'your-rlus-product-id'; // must match RLUS product
// Call RLUS v1 API to issue a license
$response = wp_remote_post(get_option('rlus_license_server_url') . '/wp-json/rlus/v1/create', [
'body' => [
'product_id' => $product_id,
'customer_email' => $order->get_billing_email(),
'customer_name' => $order->get_billing_first_name(),
'api_key' => get_option('rlus_api_key'),
]
]);
if (!is_wp_error($response)) {
$data = json_decode(wp_remote_retrieve_body($response), true);
// Save license key to order meta
if (!empty($data['license_key'])) {
$order->update_meta_data('_rlus_license_key', $data['license_key']);
$order->save();
// Email customer the key
}
}
});

Recommendation

Use Option A — it’s what RLUS is built for. Option B adds complexity with no benefit unless you already have an existing WooCommerce store you can’t migrate away from.

WooCommerce subscription management (renewal, cancellation, dunning, grace periods) would all need custom code to sync with RLUS — Option A handles all of that automatically.