Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM Marketplace – REST API › Please how can i create a vendor, from a rest API
Tagged: registration, rest api, vendor, wcfm, WOO-COMMERCE
- This topic has 4 replies, 3 voices, and was last updated 4 years, 9 months ago by Sayan Naskar.
- AuthorPosts
- December 23, 2019 at 11:44 am #98654legendchykeParticipant
Hi,
Please, how can I create a vendor, from a rest API? The default WordPress user registers customer. and I need this to be able to create vendor directly from a rest API but I cannot seem to find any resources to help out. - December 28, 2019 at 11:27 am #99668Sayan NaskarMember
Hello,
WCFM rest api doesn’t have any route of itself to create users or even vendors you must use the default wordpress user creation route.
https://developer.wordpress.org/rest-api/reference/users/You must enter the correct user roles for in the api data for creating different user roles other than customers.
- December 28, 2019 at 11:53 am #99693Sayan NaskarMember
Hello again,
For your convenience the user role for vendors is wcfm_vendor - January 27, 2020 at 5:28 pm #104190arjunmurali1993Participant
Hi,
We already have an app to create products using the Woocommerce REST API. I was wondering if I could assign this product to a particular vendor when creating the product through the API. If possible, could you please explain how I can achieve this?
Regards,
Arjun - January 29, 2020 at 11:24 am #104477Sayan NaskarMember
Hello,
If you create a product through WCFM Rest api the product will automatically get assigned to the vendor already logged in.
But if you are using Woocommerce rest api you need to set the user id of the vendor and pass it as the author of the product to assign the vendor as the vendor of the product.Thank you.
- AuthorPosts
- You must be logged in to reply to this topic.