πŸ“–Search Order

Search Order

POST https://app.pgprints.io/api/v1/orders/search

Headers

Name
Type
Description

Content-Type*

string

application/json

X-PGPrints-Hmac-Sha256*

string

X-PGPrints-Store-Id*

string

use the Store ID taken from the Manage Keys

Request Body

Name
Type
Description

fromTime

[Required]Number

The millisecond number must not exceed 30 days

toTime

[Required]Number

The millisecond number must not exceed 30 days

searchKey

String

page

Number

{
    "success": true,
    "message": "OK",
    "data": [
        {
            "id": "6663d4b8ed63b87a347b4ffa",
            "pgcOrderId": "PG1677-1212",
            "orderId": "PG1677-1212",
            "billingAddress": {},
            "createdAt": "2024-06-08T03:49:12.905Z",
            "customer": {
                "name": ""
            },
            "handleFee": 2.5,
            "itemStatuses": [
                "request-change"
            ],
            "otherFee": null,
            "otherShippingFee": null,
            "productCost": null,
            "shippingAddress": {},
            "shippingFee": null,
            "source": "app",
            "totalCost": 2.5,
            "storeId": "660d1f4498c616c4daefdedd",
            "type": "label",
            "childDetails": [
                {
                    "name": "Test 21032024",
                    "sku": "TES-One_size",
                    "quantity": 1,
                    "files": [
                        {
                            "id": "xjxIDG0r1Y",
                            "name": "a",
                            "size": "",
                            "note": "",
                            "fileUrl": [
                                "https://firebasestorage.googleapis.com/v0/b/hello-dat-fulfillment.appspot.com/o/media%2F64c776599d1bf92a12f35d85%2Fall%2F1717818728217_cam2.jpg?alt=media&token=7704eb1f-2f18-4511-b753-7a6f7a2c2a90"
                            ],
                            "thumbnailFileUrl": [
                                "https://firebasestorage.googleapis.com/v0/b/hello-dat-fulfillment.appspot.com/o/media%2F64c776599d1bf92a12f35d85%2Fall%2F1717818728217_cam2.jpg?alt=media&token=7704eb1f-2f18-4511-b753-7a6f7a2c2a90"
                            ]
                        }
                    ],
                    "mockupImages": [
                        "https://firebasestorage.googleapis.com/v0/b/hello-dat-fulfillment.appspot.com/o/media%2F64c776599d1bf92a12f35d85%2Fall%2F1717818749861_cam2.jpg?alt=media&token=46853091-c2a4-4592-8dc5-c347925a0ae8"
                    ],
                    "thumbnailMockupImages": [
                        "https://firebasestorage.googleapis.com/v0/b/hello-dat-fulfillment.appspot.com/o/media%2F64c776599d1bf92a12f35d85%2Fall%2F1717818749861_cam2.jpg?alt=media&token=46853091-c2a4-4592-8dc5-c347925a0ae8"
                    ],
                    "status": "request-change",
                    "sellerCost": 0
                }
            ]
        }
    ],
    "pageHasNext": false,
    "pageHasPre": false
}
// example body
{
  "fromTime": 1709611319000,
  "toTime": 1712030519000
}

This is my code 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/search',
  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