You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`id` | <code>int</code> | _`read-only`_<br><br>The unique identifier (integer) of the user membership.
14
14
`customer_id` | <code>int</code> | The unique identifier (integer) of the customer that owns the membership.
15
15
`plan_id` | <code>int</code> | The unique identifier (integer) of the membership plan the membership is for.
16
16
`status` | <code>string</code> | The current status (string) of the user membership.
17
-
`order_id` | <code>int|null</code> | The unique identifier (integer) of the order that may have granted access to the matching membership plan. If the user membership is not linked to an order, it will return _`null`_.
18
-
`subscription_id` | <code>int|null</code> | The unique identifier (integer) of a subscription that may be linked to the user membership. This property will exist only if the site is running WooCommerce Subscriptions alongside with Memberships. If there is no link to a subscription, the value will be _`null`_.<sup><ahref="#user-membership-data-subscriptions-inactive">1</a></sup>
17
+
`order_id` | <code>int|null</code> | The unique identifier (integer) of the order that may have granted access to the matching membership plan. If the user membership is not linked to an order, it will return _`null`_.
19
18
`product_id` | <code>int|null</code> | The unique identifier (integer) of a product that may have granted access to the matching membership plan. If the user membership is not linked to a product, it will return _`null`_.
20
-
`date_created` | <code>datetime</code> | The date (in Atom format) when the user membership object was created, in the local timezone. This does not necessarily match with the start date.
21
-
`date_created_gmt` | <code>datetime</code> | The date (in Atom format) when the user membership object was created, in UTC. This does not necessarily match with the start date.
22
-
`start_date` | <code>datetime</code> | The date (in Atom format) when the membership starts, in the local timezone.
19
+
`subscription_id` | <code>int|null</code> | The unique identifier (integer) of a subscription that may be linked to the user membership. This property will exist only if the site is running WooCommerce Subscriptions alongside with Memberships. If there is no link to a subscription, the value will be _`null`_.<sup><ahref="#user-membership-data-subscriptions-inactive">1</a></sup>
20
+
`date_created` | <code>datetime</code> | _`read-only`_<br><br>The date (in Atom format) when the user membership object was created, in the local timezone. This does not necessarily match with the start date.
21
+
`date_created_gmt` | <code>datetime</code> | _`read-only`_<br><br>The date (in Atom format) when the user membership object was created, in UTC. This does not necessarily match with the start date.
22
+
`start_date` | <code>datetime</code> | _`read-only`_<br><br>The date (in Atom format) when the membership starts, in the local timezone.
23
23
`start_date_gmt` | <code>datetime</code> | The date (in Atom format) when the membership starts, in UTC.
24
-
`end_date` | <code>datetime|null</code> | The date (in Atom format) when the ends, in the local timezone. This is `null` if the membership doesn't have an end date.
24
+
`end_date` | <code>datetime|null</code> | _`read-only`_<br><br>The date (in Atom format) when the ends, in the local timezone. This is `null` if the membership doesn't have an end date.
25
25
`end_date_gmt` | <code>datetime|null</code> | The date (in Atom format) when the ends, in UTC. This is `null` if the membership doesn't have an end date.
26
-
`paused_date` | <code>datetime|null</code> | The date (in Atom format) when the membership was last paused, in the local timezone. This is `null` if the membership was never paused. The value is not removed if the membership changes status.
27
-
`paused_date_gmt` | <code>datetime|null</code> | The date (in Atom format) when the membership was last paused, in UTC. This is `null` if the membership was never paused. The value is not removed if the membership changes status.
26
+
`paused_date` | <code>datetime|null</code> | _`read-only`_<br><br>The date (in Atom format) when the membership was last paused, in the local timezone. This is `null` if the membership was never paused. The value is not removed if the membership changes status.
27
+
`paused_date_gmt` | <code>datetime|null</code> | _`read-only`_<br><br>The date (in Atom format) when the membership was last paused, in UTC. This is `null` if the membership was never paused. The value is not removed if the membership changes status.
28
28
`cancelled_date` | <code>datetime|null</code> | The date (in Atom format) when the membership was cancelled, in the local timezone. This is `null` if the membership was not cancelled.
29
29
`cancelled_date_gmt` | <code>datetime|null</code> | The date (in Atom format) when the membership was cancelled, in UTC. This is `null` if the membership was not cancelled.
30
-
`view_url` | <code>string</code> | URL pointing to the site's Members Area accessible to the membership's owner.
31
-
`meta_data` | <code>array</code> | Holds any WordPress meta data set on the membership. Each array item has an "id" _`(integer)`_, a "key" _`(string)`_ and a "value" (either a _`boolean`_, an _`integer`_, or _`string`_, which could also represent serialized data).
32
-
`links` | <code>array</code> | An array of items linking to related objects accessible through the REST API.
30
+
`view_url` | <code>string</code> | _`read-only`_<br><br>URL pointing to the site's Members Area accessible to the membership's owner.
31
+
`meta_data` | <code>array|object</code> | Holds any WordPress meta data set on the membership. Each array item has an "id" _`(integer)`_, a "key" _`(string)`_ and a "value" (either a _`boolean`_, an _`integer`_, or _`string`_, which could also represent serialized data).
32
+
`links` | <code>array</code> | _`read-only`_<br><br>An array of items linking to related objects accessible through the REST API.
`customer_id` | <code>int</code> | **Required**. ID of the customer that will become the owner of the user membership.
72
+
`plan_id` | <code>int</code> | **Required**. ID of the membership plan to grant access to.
73
+
`status` | <code>string</code> | _Optional_. The initial status of the user membership to be created. Defaults to _`active`_.
74
+
`order_id` | <code>int</code> | _Optional_. The ID of the associated order that granted access.
75
+
`product_id` | <code>int</code> | _Optional_. The ID of the associated product that granted access.
76
+
`subscription_id` | <code>int</code> | _Optional_. The ID of the subscription the membership will be linked to.
77
+
`start_date_gmt` | <code>datetime</code> | _Optional_. The date when the membership has started, in UTC. Defaults to the present time when the request is issued.
78
+
`end_date_gmt` | <code>datetime</code> | _Optional_. The date when the membership will end, in UTC. If status is expired, defaults to the present time when the request is issued.
79
+
`paused_date_gmt` | <code>datetime</code> | _Optional_. The date when the membership has been paused since, in UTC. If status is paused, defaults to the present time when the request is issued.
80
+
`cancelled_date_gmt` | <code>datetime</code> | _Optional_. The date when the membership has been cancelled, in UTC. If status is cancelled, defaults to the present time when the request is issued.
81
+
`meta_data` | <code>array</code> | _Optional_. Pass any WordPress post meta data to be set on the membership. Each array item has an "id" _`(integer)`_, a "key" _`(string)`_ and a "value" (either a _`boolean`_, an _`integer`_, or _`string`_, which could also represent serialized data).
> JSON response example for the request, containing a flag to confirm deletion and user membership data pertaining to the deleted user membership before the deletion was executed:
`include` | <code>int|int[]</code> | _`null`_ | Ensure that the specified user memberships with given ID (integer) or IDs (array of integers) will be included in the results, if found.
Issue a **PUT** request to this endpoint to update an existing user membership. You can pass the same properties as when creating a user membership, to update them.
0 commit comments