vend / developer-wiki

5 stars 0 forks source link

API to add a configurable button in the UI #4

Open antoineazar opened 8 years ago

antoineazar commented 8 years ago

Expected Behavior

A simple API to create/edit/remove a configurable button in the UI would allow many useful integrations to Vend. What could be configured:

Clicking the button would open the URL in an overlaid iframe, and pass as a POST parameter the payload of the sale (customerId, sale lines). The iframe component is important because it allows using the Vend javascript API such as the 'add-product' method to directly modify the sale.

Context

In the context of a loyalty/CRM solution for Vend, we need to be able to read a current sale (customerId and sale lines), and be able to modify the line items. In the absence of this, we have needed to build a browser extension to reproduce this functionality. It's cumbersome for the retailers, breaks on DOM changes, and is a poor overall experience. This would allow us to ditch the browser extension. As soon as we would connect via OAuth, we'd call this API, and the button would magically appear in Vend.