> For the complete documentation index, see [llms.txt](https://pgprints.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pgprints.gitbook.io/api/reference/api-reference/create-order-label.md).

# Create Order Label

## Creating a new order

## Create Order Label

<mark style="color:green;">`POST`</mark> `https://app.pgprints.io/app/v1/orders/create-label` &#x20;

Creates a new order

#### Headers

| Name                                                     | Type   | Description                                                              |
| -------------------------------------------------------- | ------ | ------------------------------------------------------------------------ |
| Content-Type<mark style="color:red;">\*</mark>           | string | application/json                                                         |
| X-PGPrints-Hmac-Sha256<mark style="color:red;">\*</mark> | string | see the authentication: <https://pgprints.gitbook.io/api/authentication> |
| X-PGPrints-Store-Id<mark style="color:red;">\*</mark>    | string | use the Store ID taken from the Manage Keys                              |

#### Request Body

| Name                                                       | Type   | Description                    |
| ---------------------------------------------------------- | ------ | ------------------------------ |
| order\_id<mark style="color:red;">\*</mark>                | string | unique identifier for an order |
| shipping\_address\_label<mark style="color:red;">\*</mark> | string |                                |
| billing\_address                                           | object |                                |
| customer<mark style="color:red;">\*</mark>                 | object |                                |
| line\_items<mark style="color:red;">\*</mark>              | array  |                                |
| response\_type                                             | string | normal                         |

{% tabs %}
{% tab title="200 Orders successfully created" %}

```javascript
{
    "name"="Wilson",
    "owner": {
        "id": "sha7891bikojbkreuy",
        "name": "Samuel Passet",
    "species": "Dog",}
    "breed": "Golden Retriever",
}
```

{% endtab %}

{% tab title="401 Permission denied" %}

{% endtab %}
{% endtabs %}

<pre class="language-json"><code class="lang-json"><strong>// example body
</strong>{
  "order_id": "G-20035",
  "email": "Support@pgprints.io",
  "shipping_address_label": "https://firebasestorage.googleapis.com/v0/b/avada-pgc.appspot.com",
  "customer": {
    "first_name": "PGCom",
    "last_name": "Group"
  },
  "billing_address": {
    "first_name": "PGCom",
    "address1": "102 Tran Phu",
    "phone": "098454654",
    "city": "Ha Noi",
    "zip": "151100",
    "province": "Ha Noi",
    "country": "Viet Nam",
    "last_name": "Group",
    "address2": "HĐ",
    "company": "MP",
    "latitude": null,
    "longitude": null,
    "name": "PGCom Group",
    "country_code": "VN",
    "province_code": "VN-HN"
  },
   "line_items": [
    {
      "name": "tem1",
      "refId": "refId",
      "quantity": 3,
      "sku": "CSC-ft-One_size",
      "shipClass": "Standard",
      "fileUrls" : [
          "https://firebasestorage.googleapis.com/v0/b/avada-pgc.appspot.com/o/media%2F615d21b1075eba0ab5ce8cb5%2Fall%2F1687334047149_linen-music-110522-harrystyle-post.JPG?alt=media&#x26;token=6946b1be-f59b-4dd9-a5fb-1ad0c1e3cde3"
      ],
      "mockupImages": [
          "https://firebasestorage.googleapis.com/v0/b/avada-pgc.appspot.com/o/media%2F615d21b1075eba0ab5ce8cb5%2Fall%2F1686881889139_linen-harry-150822-lovetour-2022mk.JPG?alt=media&#x26;token=551f9f12-a3df-42db-9dc5-8fbc034ab36d"
      ]
    }
  ]
}
</code></pre>

This is my code in some language:

{% tabs %}
{% tab title="NodeJS" %}

<pre class="language-javascript"><code class="lang-javascript">//example nodejs with axios
var axios = require('axios');
var data = JSON.stringify({"body"});

var config = {
<strong>  method: 'post',
</strong>  url: 'https://app.pgprints.io/app/v1/orders/create-label',
  headers: { 
    'Content-Type': 'application/json', 
    'X-PGPrints-Store-Id': 'storeid', 
    'X-PGPrints-Hmac-Sha256': 'sha256'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

</code></pre>

{% endtab %}

{% tab title="PHP" %}

```php
//example php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://app.pgprints.io/app/v1/orders/create-label',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
  "order_id": "G-20035",
  "email": "Support@pgprints.io",
  "shipping_address_label": "https://firebasestorage.googleapis.com/v0/b/avada-pgc.appspot.com",
  "customer": {
    "first_name": "PGCom",
    "last_name": "Group"
  },
  "billing_address": {
    "first_name": "PGCom",
    "address1": "102 Tran Phu",
    "phone": "098454654",
    "city": "Ha Noi",
    "zip": "151100",
    "province": "Ha Noi",
    "country": "Viet Nam",
    "last_name": "Group",
    "address2": "HĐ",
    "company": "MP",
    "latitude": null,
    "longitude": null,
    "name": "PGCom Group",
    "country_code": "VN",
    "province_code": "VN-HN"
  },
   "line_items": [
    {
      "name": "tem1",
      "refId": "refId",
      "quantity": 3,
      "sku": "CSC-ft-One_size",
      "shipClass": "Standard",
      "fileUrls" : [
          "https://firebasestorage.googleapis.com/v0/b/avada-pgc.appspot.com/o/media%2F615d21b1075eba0ab5ce8cb5%2Fall%2F1687334047149_linen-music-110522-harrystyle-post.JPG?alt=media&token=6946b1be-f59b-4dd9-a5fb-1ad0c1e3cde3"
      ],
      "mockupImages": [
          "https://firebasestorage.googleapis.com/v0/b/avada-pgc.appspot.com/o/media%2F615d21b1075eba0ab5ce8cb5%2Fall%2F1686881889139_linen-harry-150822-lovetour-2022mk.JPG?alt=media&token=551f9f12-a3df-42db-9dc5-8fbc034ab36d"
      ]
    }
  ]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-PGPrints-Store-Id: storeid',
    'X-PGPrints-Hmac-Sha256: sha256'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}

{% tab title="CURL" %}

```powershell
//example curl
curl --location --request POST 'https://app.pgprints.io/app/v1/orders/create-label' \
--header 'Content-Type: application/json' \
--header 'X-PGPrints-Store-Id: storeid' \
--header 'X-PGPrints-Hmac-Sha256: sha256' \
--data-raw '{
  "order_id": "G-20035",
  "email": "Support@pgprints.io",
  "shipping_address_label": "https://firebasestorage.googleapis.com/v0/b/avada-pgc.appspot.com",
  "customer": {
    "first_name": "PGCom",
    "last_name": "Group"
  },
  "billing_address": {
    "first_name": "PGCom",
    "address1": "102 Tran Phu",
    "phone": "098454654",
    "city": "Ha Noi",
    "zip": "151100",
    "province": "Ha Noi",
    "country": "Viet Nam",
    "last_name": "Group",
    "address2": "HĐ",
    "company": "MP",
    "latitude": null,
    "longitude": null,
    "name": "PGCom Group",
    "country_code": "VN",
    "province_code": "VN-HN"
  },
   "line_items": [
    {
      "name": "tem1",
      "refId": "refId",
      "quantity": 3,
      "sku": "CSC-ft-One_size",
      "shipClass": "Standard",
      "fileUrls" : [
          "https://firebasestorage.googleapis.com/v0/b/avada-pgc.appspot.com/o/media%2F615d21b1075eba0ab5ce8cb5%2Fall%2F1687334047149_linen-music-110522-harrystyle-post.JPG?alt=media&token=6946b1be-f59b-4dd9-a5fb-1ad0c1e3cde3"
      ],
      "mockupImages": [
          "https://firebasestorage.googleapis.com/v0/b/avada-pgc.appspot.com/o/media%2F615d21b1075eba0ab5ce8cb5%2Fall%2F1686881889139_linen-harry-150822-lovetour-2022mk.JPG?alt=media&token=551f9f12-a3df-42db-9dc5-8fbc034ab36d"
      ]
    }
  ]
}
  
```

{% endtab %}

{% tab title="Postman" %}

```
//example 

Method: 'POST',
Url: 'https://app.pgprints.io/app/v1/orders/create-label',
Headers: { 
    'Content-Type': 'application/json', 
    'X-PGPrints-Store-Id': 'storeid', 
    'X-PGPrints-Hmac-Sha256': 'sha256'
  },
Body raw: {
  "order_id": "G-20035",
  "email": "Support@pgprints.io",
  "shipping_address_label": "https://firebasestorage.googleapis.com/v0/b/avada-pgc.appspot.com",
  "customer": {
    "first_name": "an",
    "last_name": "na"
  },
  "billing_address": {
    "first_name": "an",
    "address1": "102 Tran Phu",
    "phone": "098454654",
    "city": "Ha Noi",
    "zip": "151100",
    "province": "Ha Noi",
    "country": "Viet Nam",
    "last_name": "na",
    "address2": "HĐ",
    "company": "MP",
    "latitude": null,
    "longitude": null,
    "name": "an na",
    "country_code": "VN",
    "province_code": "VN-HN"
  },
   "line_items": [
    {
      "name": "tem1",
      "refId": "refId",
      "quantity": 3,
      "sku": "CSC-ft-One_size",
      "shipClass": "Standard",
      "fileUrls" : [
          "https://firebasestorage.googleapis.com/v0/b/avada-pgc.appspot.com/o/media%2F615d21b1075eba0ab5ce8cb5%2Fall%2F1687334047149_linen-music-110522-harrystyle-post.JPG?alt=media&token=6946b1be-f59b-4dd9-a5fb-1ad0c1e3cde3"
      ],
      "mockupImages": [
          "https://firebasestorage.googleapis.com/v0/b/avada-pgc.appspot.com/o/media%2F615d21b1075eba0ab5ce8cb5%2Fall%2F1686881889139_linen-harry-150822-lovetour-2022mk.JPG?alt=media&token=551f9f12-a3df-42db-9dc5-8fbc034ab36d"
      ]
    }
  ]
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pgprints.gitbook.io/api/reference/api-reference/create-order-label.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
