Subscription
The Subscription resource represents a recurring payment as described in the WooCommerce Subscriptions plugin. See the Subscriptions documentation for more details.
Please see the Products chapter for Simple subscription and Variable subscription information. The availability of data fields and behaviour for the “Variable subscription” product are similar to the WooCommerce built-in variable products. For details, please see the Variable Products chapter.
Subscriptions also have other (child) resources Subscription Notes that can be accessed in Zapier Integration:
Trigger Rules¶
The following trigger rules are available to trigger your Zaps when subscription data in your WooCommerce store is added, changed or deleted.
Subscription created¶
Triggers when a subscription is created.
The Subscription created trigger rule will trigger for every new subscription (both paid and unpaid).
See the tip below if you would like to perform a Zap for successful (paid) subscriptions only.
How to trigger paid subscription signups only
If you would like to trigger your Zap only when a paid subscription is created, you can use the following Zap setup:
- Zap Step 1: Use the Subscription status changed to Active trigger rule.
- Zap Step 2: A WooCommerce Find Order step:
- Order ID equals 1. Parent ID (the subscriptions’ Parent ID)
- This will find the order that created the subscription.
- Zap Step 3: A Formatter by Zapier step, with the Date / Time Event and Compare Dates Transform:
- Start Date equals 2. Date Created (the order’s Date Created from Step 2)
- End Date Value equals 1. Subscription Date Paid (the Subscription Date Paid from Step 1)
- This will calculate the number of days between the original order date and the subscription date paid.
- Zap Step 4: A Filter step:
- Only continue if :
- 3. Output Days
- (Text) Exactly matches
0
- Only continue if :
- Zap Step 5: Your desired action.
The above setup should mean that the Zap only triggers when a subscription is first paid for. It should filter out subsequent subscription renewals, which also change a subscription’s status to Active.
This setup works because the date_paid
subscription field changes to a new date every time the subscription renews, so steps 2 to 4 in the above Zap setup should mean that the Zap only continues for the initial payment (when the Subscription first changes status to active).
Subscription deleted¶
Triggers when a subscription is deleted (trashed).
Due to limitations in how WooCommerce handles deleted events, only the ID
of the deleted resource is sent to Zapier when using this trigger rule. No other data fields are available.
Subscription renewal failed¶
Triggers when a subscription has just had a renewal payment fail.
This is not triggered for failed payments on the initial order or a switch order. It is only triggered for failed payments on renewal orders.
Subscription renewed¶
Triggers when a subscription renewal payment is completed successfully. It is triggered for both automatic and manual renewal payments.
This is not triggered for payments on the initial order or a switch order. It is only triggered for successful payments on renewal orders.
Subscription status changed¶
Subscription statuses are an important part of the subscription processing and fulfilment flow in WooCommerce.
A subscription’s status can be changed by a store owner, subscriber or an automatically scheduled events, like renewals or expiration.
More details on the subscription status life cycle in WooCommerce can be found in the Subscription Status Guide documentation. The Subscription status changed (any status) trigger rule will trigger every time a subscription changes status to any status, including when a subscription is first created. It will always be triggered on status changes, regardless of what initiated the status change.
If you are interested in specific status change(s) only, you may wish to use a more specific Subscription status changed to … trigger rule.
Below is a full list of Subscription status changed trigger rules:
- Subscription status changed (any status)
- Subscription status changed to Active
- Subscription status changed to Cancelled
- Subscription status changed to Expired
- Subscription status changed to On hold
- Subscription status changed to Pending Cancellation
WooCommerce Zapier version 2.4.0 renamed Subscription status changed to Subscription status changed (any status) to make it more clear that this trigger rule will trigger for any status change.
Subscription switched¶
Triggers when a user upgrades or downgrades their subscription from the My Account page.
Triggered when the switch order status changes to processing
or completed
and runs after all the switching and updating has happened.
Subscription updated¶
Triggers when a subscription is updated, edited, changed, modified, renewed, or failed, including any status change.
Actions and Searches¶
The following actions are available for use in your Zaps to create, update or find subscriptions.
Line-Item Enabled Data Fields: Coupon Lines, Shipping Lines, Line Items, Removed Line Items
To specify multiple values for these field(s), the values must be sent in a line-item aware format. Please see here for details on how the Line Itemizer can be used to achieve this.
Create Subscription¶
Creates a new Subscription in WooCommerce.
Create Input Fields¶
NAME | TYPE | DESCRIPTION |
---|---|---|
Parent Id | integer | Parent order ID. |
Status | string | Order status. |
Currency | string | Currency the order was created with, in ISO format. |
Customer Id | integer | User ID who owns the order. 0 for guests. |
Billing | object | Billing address. Only the child fields are visible in the Zapier UI. |
Billing → First Name | string | First name. |
Billing → Last Name | string | Last name. |
Billing → Company | string | Company name. |
Billing → Address 1 | string | Address line 1. |
Billing → Address 2 | string | Address line 2. |
Billing → City | string | City name. |
Billing → State | string | ISO code or name of the state, province or district. |
Billing → Postcode | string | Postal code. |
Billing → Country | string | Country code in ISO 3166-1 alpha-2 format. |
Billing → Email | string | Email address. |
Billing → Phone | string | Phone number. |
Shipping | object | Shipping address. Only the child fields are visible in the Zapier UI. |
Shipping → First Name | string | First name. |
Shipping → Last Name | string | Last name. |
Shipping → Company | string | Company name. |
Shipping → Address 1 | string | Address line 1. |
Shipping → Address 2 | string | Address line 2. |
Shipping → City | string | City name. |
Shipping → State | string | ISO code or name of the state, province or district. |
Shipping → Postcode | string | Postal code. |
Shipping → Country | string | Country code in ISO 3166-1 alpha-2 format. |
Payment Method | string | Payment method ID. |
Payment Method Title | string | Payment method title. |
Set Paid | boolean | Define if the order is paid. It will set the status to processing and reduce stock items. |
Transaction Id | string | Unique transaction ID. |
Customer Note | string | Note left by customer during checkout. |
Line Items | array | Line items data. Only the child fields are visible in the Zapier UI. |
Line Items → Product Id | any | Product ID. |
Line Items → Variation Id | integer | Variation ID, if applicable. |
Line Items → Quantity | integer | Quantity ordered. |
Line Items → Subtotal | string | Line subtotal (before discounts). |
Line Items → Subtotal Tax | string | Line subtotal tax (before discounts). |
Line Items → Total | string | Line total (after discounts). |
Line Items → Total Tax | string | Line total tax (after discounts). |
Shipping Lines | array | Shipping lines data. Only the child fields are visible in the Zapier UI. |
Shipping Lines → Method Title | any | Shipping method name. |
Shipping Lines → Method Id | any | Shipping method ID. |
Shipping Lines → Total | string | Line total (after discounts). |
Fee Lines | array | Fee lines data. Only the child fields are visible in the Zapier UI. |
Fee Lines → Name | any | Fee name. |
Fee Lines → Tax Class1 | string | Tax class of fee. |
Fee Lines → Tax Status | string | Tax status of fee. |
Fee Lines → Total | string | Line total (after discounts). |
Fee Lines → Total Tax | string | Line total tax (after discounts). |
Coupon Lines | array | Coupons line data. Only the child fields are visible in the Zapier UI. |
Coupon Lines → Code | any | Coupon code. |
Coupon Lines → Discount | string | Discount total. |
Transition Status | string | The status to transition the subscription to. Unlike the “status” param, this will calculate and update the subscription dates. |
Billing Interval | integer | The number of billing periods between subscription renewals. |
Billing Period | string | Billing period for the subscription. |
Payment Details | object | Subscription payment details. Only the child fields are visible in the Zapier UI. |
Payment Details → Method Id | string | Payment gateway ID. |
Start Date | date-time | The subscription’s start date. |
Trial End Date | date-time | The subscription’s trial date |
Next Payment Date | date-time | The subscription’s next payment date. |
End Date | date-time | The subscription’s end date. |
Removed Line Items | array | Removed line items data. Note: Always ignored. Only the child fields are visible in the Zapier UI. |
Removed Line Items → Product Id | any | Product ID. Note: Always ignored. |
Removed Line Items → Variation Id | integer | Variation ID, if applicable. Note: Always ignored. |
Removed Line Items → Quantity | integer | Quantity ordered. Note: Always ignored. |
Removed Line Items → Subtotal | string | Line subtotal (before discounts). Note: Always ignored. |
Removed Line Items → Subtotal Tax | string | Line subtotal tax (before discounts). Note: Always ignored. |
Removed Line Items → Total | string | Line total (after discounts). Note: Always ignored. |
Removed Line Items → Total Tax | string | Line total tax (after discounts). Note: Always ignored. |
Update Subscription¶
Updates (modifies) an existing Subscription in WooCommerce.
An update action always requires a valid top-level ID to be specified. This ensures that your Zap knows which record to update. On the other hand, any non-top-level ID is optional. If you leave it empty, WooCommerce will create a new entry, such as a new Meta Data item.
To help identify the correct Resource ID, you can add a Find step before your update step. The result of your Find step will contain the Resource ID, which you can then use in the Update step.
Update Input Fields¶
NAME | TYPE | DESCRIPTION |
---|---|---|
Existing ID | integer | Unique identifier for the resource. Required |
Parent Id | integer | Parent order ID. |
Status | string | Order status. |
Currency | string | Currency the order was created with, in ISO format. |
Customer Id | integer | User ID who owns the order. 0 for guests. |
Billing | object | Billing address. Only the child fields are visible in the Zapier UI. |
Billing → First Name | string | First name. |
Billing → Last Name | string | Last name. |
Billing → Company | string | Company name. |
Billing → Address 1 | string | Address line 1. |
Billing → Address 2 | string | Address line 2. |
Billing → City | string | City name. |
Billing → State | string | ISO code or name of the state, province or district. |
Billing → Postcode | string | Postal code. |
Billing → Country | string | Country code in ISO 3166-1 alpha-2 format. |
Billing → Email | string | Email address. |
Billing → Phone | string | Phone number. |
Shipping | object | Shipping address. Only the child fields are visible in the Zapier UI. |
Shipping → First Name | string | First name. |
Shipping → Last Name | string | Last name. |
Shipping → Company | string | Company name. |
Shipping → Address 1 | string | Address line 1. |
Shipping → Address 2 | string | Address line 2. |
Shipping → City | string | City name. |
Shipping → State | string | ISO code or name of the state, province or district. |
Shipping → Postcode | string | Postal code. |
Shipping → Country | string | Country code in ISO 3166-1 alpha-2 format. |
Payment Method | string | Payment method ID. |
Payment Method Title | string | Payment method title. |
Set Paid | boolean | Define if the order is paid. It will set the status to processing and reduce stock items. |
Transaction Id | string | Unique transaction ID. |
Customer Note | string | Note left by customer during checkout. |
Line Items | array | Line items data. Only the child fields are visible in the Zapier UI. |
Line Items → Existing ID | integer | Item ID. Leave empty to create a new line items record. Otherwise, enter an existing ID. |
Line Items → Product Id | any | Product ID. |
Line Items → Variation Id | integer | Variation ID, if applicable. |
Line Items → Quantity | integer | Quantity ordered. |
Line Items → Subtotal | string | Line subtotal (before discounts). |
Line Items → Subtotal Tax | string | Line subtotal tax (before discounts). |
Line Items → Total | string | Line total (after discounts). |
Line Items → Total Tax | string | Line total tax (after discounts). |
Shipping Lines | array | Shipping lines data. Only the child fields are visible in the Zapier UI. |
Shipping Lines → Existing ID | integer | Item ID. Leave empty to create a new shipping lines record. Otherwise, enter an existing ID. |
Shipping Lines → Method Title | any | Shipping method name. |
Shipping Lines → Method Id | any | Shipping method ID. |
Shipping Lines → Total | string | Line total (after discounts). |
Fee Lines | array | Fee lines data. Only the child fields are visible in the Zapier UI. |
Fee Lines → Existing ID | integer | Item ID. Leave empty to create a new fee lines record. Otherwise, enter an existing ID. |
Fee Lines → Name | any | Fee name. |
Fee Lines → Tax Class1 | string | Tax class of fee. |
Fee Lines → Tax Status | string | Tax status of fee. |
Fee Lines → Total | string | Line total (after discounts). |
Fee Lines → Total Tax | string | Line total tax (after discounts). |
Coupon Lines | array | Coupons line data. Only the child fields are visible in the Zapier UI. |
Coupon Lines → Existing ID | integer | Item ID. Leave empty to create a new coupon lines record. Otherwise, enter an existing ID. |
Coupon Lines → Code | any | Coupon code. |
Coupon Lines → Discount | string | Discount total. |
Transition Status | string | The status to transition the subscription to. Unlike the “status” param, this will calculate and update the subscription dates. |
Billing Interval | integer | The number of billing periods between subscription renewals. |
Billing Period | string | Billing period for the subscription. |
Payment Details | object | Subscription payment details. Only the child fields are visible in the Zapier UI. |
Payment Details → Method Id | string | Payment gateway ID. |
Start Date | date-time | The subscription’s start date. |
Trial End Date | date-time | The subscription’s trial date |
Next Payment Date | date-time | The subscription’s next payment date. |
End Date | date-time | The subscription’s end date. |
Removed Line Items | array | Removed line items data. Note: Always ignored. Only the child fields are visible in the Zapier UI. |
Removed Line Items → Existing ID | integer | Item ID. Note: Always ignored. Leave empty to create a new removed line items record. Otherwise, enter an existing ID. |
Removed Line Items → Product Id | any | Product ID. Note: Always ignored. |
Removed Line Items → Variation Id | integer | Variation ID, if applicable. Note: Always ignored. |
Removed Line Items → Quantity | integer | Quantity ordered. Note: Always ignored. |
Removed Line Items → Subtotal | string | Line subtotal (before discounts). Note: Always ignored. |
Removed Line Items → Subtotal Tax | string | Line subtotal tax (before discounts). Note: Always ignored. |
Removed Line Items → Total | string | Line total (after discounts). Note: Always ignored. |
Removed Line Items → Total Tax | string | Line total tax (after discounts). Note: Always ignored. |
Find Subscription¶
Searches for an existing Subscription in WooCommerce. Optionally create one if none are found.
All available search fields can be viewed here. We recommend using the following search fields:
- Search: Searches the Billing Address, Shipping Address, Billing Last Name or Billing Email fields for the specified string/term/phrase.
- Subscription ID: Searches for the specified (numeric) subscription ID.
Searches return the first result found
Each search has a default sort order, so when defining your Search step, you can use the Order and Orderby fields to choose (for example) whether the most recent result or the oldest result is returned from your search.
Search Input Fields¶
NAME | TYPE | DESCRIPTION |
---|---|---|
Subscription Id | string | Limit search by ID. |
Search | string | Limit results to those matching a string. |
Order | string | Order sort attribute ascending or descending. |
Orderby | string | Sort collection by object attribute. |
Status | string | Limit result set to orders assigned a specific status. |
Customer | integer | Limit result set to orders assigned a specific customer. |
Product | integer | Limit result set to orders assigned a specific product. |
Subscription Data¶
Known Issues with Subscription Dates
The following subscription date fields have incorrect values and should not be used:
- Date Created
- Date Modified
- Start Date
- Trial End Date
- Next Payment Date
- End Date
The values for these fields do not take into account the timezone offset of the store. For example, if the store is in the UTC+2 timezone, the Date Modified field will be 2 hours earlier than it should be.
NAME | TYPE | DESCRIPTION |
---|---|---|
Id | integer | Unique identifier for the resource. |
Parent Id | integer | Parent order ID. |
Status | string | Order status. |
Order Key | string | Order key. |
Number | string | Order number. |
Currency | string | Currency the order was created with, in ISO format. |
Version | string | Version of WooCommerce which last updated the order. |
Prices Include Tax | boolean | True the prices included tax during checkout. |
Date Created | date-time | The date the order was created, as GMT. |
Date Modified | date-time | The date the order was last modified, as GMT. |
Customer Id | integer | User ID who owns the order. 0 for guests. |
Discount Total | string | Total discount amount for the order. |
Discount Tax | string | Total discount tax amount for the order. |
Shipping Total | string | Total shipping amount for the order. |
Shipping Tax | string | Total shipping tax amount for the order. |
Cart Tax | string | Sum of line item taxes only. |
Total | string | Grand total. |
Total Tax | string | Sum of all taxes. |
Billing | object | Billing address. |
Billing → First Name | string | First name. |
Billing → Last Name | string | Last name. |
Billing → Company | string | Company name. |
Billing → Address 1 | string | Address line 1. |
Billing → Address 2 | string | Address line 2. |
Billing → City | string | City name. |
Billing → State | string | ISO code or name of the state, province or district. |
Billing → Postcode | string | Postal code. |
Billing → Country | string | Country code in ISO 3166-1 alpha-2 format. |
Billing → Email | string | Email address. |
Billing → Phone | string | Phone number. |
Shipping | object | Shipping address. |
Shipping → First Name | string | First name. |
Shipping → Last Name | string | Last name. |
Shipping → Company | string | Company name. |
Shipping → Address 1 | string | Address line 1. |
Shipping → Address 2 | string | Address line 2. |
Shipping → City | string | City name. |
Shipping → State | string | ISO code or name of the state, province or district. |
Shipping → Postcode | string | Postal code. |
Shipping → Country | string | Country code in ISO 3166-1 alpha-2 format. |
Payment Method | string | Payment method ID. |
Payment Method Title | string | Payment method title. |
Transaction Id | string | Unique transaction ID. |
Customer Ip Address | string | Customer’s IP address. |
Customer User Agent | string | User agent of the customer. |
Created via | string | Shows where the order was created. |
Customer Note | string | Note left by customer during checkout. |
Date Completed | date-time | The date the order was completed, in the site’s timezone. |
Date Paid | date-time | The date the order was paid, in the site’s timezone. |
Cart Hash | string | MD5 hash of cart items to ensure orders are not modified. |
Line Items | array | Line items data. |
Line Items → Id | integer | Item ID. |
Line Items → Name | any | Product name. |
Line Items → Sku | string | Product SKU. |
Line Items → Product Id | any | Product ID. |
Line Items → Variation Id | integer | Variation ID, if applicable. |
Line Items → Quantity | integer | Quantity ordered. |
Line Items → Tax Class | string | Tax class of product. |
Line Items → Price | string | Product price. |
Line Items → Subtotal | string | Line subtotal (before discounts). |
Line Items → Subtotal Tax | string | Line subtotal tax (before discounts). |
Line Items → Total | string | Line total (after discounts). |
Line Items → Total Tax | string | Line total tax (after discounts). |
Line Items → Taxes | array | Line taxes. |
Line Items → Meta | array | Line item meta data. |
Tax Lines | array | Tax lines data. |
Tax Lines → Id | integer | Item ID. |
Tax Lines → Rate Code | string | Tax rate code. |
Tax Lines → Rate Id | string | Tax rate ID. |
Tax Lines → Label | string | Tax rate label. |
Tax Lines → Compound | boolean | Show if is a compound tax rate. |
Tax Lines → Tax Total | string | Tax total (not including shipping taxes). |
Tax Lines → Shipping Tax Total | string | Shipping tax total. |
Shipping Lines | array | Shipping lines data. |
Shipping Lines → Id | integer | Item ID. |
Shipping Lines → Method Title | any | Shipping method name. |
Shipping Lines → Method Id | any | Shipping method ID. |
Shipping Lines → Total | string | Line total (after discounts). |
Shipping Lines → Total Tax | string | Line total tax (after discounts). |
Shipping Lines → Taxes | array | Line taxes. |
Fee Lines | array | Fee lines data. |
Fee Lines → Id | integer | Item ID. |
Fee Lines → Name | any | Fee name. |
Fee Lines → Tax Class | string | Tax class of fee. |
Fee Lines → Tax Status | string | Tax status of fee. |
Fee Lines → Total | string | Line total (after discounts). |
Fee Lines → Total Tax | string | Line total tax (after discounts). |
Fee Lines → Taxes | array | Line taxes. |
Coupon Lines | array | Coupons line data. |
Coupon Lines → Id | integer | Item ID. |
Coupon Lines → Code | any | Coupon code. |
Coupon Lines → Discount | string | Discount total. |
Coupon Lines → Discount Tax | string | Discount total tax. |
Refunds | array | List of refunds. |
Refunds → Id | integer | Refund ID. |
Refunds → Reason | string | Refund reason. |
Refunds → Total | string | Refund total. |
Billing Interval | integer | The number of billing periods between subscription renewals. |
Billing Period | string | Billing period for the subscription. |
Start Date | date-time | The subscription’s start date. |
Trial End Date | date-time | The subscription’s trial date |
Next Payment Date | date-time | The subscription’s next payment date. |
End Date | date-time | The subscription’s end date. |
Resubscribed from | string | The subscription’s original subscription ID if this is a resubscribed subscription. |
Resubscribed Subscription | string | The subscription’s resubscribed subscription ID. |
Removed Line Items | array | Removed line items data. Note: Always empty. |
Removed Line Items → Id | integer | Item ID. Note: Always empty. |
Removed Line Items → Name | any | Product name. Note: Always empty. |
Removed Line Items → Sku | string | Product SKU. Note: Always empty. |
Removed Line Items → Product Id | any | Product ID. Note: Always empty. |
Removed Line Items → Variation Id | integer | Variation ID, if applicable. Note: Always empty. |
Removed Line Items → Quantity | integer | Quantity ordered. Note: Always empty. |
Removed Line Items → Tax Class | string | Tax class of product. Note: Always empty. |
Removed Line Items → Price | string | Product price. Note: Always empty. |
Removed Line Items → Subtotal | string | Line subtotal (before discounts). Note: Always empty. |
Removed Line Items → Subtotal Tax | string | Line subtotal tax (before discounts). Note: Always empty. |
Removed Line Items → Total | string | Line total (after discounts). Note: Always empty. |
Removed Line Items → Total Tax | string | Line total tax (after discounts). Note: Always empty. |
Removed Line Items → Taxes | array | Line taxes. Note: Always empty. |
Removed Line Items → Meta | array | Removed line item meta data. Note: Always empty. |
Data Fields May Differ in Your WooCommerce Store
WooCommerce Zapier utilises WooCommerce’s REST API. Data field names, descriptions, and values can vary from one WooCommerce store to another.
Your store’s data, fields, and trigger rules may differ from this documentation due to any of the following:
- WordPress versions and the locale/language used.
- Your WooCommerce versions and the features enabled.
- Your active WordPress plugins and WooCommerce extensions.
- Any custom code that overrides or changes how the WooCommerce/WordPress REST API operates.
Note: The field definitions are generated using the following settings:
- WordPress v6.6 with the
en_US
locale. - WooCommerce v9.2 with tax and coupon functionality enabled.
- The WooCommerce Bookings, WooCommerce Memberships, and WooCommerce Subscriptions plugins were active.
-
All Tax Class fields require using the “slug” version of the WooCommerce tax class. See How Can I Use the Tax Class Field for more details. ↩↩