We have a cart and cart has line items, now line items can be products, discount coupons, rewards and promotions. I am looking for some inputs in design consideration here. The backend is in Ruby on Rails.
for products I have already designed the URL to be post: cart/line_items to create a line item for product put: cart/line_items/:id to update the quantity delete: cart/line_items/:id to remove the product
Now for Adding of samples and removing of samples, I am thinking of going this way.
get: cart/line_items/samples to get all the samples. post: cart/line_items/samples to create a line item for sample delete: cart/line_items/samples/:id to remove that sample from the cart
for discount coupon, rewards and promotions I am thinking of similar design. It would be great if experts can give me some inputs here.