**Version: 202201**

# Create Order

**POST** `/openapi/2022-01/orders`

Merchants can use this feature to create orders on behalf of their customers.

## Request

**application/json**

**Body | Example**

**Body**

- `line_items` object[] (required)

  List of products

  *   Array [

  - `variant_id` string (required)
  - `product_id` string (required)
  - `quantity` int32 (required)

    Quantity of line item
  *   ]
- `shipping_address` object (required)

  Shipping address

  - `first_name` string

    First name of consignee.
  - `last_name` string (required)

    Last name of consignee.
  - `phone` string

    Phone number, for example: `+86 150 1447 1143`
  - `email` string (required)
  - `country` string (required)

    Country, for example: `United States`
  - `country_code` string (required)

    Country code, for example: `US`
  - `province` string (required)

    Province, for example: `New Mexico`
  - `province_code` string (required)

    Province Code, for example: `NM`
  - `area` string
  - `city` string (required)

    City, for example: `SAN JOSE`
  - `address` string (required)

    Street address, for example: `1 Rue des Carrieres`
  - `address1` string

    Apartment/floor/room number, for example: `Suite 1234`
  - `zip` string

    ZIP code, for example: `87036`
  - `company` string

    Company, for example: `ABC Limited`
  - `latitude` float

    Latitude of the delivery address, for example: `22.54`
  - `longitude` float

    Longitude of the delivery address, for example: `114.06`
  - `tags` string[]

    **Default value:** `["Tags"]`
- `tax_total` string (required)

  Order tax, numeric string, for example: `"9.99"`
- `currency_code` string (required)

  Currency code of the order, e.g. `"USD"`
- `discount` string

  Discount amount or percent for the order, discount amount cannot be greater than total price of line items, e.g. `"10.00"`, `"10%"`
- `note` string

  Note of the order
- `payment_line` string

  Payment method of the order, If you fill in "COD" and the merchant switch on cod, it is cod payment method, else if the merchant switch off "cod" ,you fill in anything it will automatically fill in the default payment method configured by the merchant in the store's admin. if you create a completed payment order, where 'payment_line' refers to the final method of payment. if you create an unpaid order, where 'payment_line' is just a suggested method of payment, not the final method that goes through the checkout process.
- `shipping_line` object

  - `name` string (required)

    Name of shipping line, for example: `"Free Shipping"`
  - `shipping_price` string (required)

    Shipping price, numeric string, for example: `"10.00"`, `"0"`
  - `desc` string

    Description of shipping line
- `tags` string[]

  Tags of the order

```json
{
  "line_items": [
    {
      "variant_id": "string",
      "product_id": "string",
      "quantity": 0
    }
  ],
  "shipping_address": {
    "first_name": "string",
    "last_name": "string",
    "phone": "string",
    "email": "string",
    "country": "string",
    "country_code": "string",
    "province": "string",
    "province_code": "string",
    "area": "string",
    "city": "string",
    "address": "string",
    "address1": "string",
    "zip": "string",
    "company": "string",
    "latitude": 0,
    "longitude": 0,
    "tags": [
      "string"
    ]
  },
  "tax_total": "string",
  "currency_code": "string",
  "discount": "string",
  "note": "string",
  "payment_line": "string",
  "shipping_line": {
    "name": "string",
    "shipping_price": "string",
    "desc": "string"
  },
  "tags": [
    "string"
  ]
}
```

## Responses

**200 | 422**

200

**application/json**

**Schema | Example | Result**

**Schema**

