πŸ‡ΈπŸ‡¨Create Order

Creating a new order

Create Order

POST https://app.pgprints.io/app/v1/orders/create

Creates a new order

Headers

Request Body

{
    "name"="Wilson",
    "owner": {
        "id": "sha7891bikojbkreuy",
        "name": "Samuel Passet",
    "species": "Dog",}
    "breed": "Golden Retriever",
}
// example body
{
  "order_id": "G-20035",
  "email": "Support@pgprints.io",
  "shipping_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"
  },
  "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",
      "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"
      ]
    }
  ]
}

This is my code in some language:

//example nodejs with axios
var axios = require('axios');
var data = JSON.stringify({"body"});

var config = {
  method: 'post',
  url: 'https://app.pgprints.io/app/v1/orders/create',
  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);
});

Last updated