Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to I assign an item or an order to a location via API when creating an order?

Solved

How to I assign an item or an order to a location via API when creating an order?

APIANT
Shopify Partner
31 2 40

The location that appears above each item:

APIANT_0-1622171062245.png

I tried the Origin location ID but it doesn't seem to work

Accepted Solution (1)

APIANT
Shopify Partner
31 2 40

This is an accepted solution.

Here's the solution. After creating the order, fetch the order, the the fulfillment order IDs (if there is more than one location assigned) and move each item to the appropriate location using the Move fulfillment order endpoint:

 

APIANT_0-1685187449042.png

 

View solution in original post

Replies 2 (2)

APIANT
Shopify Partner
31 2 40

Is this how to do this?:

Create a simple order and fulfill it

 

 

POST /admin/api/2020-01/orders.json
{
  "order": {
    "email": "foo@example.com",
    "fulfillment_status": "fulfilled",
    "fulfillments": [
      {
        "location_id": 48752903
      }
    ],
    "line_items": [
      {
        "variant_id": 447654529,
        "quantity": 1
      }
    ]
  }
}

 

APIANT
Shopify Partner
31 2 40

This is an accepted solution.

Here's the solution. After creating the order, fetch the order, the the fulfillment order IDs (if there is more than one location assigned) and move each item to the appropriate location using the Move fulfillment order endpoint:

 

APIANT_0-1685187449042.png