- `order` object

  - `id` string

    **Example:** `633130-00000005`
  - `note` string

    **Example:** `note`
  - `number` string

    **Example:** `00000005`
  - `financial_status` string

    **Example:** `waiting`
  - `status` string

    **Example:** `opened`
  - `cancel_reason`
  - `payment_method` string

    **Example:** `none`
  - `fulfillment_status` string

    **Example:** `initialled`
  - `discount_code` string

    **Example:** `bk:5bed44bd-5bee-44b8-97e4-96307341d9fb`
  - `discount_applications` string

    **Example:** `[{"type":"discount_code","code":"bk:5bed44bd-5bee-44b8-97e4-96307341d9fb","discount_id":"c9d74464-ffa1-4464-9197-1a1640419ab4","discount_amount":10,"entitled_product_list":[{"product_id":"a1a88be0-a1d4-47e4-a2f2-ba6e131cf447","variant_id":"88e68830-4ef5-4125-bf7d-aef8047176b2","price":"10.10","quantity":1,"compare_at_price":"12.10","inventory_tracking":false,"inventory_quantity":0,"spu":"T-M","collection_ids":null}],"value_type":"fixed_amount","target_type":"line_item","target_selection":"all","discount_type":"fixed_amount","title":"666","price_rule_id":"53293dc7-a234-44ee-bcab-c165a78b28e7"}]`
  - `customer_note` string

    **Example:**
  - `landing_site` string

    **Example:**
  - `buyer_accepts_marketing` boolean

    **Default value:** `true`

    **Example:** `false`
  - `currency` string

    **Example:** `USD`
  - `total_price` string

    **Example:** `15.20`
  - `total_discount` string

    **Example:** `10.00`
  - `total_tax` string

    **Example:** `10.10`
  - `total_shipping` string

    **Example:** `5.00`
  - `sub_total` string

    **Example:** `10.10`
  - `code_discount_total` string

    **Example:** `10.00`
  - `line_item_discount_total` string

    **Example:** `0.00`
  - `tags` string

    **Example:** `Test tag,openapi`
  - `created_at` string

    **Example:** `2024-04-19T08:09:04Z`
  - `updated_at` string

    **Example:** `2024-04-19T08:09:06Z`
  - `canceled_at`
  - `customer_deleted_at`
  - `deleted_at`
  - `placed_at`
  - `total_refund_price` string

    **Example:** `0.00`
  - `total_refund_tax` string

    **Example:** `0.00`
  - `total_refund_discount` string

    **Example:** `0.00`
  - `refund_status`
  - `total_tip_received` string

    **Example:** `0.00`
  - `browser_ip` string

    **Example:** `183.15.177.205`
  - `source` string

    **Example:**
  - `last_landing_url` string

    **Example:**
  - `email_status` string

    **Example:** `waiting`
  - `recovery_status` string

    **Example:** `waiting`
  - `total_paid` string

    **Example:** `0.00`
  - `source_name` object

    - `data` string

      **Example:**
    - `created_at` string

      **Example:**
  - `last_referrer_show` object

    - `data` string

      **Example:**
    - `created_at` string

      **Example:**
  - `shipping_line` object

    - `name` string

      **Example:** `test`
  - `customer` object

    - `id` string

      **Example:** `2dd957e3-2051-4cdf-8584-9c0046b4d1ae`
    - `email` string

      **Example:** `test@shoplazza.com`
    - `first_name` string

      **Example:** `ryan`
    - `last_name` string

      **Example:** `zhang`
    - `phone` string

      **Example:** `19873264342`
    - `created_at` string

      **Example:** `2024-04-18T09:29:24Z`
    - `updated_at` string

      **Example:** `2024-04-19T08:09:04Z`
    - `orders_count` integer

      **Default value:** `0`

      **Example:** `0`
    - `total_spent` string

      **Example:**
  - `shipping_address` object

    - `first_name` string

      **Example:** `Ryan`
    - `last_name` string

      **Example:** `Zhang`
    - `address1` string

      **Example:** `1 Rue des Carrieres`
    - `address2` string

      **Example:** `Suite 1234`
    - `phone` string

      **Example:** `19873264342`
    - `city` string

      **Example:** `北京`
    - `zip` string

      **Example:** `87036`
    - `province` string

      **Example:** `Beijing`
    - `country` string

      **Example:** `China mainland`
    - `company` string

      **Example:** `ABC Limited`
    - `latitude` string

      **Example:** `22.540000`
    - `longitude` string

      **Example:** `114.060000`
    - `name` string

      **Example:** `Ryan Zhang`
    - `country_code` string

      **Example:** `CN`
    - `province_code` string

      **Example:** `CN-BJ`
    - `phone_area_code` string

      **Example:**
    - `email` string

      **Example:** `test@shoplazza.com`
    - `area` string

      **Example:** `Bay area`
    - `extra_info`
  - `billing_address`
  - `payment_line`
  - `payment_lines`
  - `line_items` object[]

    *   Array [

    - `id` string

      **Example:** `21d66bba-06a7-4bac-a9e5-02b0e42e8062`
    - `product_id` string

      **Example:** `a1a88be0-a1d4-47e4-a2f2-ba6e131cf447`
    - `variant_id` string

      **Example:** `88e68830-4ef5-4125-bf7d-aef8047176b2`
    - `variant_title` string

      **Example:** `S-blue-T`
    - `product_title` string

      **Example:** `shirt`
    - `product_handle` string

      **Example:** `shirt`
    - `quantity` integer

      **Default value:** `0`

      **Example:** `1`
    - `note` string

      **Example:**
    - `fulfillment_status` string

      **Example:** `waiting`
    - `sku` string

      **Example:** `T-M-S-blue-T-A001004`
    - `weight_unit` string

      **Example:** `kg`
    - `vendor` string

      **Example:** `shoplazza`
    - `product_url` string

      **Example:** `/products/shirt`
    - `compare_at_price` string

      **Example:** `12.10`
    - `image` string

      **Example:** `//img.staticdj.com/ccf0794c594bad32a320eea0d6bfe40c.jpeg`
    - `price` string

      **Example:** `10.10`
    - `total` string

      **Example:** `10.10`
    - `weight` string

      **Example:** `1.10`
    - `properties` object[]

      *   Array [

      - `name` string

        **Example:** `size`
      - `value` string

        **Example:** `S`
      *   ]
    - `custom_properties`
    - `refund_quantity` integer

      **Default value:** `0`

      **Example:** `0`
    - `refund_total` string

      **Example:** `0.00`
    - `base_price` string

      **Example:** `10.10`
    - `discount_applications` string

      **Example:**
    - `duty_price` string

      **Example:** `0.00`
    - `tax_price` string

      **Example:** `0.00`
    *   ]
  - `fulfillments` object[]

    *   Array [

    - `` object
    *   ]
  - `gift_card_total` string

    **Example:** `0.00`
  - `shipping_tax_total` string

    **Example:** `0.00`
  - `product_tax_included` boolean

    **Default value:** `true`

    **Example:** `false`
  - `refer_info` string

    **Example:** `{"default_payment":"bogus_gateway","inventory_deduction":"order_created","ip":"183.15.177.205","source":"back","user_agent":"Apifox/1.0.0 (https://apifox.com)"}`
  - `additional_total` string

    **Example:** `0.00`
  - `additional_prices` object[]

    *   Array [

    - `` object
    *   ]
  - `logistics_code` string

    **Example:**
  - `config` object

    - `page_type` string

      **Example:** `three_step`
    - `requires_shipping` boolean

      **Default value:** `true`

      **Example:** `false`
    - `checkout_business_type` integer

      **Default value:** `0`

      **Example:** `0`
    - `product_tax_included` boolean

      **Default value:** `true`

      **Example:** `false`
    - `checkout_template_type` integer

      **Default value:** `0`

      **Example:** `0`
    - `market_setting`
  - `invoice_url` string

    **Example:** `https://zhangsenjun-shoplazza.stg.myshoplaza.com/checkout/633130-00000005?key=087ea25dea0be6c1ceab312119ed26`

