PGPrints API Documentation
  • 😎Welcome to PGPrints API
  • πŸ”Authentication
  • Reference
    • βš™οΈAPI Reference
      • πŸ‡ΈπŸ‡¨Create Order
      • πŸ‡ΈπŸ‡¨Create Order Label
      • 🧁Update Order
      • 🧁Update Order Label
      • 🧁Cancel Order
      • πŸ“–Search Order
      • πŸ“–Search Product Tiktok
      • πŸ“–Search Product Normal
Powered by GitBook
On this page
  • Update Order Label
  1. Reference
  2. API Reference

Update Order Label

Update Order Label

POST https://app.pgprints.io/app/v1/orders/update-label

Update an order

Headers

Name
Type
Description

Content-Type*

string

application/json

X-PGPrints-Store-Id*

string

use the Store ID taken from the Manage Keys

X-PGPrints-Hmac-Sha256*

string

Request Body

Name
Type
Description

order_id*

string

unique identifier for an order

shipping_address_label*

string

billing_address

object

customer*

object

line_items*

array

response_type

string

normal

// example body
{
  "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": [
    {
      "appItemId": "64c9d80f8a515da1de2f8870",
      "name": "tem1",
      "quantity": 2,
      "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
const axios = require('axios');
let data = JSON.stringify({"body"});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://app.pgprints.io/app/v1/orders/update-label',
  headers: { 
    'Content-Type': 'application/json', 
    'X-PGPrints-Store-Id': '64c9d58aa6cead5392e73711', 
    'X-PGPrints-Hmac-Sha256': 'zz1/IH/V/Q+/00ImpP2CosYQb43qJn1nOwJd5/czDns='
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
//example php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://app.pgprints.io/app/v1/orders/update-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": [
    {
      "appItemId": "64c9d80f8a515da1de2f8870",
      "name": "tem1",
      "quantity": 2,
      "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: 64c9d58aa6cead5392e73711',
    'X-PGPrints-Hmac-Sha256: zz1/IH/V/Q+/00ImpP2CosYQb43qJn1nOwJd5/czDns='
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
//example curl
curl --location 'https://app.pgprints.io/app/v1/orders/update-label' \
--header 'Content-Type: application/json' \
--header 'X-PGPrints-Store-Id: 64c9d58aa6cead5392e73711' \
--header 'X-PGPrints-Hmac-Sha256: zz1/IH/V/Q+/00ImpP2CosYQb43qJn1nOwJd5/czDns=' \
--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": [
    {
      "appItemId": "64c9d80f8a515da1de2f8870",
      "name": "tem1",
      "quantity": 2,
      "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"
      ]
    }
  ]
}'
//example 
Method: 'POST',
Url: 'https://app.pgprints.io/app/v1/orders/update-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": "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": [
    {
      "appItemId": "64c9d80f8a515da1de2f8870",
      "name": "tem1",
      "quantity": 2,
      "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"
      ]
    }
  ]
}
PreviousUpdate OrderNextCancel Order

Last updated 11 months ago

see the authentication:

βš™οΈ
🧁
https://pgprints.gitbook.io/api/authentication