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.

Order Api Create order with multiple locations

Order Api Create order with multiple locations

antonioreale
Shopify Partner
19 1 3

Hello, how to create an order if there are products purchased from multiple locations?

For example a customer purchase a product A from location 1 and a product B from location 2.

How to create an order?

 

 

 

{
  "order": {
    "id": 1073459966,
    "admin_graphql_api_id": "gid://shopify/Order/1073459966",
    "app_id": 755357713,
    "browser_ip": null,
    "buyer_accepts_marketing": false,
    "cancel_reason": null,
    "cancelled_at": null,
    "cart_token": null,
    "checkout_id": null,
    "checkout_token": null,
    "client_details": null,
    "closed_at": null,
    "confirmed": true,
    "contact_email": null,
    "created_at": "2022-04-05T13:15:18-04:00",
    "currency": "USD",
    "current_subtotal_price": "199.00",
    "current_subtotal_price_set": {
      "shop_money": {
        "amount": "199.00",
        "currency_code": "USD"
      },
      "presentment_money": {
        "amount": "199.00",
        "currency_code": "USD"
      }
    },
    "current_total_discounts": "0.00",
    "current_total_discounts_set": {
      "shop_money": {
        "amount": "0.00",
        "currency_code": "USD"
      },
      "presentment_money": {
        "amount": "0.00",
        "currency_code": "USD"
      }
    },
    "current_total_duties_set": null,
    "current_total_price": "199.00",
    "current_total_price_set": {
      "shop_money": {
        "amount": "199.00",
        "currency_code": "USD"
      },
      "presentment_money": {
        "amount": "199.00",
        "currency_code": "USD"
      }
    },
    "current_total_tax": "0.00",
    "current_total_tax_set": {
      "shop_money": {
        "amount": "0.00",
        "currency_code": "USD"
      },
      "presentment_money": {
        "amount": "0.00",
        "currency_code": "USD"
      }
    },
    "customer_locale": null,
    "device_id": null,
    "discount_codes": [],
    "email": "",
    "estimated_taxes": false,
    "financial_status": "paid",
    "fulfillment_status": null,
    "gateway": "",
    "landing_site": null,
    "landing_site_ref": null,
    "location_id": null,
    "name": "#1002",
    "note": null,
    "note_attributes": [],
    "number": 2,
    "order_number": 1002,
    "order_status_url": "https://jsmith.myshopify.com/548380009/orders/f333f8f057ab3708f79cf04ab1c108cb/authenticate?key=f86449591c04f9d6c7005d70c628195f",
    "original_total_duties_set": null,
    "payment_gateway_names": [],
    "phone": null,
    "presentment_currency": "USD",
    "processed_at": "2022-04-05T13:15:18-04:00",
    "processing_method": "",
    "reference": null,
    "referring_site": null,
    "source_identifier": null,
    "source_name": "755357713",
    "source_url": null,
    "subtotal_price": "199.00",
    "subtotal_price_set": {
      "shop_money": {
        "amount": "199.00",
        "currency_code": "USD"
      },
      "presentment_money": {
        "amount": "199.00",
        "currency_code": "USD"
      }
    },
    "tags": "",
    "tax_lines": [],
    "taxes_included": false,
    "test": false,
    "token": "f333f8f057ab3708f79cf04ab1c108cb",
    "total_discounts": "0.00",
    "total_discounts_set": {
      "shop_money": {
        "amount": "0.00",
        "currency_code": "USD"
      },
      "presentment_money": {
        "amount": "0.00",
        "currency_code": "USD"
      }
    },
    "total_line_items_price": "199.00",
    "total_line_items_price_set": {
      "shop_money": {
        "amount": "199.00",
        "currency_code": "USD"
      },
      "presentment_money": {
        "amount": "199.00",
        "currency_code": "USD"
      }
    },
    "total_outstanding": "199.00",
    "total_price": "199.00",
    "total_price_set": {
      "shop_money": {
        "amount": "199.00",
        "currency_code": "USD"
      },
      "presentment_money": {
        "amount": "199.00",
        "currency_code": "USD"
      }
    },
    "total_price_usd": "199.00",
    "total_shipping_price_set": {
      "shop_money": {
        "amount": "0.00",
        "currency_code": "USD"
      },
      "presentment_money": {
        "amount": "0.00",
        "currency_code": "USD"
      }
    },
    "total_tax": "0.00",
    "total_tax_set": {
      "shop_money": {
        "amount": "0.00",
        "currency_code": "USD"
      },
      "presentment_money": {
        "amount": "0.00",
        "currency_code": "USD"
      }
    },
    "total_tip_received": "0.00",
    "total_weight": 0,
    "updated_at": "2022-04-05T13:15:18-04:00",
    "user_id": null,
    "billing_address": null,
    "customer": null,
    "discount_applications": [],
    "fulfillments": [],
    "line_items": [
      {
        "id": 1071823188,
        "admin_graphql_api_id": "gid://shopify/LineItem/1071823188",
        "fulfillable_quantity": 1,
        "fulfillment_service": "shipwire-app",
        "fulfillment_status": null,
        "gift_card": false,
        "grams": 567,
        "name": "IPod Touch 8GB - Black",
        "price": "199.00",
        "price_set": {
          "shop_money": {
            "amount": "199.00",
            "currency_code": "USD"
          },
          "presentment_money": {
            "amount": "199.00",
            "currency_code": "USD"
          }
        },
        "product_exists": true,
        "product_id": 921728736,
        "properties": [],
        "quantity": 1,
        "requires_shipping": true,
        "sku": "IPOD2009BLACK",
        "taxable": true,
        "title": "IPod Touch 8GB",
        "total_discount": "0.00",
        "total_discount_set": {
          "shop_money": {
            "amount": "0.00",
            "currency_code": "USD"
          },
          "presentment_money": {
            "amount": "0.00",
            "currency_code": "USD"
          }
        },
        "variant_id": 447654529,
        "variant_inventory_management": "shipwire-app",
        "variant_title": "Black",
        "vendor": "Apple",
        "tax_lines": [],
        "duties": [],
        "discount_allocations": []
      }
    ],
    "payment_details": null,
    "refunds": [],
    "shipping_address": null,
    "shipping_lines": []
  }
}

 

 

This is an example of an order creation, there is only a single location_id line.

How to properly create an order with multiple locations? 

Replies 0 (0)