# Create order

<mark style="color:green;">`POST`</mark> `https://api.printway.io/cdn/api/orders/v1/create`

#### Headers

| Name                                              | Type   | Description      |
| ------------------------------------------------- | ------ | ---------------- |
| PW-ACCESS-TOKEN<mark style="color:red;">\*</mark> | String | The Access Token |

#### Request Body

| Name                                                       | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ---------------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| order\_id<mark style="color:red;">\*</mark>                | String | Your Order ID: (Min : 5 characters)                                                                                                                                                                                                                                                                                                                                                                                          |
| shipping\_name<mark style="color:red;">\*</mark>           | String | Shipping name                                                                                                                                                                                                                                                                                                                                                                                                                |
| shipping\_email<mark style="color:red;">\*</mark>          | String | Shipping Email                                                                                                                                                                                                                                                                                                                                                                                                               |
| shipping\_phone<mark style="color:red;">\*</mark>          | String | Shipping Phone                                                                                                                                                                                                                                                                                                                                                                                                               |
| shipping\_address1<mark style="color:red;">\*</mark>       | String | Shipping address1                                                                                                                                                                                                                                                                                                                                                                                                            |
| shipping\_address2<mark style="color:red;">\*</mark>       | String | Shipping address2                                                                                                                                                                                                                                                                                                                                                                                                            |
| shipping\_city<mark style="color:red;">\*</mark>           | String | Shipping City                                                                                                                                                                                                                                                                                                                                                                                                                |
| shipping\_zip<mark style="color:red;">\*</mark>            | String | Shipping ZipCode                                                                                                                                                                                                                                                                                                                                                                                                             |
| shipping\_povince<mark style="color:red;">\*</mark>        | String | Shipping Province (State)                                                                                                                                                                                                                                                                                                                                                                                                    |
| shipping\_province\_code<mark style="color:red;">\*</mark> | String | <p>Shipping Province Code (StateCode) </p><p>(Max Length : 4 characters)</p>                                                                                                                                                                                                                                                                                                                                                 |
| shipping\_country<mark style="color:red;">\*</mark>        | String | Shipping Country                                                                                                                                                                                                                                                                                                                                                                                                             |
| shipping\_country\_code<mark style="color:red;">\*</mark>  | String | <p>Shipping Country Code </p><p>(Country Code ISO Alpha-2)</p>                                                                                                                                                                                                                                                                                                                                                               |
| order\_items<mark style="color:red;">\*</mark>             | Array  | Data items in order.                                                                                                                                                                                                                                                                                                                                                                                                         |
| method                                                     | Number | <p>Shipping Method (US): </p><p>    1 : (Express (Fastship 1-3 days. Note: shipping services for destinations within the US))</p><p>    2 : (Ground (3-5 business days delivery. Note: shipping services for destinations within the U.S))</p><p></p><p>Shipping Method (AU):</p><p>     1: (Express - Fast ship. Note: shipping services for destinations within the AU)</p><p></p><p>Default Shipping: null (Standard)</p> |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "status": 200,
    "message": "Create order successfully!",
    "result": {
        "order_id": "PWW1222366-11",
        "updated_at": "2022-01-22 10:04:13",
        "order_items": [
            {
                "pw_id": 192348,
                "product_name": "Product new item test 1",
                "item_sku": "PW-MALORM-DEFAULTSIZE-PACK1-ONESIDE",
                "unfulfill_quantity": 1
            },
            {
                "pw_id": 192349,
                "product_name": "Product new item test 2",
                "item_sku": "PW-MALORM-DEFAULTSIZE-PACK1-ONESIDE",
                "unfulfill_quantity": 5
            }
        ]
    }
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "status": 400,
    "message": "Error! Invalid Order Items.",
    "result": {
        "data_error": [
            {
                "item_sku": "Invalid item sku : PW-MALORM-DEFAULTSIZE-PACK1. Not found this sku."
            },
            {
                "item_sku": "Invalid item sku : PW-MALORM-DEFAUL-PACK1-ONESIDE. Not found this sku."
            }
        ]
    }
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    "status": 401,
    "message": "Not authenticated"
}
```

{% endtab %}
{% endtabs %}

> Data item in **`order_items`** :&#x20;
>
> * ***product\_name*** (`String`) : Item name / Required
> * ***variant\_title*** (`String`) : Variant Title / Required
> * ***item\_sku*** (String) : SKU in our system / Required
> * ***unfulfill\_quantity*** (`Number`) : Item quantity / Required
> * ***artwork\_front*** (`url`) : Link artwork front / Optional
> * ***artwork\_back*** (`url`) : Link artwork back / Optional
> * ***url\_mockup*** (`url`) : Link Mockup / Optional
> * ***variant\_note*** (`String`) : Item Note / Optional

```
// Data order items example:

 "order_items": [
        {
            "product_name" : "Product new item test 1",
            "variant_title": "DEFAULTSIZE / PACK1 / ONESIDE",
            "unfulfill_quantity": 1,
            "item_sku": "PW-MALORM-DEFAULTSIZE-PACK1-ONESIDE",
            "artwork_front" : "https://aws-test-printway.s3.ap-southeast-1.amazonaws.com/1002318-0-1633669018925.png",
            "artwork_back" : "",
            "url_mockup" :  "",
            "variant_note": "test"
        },
         {
            "product_name" : "Product new item test 2",
            "variant_title": "DEFAULTSIZE / PACK1 / ONESIDE",
            "unfulfill_quantity": 5,
            "item_sku": "PW-MALORM-DEFAULTSIZE-PACK1-ONESIDE",
            "artwork_front" : "https://aws-test-printway.s3.ap-southeast-1.amazonaws.com/1002318-0-1633669018925.png",
            "artwork_back" : "https://aws-test-printway.s3.ap-southeast-1.amazonaws.com/1002318-0-1633669018925.png",
            "url_mockup" :  "https://aws-test-printway.s3.ap-southeast-1.amazonaws.com/1002318-0-1633669018925.png",
            "variant_note": "test"
        }
    ]
