Skip to content

Commit 38804bc

Browse files
committed
Fix typo, add webhooks
1 parent 71ee619 commit 38804bc

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

source/includes/_webhooks.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# WebHooks
2+
3+
WooCommerce Memberships extends WooCommerce with custom webhooks that are triggered when changes occur to User Memberships or Membership Plan objects.
4+
5+
## User Memberships
6+
7+
Each of the following webhooks will send a corresponding [user membership object](/#the-user-membership) as payload.
8+
9+
Name | Description
10+
----------------------------- | ---------------------------------
11+
`user_membership.created` | Triggered when a user membership is created, via any means.
12+
`user_membership.updated` | Triggered when a user membership is changed or modified (e.g. status change, update in admin, etc.).
13+
`user_membership.transferred` | Triggered when a user membership is transferred from a user to another (the user owner of the membership has changed).
14+
`user_membership.created` | Triggered when a user membership has been permanently deleted.
15+
16+
## Membership Plans
17+
18+
Each of the following webhooks will send a corresponding [membership plan object](/#the-membership-plan) as payload.
19+
20+
Name | Description
21+
----------------------------- | ---------------------------------
22+
`membership_plan.created` | Triggered when a membership plan has been created.
23+
`membership_plan.updated` | Triggered when a membership plan has been updated (with one of its properties modified or just saved without data change).
24+
`membership_plan.deleted` | Triggered when a membership plan has been moved to the trash (not permanently deleted, but assumed so unless restored).
25+
`membership_plan.restored` | Triggered when a membership plan is moved back from the trash (not necessarily as published, could be in draft status or other status).

source/index.html.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ toc_footers:
1010
- <a href='https://docs.woocommerce.com/document/woocommerce-memberships/'>Plugin Documentation</a>
1111

1212
includes:
13+
- webhooks
1314
- errors
1415

1516
search: true
@@ -19,7 +20,7 @@ search: true
1920

2021
Welcome to the [WooCommerce Memberships](https://woocommerce.com/products/woocommerce-memberships/) REST API documentation!
2122

22-
Memberships extends [WooCommerce](https://woocommerce.com/) and builds upon the [WordPress REST API](http://v2.wp-api.org/) to handle user memberships and memberships plans data through robust REST API endpoints.
23+
Since version 1.11.0, Memberships extends [WooCommerce](https://woocommerce.com/) and builds upon the [WordPress REST API](http://v2.wp-api.org/) to handle user memberships and memberships plans data through robust REST API endpoints.
2324

2425
Memberships currently supports v2 of the WooCommerce REST API extension for WordPress, therefore all its endpoints will be added to the `/wc/v2/` route.
2526

@@ -64,7 +65,7 @@ Property | Type | Description
6465
`plan_id` | <code>int</code> | The unique identifier (integer) of the membership plan the membership is for.
6566
`status` | <code>string</code> | The current status (string) of the user membership.
6667
`order_id` | <code>int&#124;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`_.
67-
`subcription_id` | <code>int&#124;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`_.
68+
`subscription_id` | <code>int&#124;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`_.
6869
`product_id` | <code>int&#124;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`_.
6970
`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.
7071
`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.

0 commit comments

Comments
 (0)