Closed allisonking closed 1 year ago
Some questions to answer:
List of sales (with timestamp?)
What was sold and how many
The response has a field called ItemQuantity
which will tell us how many were sold.
We can either take the easy way out and look at ItemDescription
to find out what was sold. Or we call https://apirest.3dcart.com/3dCartWebAPI/v1/Products/{CatalogID} to get the data. Second option probably better because it will also give us more accurate inventory data in the Stock field.
Current inventory?
Stock
field.What scopes do we need (read only, probably)?
What kind of app does Wacks need to be, i.e. long running webserver, or cron job?
The etsy flow was:
It sounds like shift4shop might be more like
Products/{CatalogID}
endpoint to get more data about itIn other words, shift4shop may naturally do the diff for us as long as we keep track of the timestamp
A few things to keep in mind.
If we just get new orders then we probably can just build the list of embeds directly from what is returned by the API.
https://miro.com/app/board/uXjVP_FGQG8=/ I stared a high level diagram but it needs some adjustments from you.
looks great!! it seems like there's an orderstatus
query param, so maybe we can use that to filter? or it'd be easy enough to filter on our end too.
Yep orderstatus=1 will give us new orders only so let's use that so we don't have to do the filtering ourselves haha
Endpoint to use https://apirest.3dcart.com/3dCartWebAPI/v1/Orders?orderstatus=1&offset=1&datestart=X where x is the last run time. This will give us the list of new orders since last run.
@rchhay what's the offset=1
for?
Shift4Shop has a pretty well documented developer portal. We need to experiment with their API and figure out the flow to replicate the functionality of https://github.com/allisonking/wacks-by-warby
https://apirest.3dcart.com/swagger/ui/index