OriginLocation vs Channel

hardwoodmarble
Tourist
10 0 5

I have an app where I'm trying to model sales. I'm looking at knowing where an order was made.

 

  • OriginLocation - There is almost no documentation on what an OriginLocation is, except for a single forum question. It seems that this is what I want. Like, to answer a question such as "Retail Sales by POS Location"
  • Channel - There doesn't seem to be anything in the API that models this, except when it comes to managing your own. If an Order comes in from like, Facebook or something, how would that appear in an order?
0 Likes
hardwoodmarble
Tourist
10 0 5

To expand a bit further, I would also like to know more about the relationship between

1. Locations and OriginLocations
2. Channels and OriginLocations

3. Product Availability and Locations. This is just governed by InventoryLevels, right?

4. "Physical" Location and Location. I think there isn't a difference, but the API docs make reference to both.

 

It seems like there is an OriginLocation created for each Location, right? But they have different IDs. Is there any way to find a mapping between the two?

Additionally there is an OriginLocation created for the store itself.

Then a Channel can have 1 or more OriginLocations, right? Like, "web"/"online store" has a single OriginLocation, while "pos" has multiple OriginLocations.

An Order will only have a location_id if it was a POS order, right?

 

Fulfillments are a whole 'nother ball-game, which I won't ask about here.

0 Likes
hardwoodmarble
Tourist
10 0 5
After almost a year of asking this question, I understand a lot more but still have questions around edge cases.

At a high level, what these represent


1. Channels - Represent an App. That is why they have App IDs.
2. Origin Locations - Represent a place where a sale is made. Can be a physical or virtual place.
3. (Fulfillment) Locations - Represent a physical place where an order was shipped from.


Now, the relationship between these things


1. Channels can have many Origin Locations. This makes intuitive sense when you think of an app like, "pos". Yes, Shopify POS is represented as its own app. App ID is 1354745. Other Apps are the "shopify_draft_order" App and the "web" App. So a Channel could have multiple physical POS locations. BUT, this also applies to virtual "places". For example the "web" Channel. This Channel generally only has 1 Origin Location, but that Origin Location can change. I'm not sure exactly when it happens, but if a Shop changes its address or maybe its default fulfillment location, then the Origin Location for that App changes too. The Channel of an Order never changes. Product "Availability" is governed by things called Publications. Products are published to Channels. An Order will always have a Channel, which is specified by its app_id.
 
2. Origin Locations - These "places" can belong to multiple Channels. web, shopify_draft_order and pos can also all the same Origin Location. I suppose this makes sense if a Shop is a retail store that also ships orders. So they make sales in store, online and over the phone. Generally web and shopify_draft_order are always using the same Origin Location, but the Origin Location they share can change over time, as mentioned above. The "web" channel also has other Origin Locations like Buy Button and Messenger. Maybe others, I don't know. I believe Shopify Partner apps only ever have a single Origin Location. The Origin Location of an order never changes. An Order's LineItems will _not_ always have an Origin Location. Sometimes they do, sometimes they don't. This is specified by the "origin_location" property. I'm not sure why the Origin Location is a property of the LineItem. Perhaps it is possible for 1 Order to have Line Items from multiple Origin Locations!
 
3. Locations are usually distinct from Channels and Origin locations but not always. For the pos Channel, the Origin Location and the fulfillment Location always represent the same plase. But the Origin Location and Location have different IDs so they're definitely different records in Shopify's DB. A Shop's shopify_draft_order and web Channels share the same default (fulfillment) Location when created. The fulfillment Location of an order can be changed though. There can also be multiple fulfillment Locations for an Order, even for the same line item if there are multiple quantities of it. An Order could ship from one Location and then be returned to a different Location. For example, a customer could order 2 of the same t-shirt, have the order originally be created to be fulfilled from one Location, then have the order actually fulfilled by 2 different Locations and then finally the customer could return each of the t-shirts to 2 entirely different locations. Variant inventory is managed by things called InventoryLevels. A Variant has an "available" quantity in Locations. Orders used to have Locations, but Locations are not only found on fulfillments (including Fulfillment Orders, refund Fulfillments and regular fulfillments).


(And can I just say that Shopify is useless at explaining this stuff! No support, no documentation, nothing.)
0 Likes