```json
{
  "order": {
    "id": "633130-00000005",
    "note": "note",
    "number": "00000005",
    "financial_status": "waiting",
    "status": "opened",
    "cancel_reason": {},
    "payment_method": "none",
    "fulfillment_status": "initialled",
    "discount_code": "bk:5bed44bd-5bee-44b8-97e4-96307341d9fb",
    "discount_applications": "[{\"type\":\"discount_code\",\"code\":\"bk:5bed44bd-5bee-44b8-97e4-96307341d9fb\",\"discount_id\":\"c9d74464-ffa1-4464-9197-1a1640419ab4\",\"discount_amount\":10,\"entitled_product_list\":[{\"product_id\":\"a1a88be0-a1d4-47e4-a2f2-ba6e131cf447\",\"variant_id\":\"88e68830-4ef5-4125-bf7d-aef8047176b2\",\"price\":\"10.10\",\"quantity\":1,\"compare_at_price\":\"12.10\",\"inventory_tracking\":false,\"inventory_quantity\":0,\"spu\":\"T-M\",\"collection_ids\":null}],\"value_type\":\"fixed_amount\",\"target_type\":\"line_item\",\"target_selection\":\"all\",\"discount_type\":\"fixed_amount\",\"title\":\"666\",\"price_rule_id\":\"53293dc7-a234-44ee-bcab-c165a78b28e7\"}]",
    "customer_note": "",
    "landing_site": "",
    "buyer_accepts_marketing": false,
    "currency": "USD",
    "total_price": "15.20",
    "total_discount": "10.00",
    "total_tax": "10.10",
    "total_shipping": "5.00",
    "sub_total": "10.10",
    "code_discount_total": "10.00",
    "line_item_discount_total": "0.00",
    "tags": "Test tag,openapi",
    "created_at": "2024-04-19T08:09:04Z",
    "updated_at": "2024-04-19T08:09:06Z",
    "canceled_at": {},
    "customer_deleted_at": {},
    "deleted_at": {},
    "placed_at": {},
    "total_refund_price": "0.00",
    "total_refund_tax": "0.00",
    "total_refund_discount": "0.00",
    "refund_status": {},
    "total_tip_received": "0.00",
    "browser_ip": "183.15.177.205",
    "source": "",
    "last_landing_url": "",
    "email_status": "waiting",
    "recovery_status": "waiting",
    "total_paid": "0.00",
    "source_name": {
      "data": "",
      "created_at": ""
    },
    "last_referrer_show": {
      "data": "",
      "created_at": ""
    },
    "shipping_line": {
      "name": "test"
    },
    "customer": {
      "id": "2dd957e3-2051-4cdf-8584-9c0046b4d1ae",
      "email": "test@shoplazza.com",
      "first_name": "ryan",
      "last_name": "zhang",
      "phone": "19873264342",
      "created_at": "2024-04-18T09:29:24Z",
      "updated_at": "2024-04-19T08:09:04Z",
      "orders_count": 0,
      "total_spent": ""
    },
    "shipping_address": {
      "first_name": "Ryan",
      "last_name": "Zhang",
      "address1": "1 Rue des Carrieres",
      "address2": "Suite 1234",
      "phone": "19873264342",
      "city": "北京",
      "zip": "87036",
      "province": "Beijing",
      "country": "China mainland",
      "company": "ABC Limited",
      "latitude": "22.540000",
      "longitude": "114.060000",
      "name": "Ryan Zhang",
      "country_code": "CN",
      "province_code": "CN-BJ",
      "phone_area_code": "",
      "email": "test@shoplazza.com",
      "area": "Bay area",
      "extra_info": {}
    },
    "billing_address": {},
    "payment_line": {},
    "payment_lines": {},
    "line_items": [
      {
        "id": "21d66bba-06a7-4bac-a9e5-02b0e42e8062",
        "product_id": "a1a88be0-a1d4-47e4-a2f2-ba6e131cf447",
        "variant_id": "88e68830-4ef5-4125-bf7d-aef8047176b2",
        "variant_title": "S-blue-T",
        "product_title": "shirt",
        "product_handle": "shirt",
        "quantity": 1,
        "note": "",
        "fulfillment_status": "waiting",
        "sku": "T-M-S-blue-T-A001004",
        "weight_unit": "kg",
        "vendor": "shoplazza",
        "product_url": "/products/shirt",
        "compare_at_price": "12.10",
        "image": "//img.staticdj.com/ccf0794c594bad32a320eea0d6bfe40c.jpeg",
        "price": "10.10",
        "total": "10.10",
        "weight": "1.10",
        "properties": [
          {
            "name": "size",
            "value": "S"
          }
        ],
        "custom_properties": {},
        "refund_quantity": 0,
        "refund_total": "0.00",
        "base_price": "10.10",
        "discount_applications": "",
        "duty_price": "0.00",
        "tax_price": "0.00"
      }
    ],
    "fulfillments": [
      {}
    ],
    "gift_card_total": "0.00",
    "shipping_tax_total": "0.00",
    "product_tax_included": false,
    "refer_info": "{\"default_payment\":\"bogus_gateway\",\"inventory_deduction\":\"order_created\",\"ip\":\"183.15.177.205\",\"source\":\"back\",\"user_agent\":\"Apifox/1.0.0 (https://apifox.com)\"}",
    "additional_total": "0.00",
    "additional_prices": [
      {}
    ],
    "logistics_code": "",
    "config": {
      "page_type": "three_step",
      "requires_shipping": false,
      "checkout_business_type": 0,
      "product_tax_included": false,
      "checkout_template_type": 0,
      "market_setting": {}
    },
    "invoice_url": "https://zhangsenjun-shoplazza.stg.myshoplaza.com/checkout/633130-00000005?key=087ea25dea0be6c1ceab312119ed26"
  }
}
```

