dyn-art / monorepo-v1

dyn.art monorepo
https://physicaldotart.vercel.app
GNU General Public License v3.0
0 stars 0 forks source link

[PHY-32] Receive new Etsy Orders #9

Closed bennobuilder closed 1 year ago

bennobuilder commented 1 year ago

DoD

From SyncLinear.com | PHY-32

bennobuilder commented 1 year ago

Options

Option 1: Listen on "new Order" Email

The core backend listens on the physicaldotart@gmail.com inbox and if a new Email matching a specific pattern like Du hast einen Verkauf auf Etsy erzielt [11,90 €, Bestellung #xxx] it interprets that as new order and fetches the actual order/receipt from the Etsy API.

Option 2: Poll Etsy API getReceipts() endpoint

The core backend has a cront job running that polls every x minutes the getReceipts() Etsy API endpoint to see whether a new order exists. To not process orders twice the min_created query parameter is used. So only receive orders to a specific timeframe, in this case after the last poll time. This last poll time will be saved in a Database so it won't get lost during a restart.

Decision