how should I decompose an web order to different 3rd party fulfillment systems?

23 Views Asked by At

I'm looking for some guidance about the architecture that should be in place to process our web orders. to illustrate my needs, here is an example: My website sells bundles of offers. Say I have an "eat-and-watch" bundle made of 2 offers:

  1. A pizza + drink bundle
  2. A specific football game to watch over the internet

A customer buys the bundle on my website. the website has a shopping cart functionality and the cart contains my bundle (and the 2 offers in the bundle) After customer pays, I need to send an order to the pizza company and to the TV company.

I'm thinking of 2 solutions: Option 1: My ecommerce platform should have an "OrderManagement" microservice that would split the cart into 2 orders: one for the pizza company and one for the TV company and then send the 2 separate orders via APIs. This sounds complicated as I need logic to decompose the order and send the right product to the right recipient.

Option 2: My ecommerce platform OrderManagement microservice just send one order "event" by API on a API gateway, that will, in turn, "broadcast" thi event. the pizza and the TV companies systems can listen to my events and pick the order. The obvious issue is that each company (pizza and TV) is now responsible for decomposing the order, take what is relevant for them and ignore the rest.

what is the best way to generate my individual sub- orders and send for fulfillment to other systems. That sounds like a lot what Amazon does: 1 shopping cart -> pay -> create many orders for various fulfillment systems.

0

There are 0 best solutions below