Please how can i create a vendor, from a rest API

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM Marketplace – REST API Please how can i create a vendor, from a rest API

This topic contains 4 replies, has 3 voices, and was last updated by Avatar Sayan Naskar 7 months, 3 weeks ago.

  • Author
    Posts
  • #98654
    Avatar
    legendchyke
    Participant

    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.

  • #99668
    Avatar
    Sayan Naskar
    Keymaster

    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.

  • #99693
    Avatar
    Sayan Naskar
    Keymaster

    Hello again,
    For your convenience the user role for vendors is wcfm_vendor

  • #104190
    Avatar
    arjunmurali1993
    Participant

    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

  • #104477
    Avatar
    Sayan Naskar
    Keymaster

    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.

You must be logged in to reply to this topic.