Closed gavande1 closed 2 years ago
We need to implement route which will accept primary domain
and product slug
as URL parameter. The endpoint will return following fields as response;
Let's start with following fields and revisit them if needed.
Would active
always be 1? Or will this endpoint also return inactive subscriptions?
Yes. active
will be always 1 since we will looking for active subscriptions only.
How would you feel about dropping that field then? It feels redundant if it never changes.
In pdh6GB-1dL-p2#comment-2028 @cpapazoglou said that most 3PD need license type 2—could we select one or two of those and ask them what kinds of fields they'd expect/needed when querying this endpoint?
In pdh6GB-1dL-p2#comment-2028 @cpapazoglou said that most 3PD need license type 2—could we select one or two of those and ask them what kinds of fields they'd expect/needed when querying this endpoint?
List of plugins we're talking to and license type (linked here): pdh6GB-TH-p2#comment-2236
How would you feel about dropping that field then? It feels redundant if it never changes.
@cpapazoglou, I am okay with dropping active
field. Do you have any strong reason to keep it?
During our discussion in Slack, the team suggested that we should have wpcom/v2/vendor/subscriptions/SITE_DOMAIN/PRODUCT_SLUG
route instead of wpcom/v2/marketplace/subscriptions/SITE_DOMAIN/PRODUCT_SLUG
route for getting subscription information.
@cpapazoglou, I am okay with dropping active field. Do you have any strong reason to keep it?
I was thinking that we maybe show inactive ( expired / canceled ) subscriptions too, mainly for historical / debugging reasons. But I feel that it might derail us from the time being. We can drop it for now, and add it in a v2
version of the endpoint.
Diff created at: D84675-code
Over in https://github.com/Automattic/wp-calypso/issues/65348 we've been discussing Swagger as a docs engine. While I don't think we've committed to a path forward there yet, creating a separate API namespace for marketplace endpoints would make it easier to only show docs for those endpoints with the Swagger plugin. It might also be nice to have a bit of separation for external vendors etc.
marketplace/v1
? Something more namespaced to dotcom?
I was thinking about the same from beginning. However, I was bit sceptical since it will create entire new namespace for the api. So +1 for marketplace/v1
.
We wanted to avoid marketplace
term since we are probably renaming to WordPress.com Store. Marketplace
is an internal term only. Using a store
namespace is not very clear though, and marketplace
namespace isn't something that customer are seeing so I think we can go on with marketplace/v1
.
It looks like marketplace
is already used in the wpcom/v2/marketplace/products/
endpoint (2cfa1-pb/#plain). Maybe it would make sense to create a marketplace
folder to denote that namespace and move those endpoint files there?
marketplace/v1? Something more namespaced to dotcom?
I had brief discussion on slack with Barry about introducing new namespace for marketplace. It seems they advised against it and asked us if we could implement new routes under /rest/
namespace.
Slack Convo Link: p1658895973548579-slack-C02AVAR9B
Deployed r249744-wpcom behind a11n check.
Based on the docs in 2d01d-pb/#plain I think we should continue to create them in v2. Using the wpcom/v2
namespace won't be the end of the world.
Agreed. TBH I was looking for the this docs when Barry asked how did you end up having this namespace? IIRC, I followed this docs when I first created /marketplace/products
endpoint.
Summary
We need to create a WPCOM API through which vendors can get the subscription details (status, dateStart, dateEnd for a specific product & site. The GET an endpoint will include the siteUrl, productSlug in the URL.
Related to pdh6GB-1dL-p2#comment-1951