1. Home
  2. Docs
  3. WooCommerce License Keys
  4. Subscriptions
  5. Via Subscriptio

Via Subscriptio

Only available with WooCommerce License Keys extended plugin.

You can opt to handle your license keys with subscriptions using the Subscriptio plugin. WooCommerce License Keys will integrate itself with the subscriptions plugin the moment both are activated.

Are you using Subscriptio version 1 or 2? Be aware, upgrading to version 3.0 is not possible yet.

How to configure a subscription?

Check the “Subscription” checkbox to make the license key a subscription, This will enable subscriptio’s inputs in the general tab of the product data.

Notice that the “Expire” setting is not enabled for the subscription. This is because the expiration and most of the validity of the license key will be handled and set by Subscriptio.

For variable subscriptions, read this variable product’s article.

How will the API be affected?

Expiration will no longer be validated and handled by the API, instead, the will validate the status and the expiry of the subscription.

Validations and errors

Two new errors may be returned by the API in the response:

900: Subscription is not active.
Returned when no expiration date is found and the status of the subscription is not active.

901: Subscription has expired.
Returned when the subscription returns an expired expiration date.

902: Subscription has terminated.
(Only available for Subscriptio v3.0) Returned when the subscription has terminated. A subscription has terminated when it has expired, has been canceled, or is not active.

Response data

Additional data will be returned in the response:

    "subscription_status": "trial",
    "Subscription_is_trial": true,
    "subscription_next_payment_time": 156487956,
    "subscription_next_payment_date": "2019-01-30 23:59",
    "subscription_end_time": 156487956,
    "subscription_end_date": "2019-01-30 23:59",

The status slug obtained from the subscription.

Flag indicating if the subscription is trial.

The UNIX timestamp for the next recurrent payment.

The date for the next recurrent payment (format Y-m-d H:i).

The UNIX timestamp for the end of the subscription.

The date for the end of the subscription (format Y-m-d H:i).

The expire and expire_date values returned are updated based on the subscription. The expire value will be the next payment date when available, it will be the end date if defined and when no next payment is set, or it will return null if nothing is set in the subscription.

Subscriptio version 3.0 includes subscription_has_terminated flag in the response.

Change on “My Account” pages?

Templates must be greater or equal to version 1.2.9 (regular version) and 1.4.0 (extended version).

License Keys page

The “Active” column will display the the subscription number and its status.

Single License Key page

The subscription details will be displayed.

Was this article helpful to you? Yes No