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
Copy file name to clipboardExpand all lines: README.md
+1-98Lines changed: 1 addition & 98 deletions
Original file line number
Diff line number
Diff line change
@@ -71,101 +71,4 @@ Please follow the [installation](#installation) instruction and execute the foll
71
71
var YoastProvisionerApiClient =require('Yoast provisioner API client');
72
72
```
73
73
74
-
# Subscription API
75
-
76
-
The subscription API can be used by Yoast partners to create subscriptions in MyYoast. Subscriptions facilitate passing license checks of yoast plugins.
77
-
78
-
We have a Swagger document you can use to [explore the API](https://my.yoast.com/provisioning-api/#/). We can provide the credentials to view it.
79
-
## Provisioner
80
-
81
-
A provisioner is a yoast partner allowed to create subscriptions in MyYoast.
82
-
83
-
We create an account for each provisioner, and with the credentials for that account, the provisioners can call the API endpoints.
84
-
85
-
The API uses basic auth. If you are a provisioner and do not yet have the proper credentials to call the provisioning API, please contact us.
86
-
87
-
## Client API
88
-
89
-
To assist provisioners we have used [swagger-codegen](https://swagger.io/docs/open-source-tools/swagger-codegen/) to generate clients for the API. There's:
The readme of these clients should explain how to install and use them.
96
-
97
-
## Subscription
98
-
99
-
A subscription gives a site a valid license for a plugin on the site of the customer's choice, for a set amount of time.
100
-
101
-
### Subscription statuses
102
-
103
-
There are four possible statuses a subscription can have:
104
-
105
-
-`active`: This subscription is active, will be set to `expired` when the end date has passed.
106
-
-`pending-cancel`: The customer has manually cancelled their subscription. The subscription will not be renewed, and will be set to `cancelled` when the end date has passed.
107
-
-`cancelled`: The subscription has been cancelled, and no longer provides a valid license.
108
-
-`expired`: The subscription's end date has passed without renewing, and no longer provides a valid license.
109
-
110
-
### Creating subscriptions
111
-
112
-
You can use the [create endpoint](https://my.yoast.com/provisioning-api/#/Subscription%20Provisioning/post_api_provisioning_subscriptions_create) to create a new subscription.
113
-
114
-
When creating a subscription, you should send along the site the customer wants to connect their subscription to. A subscription acts as a valid license for its connected site.
115
-
116
-
If you know the first name and last name of the customer, you should send them along as well. We use the names to address our customer in communication.
117
-
118
-
When a subscription is created, a MyYoast account is created for the customer if they didn't have an account already. With this account, the customer can access Yoast SEO Academy and its premium content.
119
-
We will then create the subscription for the customer, and return this new subscription as the response to the API call.
120
-
If the customer account is new, the customer will also receive an email informing them that an account has been created for them, and that they can set a password.
121
-
122
-
If the subscription should give the user access to courses (such as a Yoast SEO Premium subscription), these courses can be accessed via MyYoast in the [courses tab](https://my.yoast.com/courses).
123
-
124
-
### Renewing subscriptions
125
-
126
-
You can use the [renew endpoint](https://my.yoast.com/provisioning-api/#/Subscription%20Provisioning/post_api_provisioning_subscriptions__id__renew) to renew an existing subscription.
127
-
128
-
Renewing a subscription extends the subscription duration. The amount of time the subscription is extended by depends on the product.
129
-
Most products give access for one year. Some products give access for a month. This is or will be configured for your provisioner account.
130
-
131
-
Renewing a subscription sets the end date of the subscription to a new date further in the future.
132
-
If the end date of a subscription is in the past, the amount of extra time is added to the date of the request instead.
133
-
134
-
**Cancelled subscriptions can no longer be renewed.**
135
-
136
-
#### Cancelling subscriptions
137
-
138
-
If it is known that a customer will not renew their subscription or if the customer should no longer have their subscription, the [cancel endpoint](https://my.yoast.com/provisioning-api/#/Subscription%20Provisioning/post_api_provisioning_subscriptions__id__cancel) should be used.
139
-
140
-
The status of that subscription will be set to `pending-cancel`. It's still a valid license until the end date passes, then it will be set to `cancelled`.
141
-
142
-
If the customer should lose access immediately. you can set `immediately` to `true` in the body. In this case, the subscription is set to `cancelled` immediately, regardless of the amount of time the subscription had remaining. The subscription is no longer considered a valid license when it has the `cancelled` status.
143
-
144
-
### Subscription expiration and cancellation.
145
-
146
-
If a subscription's end date has passed, that subscription is due for expiration.
147
-
148
-
If the subscription's status is `active`, the subscription's status will be set to `expired`, and the subscription is no longer considered a valid license. We have a CRON job in my-yoast responsible for this. This is done automatically every 30 minutes..
149
-
150
-
The same applies for subscriptions that are `pending-cancel`, and whose end date has passed. These subscriptions will be set to `cancelled`.
151
-
152
-
## License checks
153
-
154
-
The Yoast plugin on the site of the customer sends a request on visiting the plugin page or the premium settings page, to check whether the site has a valid license for that plugin. This request is cached.
155
-
156
-
A site has a valid license for a product when the site has any connected `active` or `pending-cancel` subscription in MyYoast, that grants access to that product.
157
-
158
-
The response of the license check will always include a download url for the latest version of the plugins the user has access to.
159
-
160
-
### Connecting a site to subscriptions.
161
-
162
-
You can connect a site to a subscription on creation of that subscription, or use the [set-site endpoint](https://my.yoast.com/provisioning-api/#/Subscription%20Provisioning/post_api_provisioning_subscriptions__id__set_site) of the API.
163
-
164
-
## Getting the plugin
165
-
166
-
After a customer gets a subscription, that customer will get access to the connected product.
167
-
168
-
Any plugins the customer should get access to can be downloaded. The download URLS for a subscription are always present in any response to the subscription API.
169
-
170
-
If the subscription should give the user access to courses (such as a subscription for the Yoast SEO Premium plugin), these courses can be accessed via MyYoast on the [courses page](https://my.yoast.com/courses).
171
-
We will also send an email to the customer when the customer gets access to any of our courses. If a customer gains access to multiple courses at once, a single email is sent containing a notice of all the courses that are accessible.
74
+
Documentation on how to use the subscription API, can be found [in the developer docs.](https://developer.yoast.com/customization/myyoast/apis/subscription-api)
All URIs are relative to *https://my.yoast.test:3000/*
4
+
5
+
Method | HTTP request | Description
6
+
------------- | ------------- | -------------
7
+
[**apiProvisioningUserScheduleDeletePost**](ProvisioningUsersApi.md#apiProvisioningUserScheduleDeletePost) | **POST** /api/provisioning/user/schedule-delete | Schedule a delete for a subscription
0 commit comments