• Resolved lucas6888

    (@lucas6888)


    Hi, is there any way I can offer, as a B2B website, limited access to the WooCommerce API endpoints needed to place an order on my store but no other endpoints? I can create keys for read/write/read&write permissions, but how do I limit my partners to only placing orders through APIs and deny access to endpoints to edit products or other things? Also, how could I receive payments if my customers place orders using this method?

    Thanks in advance for any answer!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi @lucas6888,

    Thank you for reaching out.

    You can restrict API access to specific endpoints, however, WooCommerce does not support this natively. You would need to implement custom code in order to achieve this.

    As for payments, when orders are created via the WooCommerce API, the order status is set to ‘pending’ by default. You can then send an invoice to the customer for payment, or if you have set up a payment gateway that supports direct payment via API, you can charge the customer’s card directly.

    With that said, I recommend reaching out to a developer, as this involves custom coding and implementations. The WooCommerce community is filled with talented open-source developers, and many of them are active on the channels listed below:

    Hope this helps!

    Thread Starter lucas6888

    (@lucas6888)

    Thank you for your answer. In your opinion this solution (that is, to restrict APIs) would be better or worse than creating instead a custom endpoint that allows to place orders? Someone suggested me this second option, but wouldn’t the customer still need an API key or any other type of authentication to access the custom endpoint, having so access to everything? I would appreciate if you could clarify this thing.

    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi again @lucas6888,

    As I mentioned, that would involve custom coding and deeper understanding of the WooCommerce API and some payment gateway APIs.

    However, both solutions have their merits. Restricting APIs can be a good solution if you want to limit what users do. Also, creating a custom endpoint that allows placing orders can provide flexibility and control over the ordering process.

    I hope this clarifies your question.

    Thread Starter lucas6888

    (@lucas6888)

    I see, thank you for your time

    Hey, @lucas6888!

    Thanks for understanding.

    I’ll close this thread now, okay?

    Please let us know if there’s anything else we can do to help or if you have any questions.

    Have a wonderful day!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.