πΈπ¨Create Order
Last updated
Last updated
POST
https://app.pgprints.io/app/v1/orders/create
Creates a new order
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
{
"success": true,
"message": "Successful",
"data": {
"id": "6666ac9cfcbb72b5a242eb5e",
"pgcOrderId": "PG1677-1216",
"orderId": "G-20035122211222312",
"billingAddress": {
"company": "MP",
"city": "Ha Noi",
"phone": "098454654",
"fullName": "PGCom Group",
"address1": "102 Tran Phu",
"address2": "HΔ",
"province": "",
"firstName": "PGCom",
"lastName": "Group",
"country": "VN",
"postcode": "151100"
},
"createdAt": "2024-06-10T07:34:52.648Z",
"customer": {
"name": "Printway Fulfillment"
},
"handleFee": null,
"itemStatuses": null,
"otherFee": null,
"otherShippingFee": null,
"productCost": null,
"shippingAddress": {
"email": "demo@pgprints.io",
"company": "",
"city": "Adamstown",
"phone": "",
"fullName": "hihi hello",
"address1": "6 Parakeet Outlook",
"address2": null,
"province": "MD",
"firstName": "hihi",
"lastName": "hello",
"country": "US",
"postcode": "123123"
},
"shippingFee": 7,
"source": "store",
"totalCost": 7,
"storeId": "660d1f4498c616c4daefdedd",
"type": "manual",
"shipping_address_label": null,
"childDetails": [
{
"name": "Kimono",
"sku": "KMN-S",
"quantity": 3,
"files": [
{
"id": "D0LR3iU34S",
"name": "Main",
"size": "",
"note": "JPEG, 300 DPI, CMYK, <100MB",
"sizeWidth": "12376",
"sizeHeight": "11062",
"requireFor": [],
"fileUrl": [
"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"
],
"thumbnailMockupImages": null,
"status": null,
"sellerCost": null
}
]
}
}
// example body
{
"order_id": "G-20035",
"email": "Support@pgprints.io",
"shipping_address": {
"email": "demo@pgprints.io",
"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);
});
//example php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://app.pgprints.io/app/v1/orders/create',
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": {
"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"
]
}
]
}',
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;
//example curl
curl --location --request POST 'https://app.pgprints.io/app/v1/orders/create' \
--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": {
"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"
]
}
]
}
//example
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'
},
Body raw: {
"order_id": "G-20035",
"email": "Support@pgprints.io",
"shipping_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"
},
"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",
"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"
]
}
]
}
Content-Type*
string
application/json
X-PGPrints-Hmac-Sha256*
string
see the authentication: https://pgprints.gitbook.io/api/authentication
X-PGPrints-Store-Id*
string
use the Store ID taken from the Manage Keys
order_id*
string
unique identifier for an order
billing_address
object
shipping_address*
object
customer*
object
line_items*
array
response_type
string
normal
production_note
string