```

```
// Data send order example:

{
    "order_id": "PWW1211112",
    "shipping_name": "American Auth",
    "shipping_phone": "+(807) 939 3211",
    "shipping_email": "localce12@gmail.com",
    "shipping_address1": "12 Adobe N Auth",
    "shipping_address2": "",
    "shipping_city": "Altamonte Springs",
    "shipping_zip": "15750",
    "shipping_province": "Florida",
    "shipping_province_code": "FL",
    "shipping_country": "United States",
    "shipping_country_code": "US",
    "order_items": [
        {
            "product_name" : "Product new item test 1",
            "variant_title": "DEFAULTSIZE / PACK1 / ONESIDE",
            "unfulfill_quantity": 1,
            "item_sku": "PW-MALORM-DEFAULTSIZE-PACK1-ONESIDE",
            "artwork_front" : "https://aws-test-printway.s3.ap-southeast-1.amazonaws.com/1002318-0-1633669018925.png",
            "artwork_back" : "",
            "url_mockup" :  "",
            "variant_note": "test"
        },
         {
            "product_name" : "Product new item test 2",
            "variant_title": "DEFAULTSIZE / PACK1 / ONESIDE",
            "unfulfill_quantity": 5,
            "item_sku": "PW-MALORM-DEFAULTSIZE-PACK1-ONESIDE",
            "artwork_front" : "https://aws-test-printway.s3.ap-southeast-1.amazonaws.com/1002318-0-1633669018925.png",
            "artwork_back" : "https://aws-test-printway.s3.ap-southeast-1.amazonaws.com/1002318-0-1633669018925.png",
            "url_mockup" :  "https://aws-test-printway.s3.ap-southeast-1.amazonaws.com/1002318-0-1633669018925.png",
            "variant_note": "test"
        }
    ]
}

```