```json
{
    "order": {
        "id": "633130-00000005",
        "note": "note",
        "number": "00000005",
        "financial_status": "waiting",
        "status": "opened",
        "cancel_reason": null,
        "payment_method": "none",
        "fulfillment_status": "initialled",
        "discount_code": "bk:5bed44bd-5bee-44b8-97e4-96307341d9fb",
        "discount_applications": "[{\"type\":\"discount_code\",\"code\":\"bk:5bed44bd-5bee-44b8-97e4-96307341d9fb\",\"discount_id\":\"c9d74464-ffa1-4464-9197-1a1640419ab4\",\"discount_amount\":10,\"entitled_product_list\":[{\"product_id\":\"a1a88be0-a1d4-47e4-a2f2-ba6e131cf447\",\"variant_id\":\"88e68830-4ef5-4125-bf7d-aef8047176b2\",\"price\":\"10.10\",\"quantity\":1,\"compare_at_price\":\"12.10\",\"inventory_tracking\":false,\"inventory_quantity\":0,\"spu\":\"T-M\",\"collection_ids\":null}],\"value_type\":\"fixed_amount\",\"target_type\":\"line_item\",\"target_selection\":\"all\",\"discount_type\":\"fixed_amount\",\"title\":\"666\",\"price_rule_id\":\"53293dc7-a234-44ee-bcab-c165a78b28e7\"}]",
        "customer_note": "",
        "landing_site": "",
        "buyer_accepts_marketing": false,
        "currency": "USD",
        "total_price": "15.20",
        "total_discount": "10.00",
        "total_tax": "10.10",
        "total_shipping": "5.00",
        "sub_total": "10.10",
        "code_discount_total": "10.00",
        "line_item_discount_total": "0.00",
        "tags": "Test tag,openapi",
        "created_at": "2024-04-19T08:09:04Z",
        "updated_at": "2024-04-19T08:09:06Z",
        "canceled_at": null,
        "customer_deleted_at": null,
        "deleted_at": null,
        "placed_at": null,
        "total_refund_price": "0.00",
        "total_refund_tax": "0.00",
        "total_refund_discount": "0.00",
        "refund_status": null,
        "total_tip_received": "0.00",
        "browser_ip": "183.15.177.205",
        "source": "",
        "last_landing_url": "",
        "email_status": "waiting",
        "recovery_status": "waiting",
        "total_paid": "0.00",
        "source_name": {
            "data": "",
            "created_at": ""
        },
        "last_referrer_show": {
            "data": "",
            "created_at": ""
        },
        "shipping_line": {
            "name": "test"
        },
        "customer": {
            "id": "2dd957e3-2051-4cdf-8584-9c0046b4d1ae",
            "email": "test@shoplazza.com",
            "first_name": "ryan",
            "last_name": "zhang",
            "phone": "19873264342",
            "created_at": "2024-04-18T09:29:24Z",
            "updated_at": "2024-04-19T08:09:04Z",
            "orders_count": 0,
            "total_spent": ""
        },
        "shipping_address": {
            "first_name": "Ryan",
            "last_name": "Zhang",
            "address1": "1 Rue des Carrieres",
            "address2": "Suite 1234",
            "phone": "19873264342",
            "city": "北京",
            "zip": "87036",
            "province": "Beijing",
            "country": "China mainland",
            "company": "ABC Limited",
            "latitude": "22.540000",
            "longitude": "114.060000",
            "name": "Ryan Zhang",
            "country_code": "CN",
            "province_code": "CN-BJ",
            "phone_area_code": "",
            "email": "test@shoplazza.com",
            "area": "Bay area",
            "extra_info": null
        },
        "billing_address": null,
        "payment_line": null,
        "payment_lines": null,
        "line_items": [
            {
                "id": "21d66bba-06a7-4bac-a9e5-02b0e42e8062",
                "product_id": "a1a88be0-a1d4-47e4-a2f2-ba6e131cf447",
                "variant_id": "88e68830-4ef5-4125-bf7d-aef8047176b2",
                "variant_title": "S-blue-T",
                "product_title": "shirt",
                "product_handle": "shirt",
                "quantity": 1,
                "note": "",
                "fulfillment_status": "waiting",
                "sku": "T-M-S-blue-T-A001004",
                "weight_unit": "kg",
                "vendor": "shoplazza",
                "product_url": "/products/shirt",
                "compare_at_price": "12.10",
                "image": "//img.staticdj.com/ccf0794c594bad32a320eea0d6bfe40c.jpeg",
                "price": "10.10",
                "total": "10.10",
                "weight": "1.10",
                "properties": [
                    {
                        "name": "size",
                        "value": "S"
                    },
                    {
                        "name": "color",
                        "value": "blue"
                    },
                    {
                        "name": "type",
                        "value": "T"
                    }
                ],
                "custom_properties": null,
                "refund_quantity": 0,
                "refund_total": "0.00",
                "base_price": "10.10",
                "discount_applications": "",
              	"duty_price": "0.00",
                "tax_price": "0.00"
            }
        ],
        "fulfillments": [],
        "gift_card_total": "0.00",
        "shipping_tax_total": "0.00",
        "product_tax_included": false,
        "refer_info": "{\"default_payment\":\"bogus_gateway\",\"inventory_deduction\":\"order_created\",\"ip\":\"183.15.177.205\",\"source\":\"back\",\"user_agent\":\"Apifox/1.0.0 (https://apifox.com)\"}",
        "additional_total": "0.00",
        "additional_prices": [],
        "logistics_code": "",
        "config": {
            "page_type": "three_step",
            "requires_shipping": false,
            "checkout_business_type": 0,
            "product_tax_included": false,
            "checkout_template_type": 0,
            "market_setting": null
        },
        "invoice_url": "https://zhangsenjun-shoplazza.stg.myshoplaza.com/checkout/633130-00000005?key=087ea25dea0be6c1ceab312119ed26"
    }
}
```

422

**text/plain**

**Schema | Example | Result**

**Schema**

- `errors` string[]

```json
{
  "errors": [
    "TaxTotal is required"
  ]
}
```

```shell
{
  "errors": [
    "TaxTotal is required"
  ]
}
```
