NAV -image
php python bash javascript

Introduction

The Printrove API allows you to perform all the operations that you do with our web client.

Printrove API is built using REST principles which ensures predictable URLs that makes writing applications easy.

This API follows HTTP rules, enabling a wide range of HTTP clients can be used to interact with the API.
Every resource is exposed as a URL. The URL of each resource can be obtained by accessing the API Root Endpoint.

The base url is https://api.printrove.com

Authenticating requests

Authenticate requests to this API's endpoints by sending an Authorization header with the value "Bearer {your-token}".

You can use the Authentication API to generate the token for the API calls.

Authentication API

Generate Token

Generate the auth token

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.printrove.com/api/external/token',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => 'example@example.com',
            'password' => 'password',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.printrove.com/api/external/token'
payload = {
    "email": "example@example.com",
    "password": "password"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
curl -X POST \
    "https://api.printrove.com/api/external/token" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"email":"example@example.com","password":"password"}'
const url = new URL(
    "https://api.printrove.com/api/external/token"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "example@example.com",
    "password": "password"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):


{"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIzIiwianRpIjoiMGU4ZGZjMWU4ZTA4MTM1MmNiNDE2YjkwOWIzOTZiNDlkODgxMWM2N2IyYTI3NWM3MDQxYWUwNTU5MWYwYTdhMjE2NzYwNmJlMjA0YzY1NjQiLCJpYXQiOjE2MTIzNDYwNzQsIm5iZiI6MTYxMjM0NjA3NCwiZXhwIjoxNjQzODgyMDc0LCJzdWIiOiI3Iiwic2NvcGVzIjpbXX0.efUPLWGz-WMwuQtAYowuV5a7YQHQD7DA_VagQqroEBpW_Bg6BAOxWb6Fd18M6xK-EmpE8UyTeTCeyePH5zl0y3Nd4d4ndaS6VYUHTw2JcOxYHJ2NdnmDeCM0xX2poZzgHE4AySDaolCoQAPRJ1BDzp-9QuCXjdadEvYXqhYINExg5N7we3v3HLCyGmhsE0-4nwn5IMvP4bZNysXda-B7Tt_GahzCkUSRMsMpmd5EFtEkzDXhSAUgY13sb0u4wrxk4SzgcH2thC9gUnBTXuA74G52iLVatd0rf28mwXpup5I_zszhZ2zI7KdVemycJb9U-jnN3i1ylSNO5wTn5SADy0mycJjKbq8Zq6-NR0IryIo5o-z2F1fXbAlD2gWcyotFmtZ3qwKvOaOvjVfTKTm87FRUHruJ1lnbXn63Xz9nc1S3dytRM7ts_k0ui4Bhg5XaqETxfMXfIZDssqqralpyQN-_xQ77qE6DLhDUETObitZIxwbeoAindDgXH--Eo99rUgEqjIIjWrn1QuLIFBo2yn5ysrvqnXVIjnouVqVmqsKFZKnIIy8s-4g_gbz8K-V6K4t9UXB18nxlKuKkW8Ra8F5CLlq6bQ-So32Fc-ohMPEwT7St1NK9r515X1Q6RZQD3VSCKMA8HizBypdAth16V5sf2qdR_ugo8Gfw5H0","expires_at": "2022-02-03T09:54:34.000000}

Request

POST api/external/token

Body Parameters

email  email
The email id of the merchant.

password  password
The password of the merchant.

Catalog API

APIs related to the products and categories available on Printrove

List All Categories

requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.printrove.com/api/external/categories',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.printrove.com/api/external/categories'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
curl -X GET \
    -G "https://api.printrove.com/api/external/categories" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.printrove.com/api/external/categories"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Request

GET api/external/categories

Get Parent Products

requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.printrove.com/api/external/categories/7',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.printrove.com/api/external/categories/7'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
curl -X GET \
    -G "https://api.printrove.com/api/external/categories/7" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.printrove.com/api/external/categories/7"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Request

GET api/external/categories/{category_id}

URL Parameters

category_id  string

Get Product Variants

requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.printrove.com/api/external/categories/25/products/460',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.printrove.com/api/external/categories/25/products/460'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
curl -X GET \
    -G "https://api.printrove.com/api/external/categories/25/products/460" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.printrove.com/api/external/categories/25/products/460"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Request

GET api/external/categories/{category_id}/products/{product_id}

URL Parameters

category_id  string

product_id  string

Design Library API

APIs related to the design library

List All Designs

requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.printrove.com/api/external/designs',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'per_page'=> '14',
            'page'=> '9',
            'name'=> 'Kitties',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.printrove.com/api/external/designs'
params = {
  'per_page': '14',
  'page': '9',
  'name': 'Kitties',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
curl -X GET \
    -G "https://api.printrove.com/api/external/designs?per_page=14&page=9&name=Kitties" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.printrove.com/api/external/designs"
);

let params = {
    "per_page": "14",
    "page": "9",
    "name": "Kitties",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Request

GET api/external/designs

Query Parameters

per_page  string optional
Number of fields per page. Cannot be more than 20. Default 10

page  string optional
The page number

name  string optional
Name of the design to be filtered

Add Design

requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.printrove.com/api/external/designs',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'file' => 'quia',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.printrove.com/api/external/designs'
payload = {
    "file": "quia"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
curl -X POST \
    "https://api.printrove.com/api/external/designs" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"file":"quia"}'
const url = new URL(
    "https://api.printrove.com/api/external/designs"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "file": "quia"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Request

POST api/external/designs

Body Parameters

file  image
The image file to be uploaded. Maximum size of 15MB. Allowed formats are jpg, jpeg and png

Add Design using URL

requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.printrove.com/api/external/designs/url',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'url' => 'https://printrove.s3.ap-south-1.amazonaws.com/designs/Kitties.png',
            'name' => 'Kitties',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.printrove.com/api/external/designs/url'
payload = {
    "url": "https:\/\/printrove.s3.ap-south-1.amazonaws.com\/designs\/Kitties.png",
    "name": "Kitties"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
curl -X POST \
    "https://api.printrove.com/api/external/designs/url" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"url":"https:\/\/printrove.s3.ap-south-1.amazonaws.com\/designs\/Kitties.png","name":"Kitties"}'
const url = new URL(
    "https://api.printrove.com/api/external/designs/url"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "url": "https:\/\/printrove.s3.ap-south-1.amazonaws.com\/designs\/Kitties.png",
    "name": "Kitties"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Request

POST api/external/designs/url

Body Parameters

url  string
The URL of the design. Maximum size of 15MB. Allowed formats are jpg, jpeg and png

name  string
The name of the design

Delete Design

requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://api.printrove.com/api/external/designs/100',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.printrove.com/api/external/designs/100'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()
curl -X DELETE \
    "https://api.printrove.com/api/external/designs/100" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.printrove.com/api/external/designs/100"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Request

DELETE api/external/designs/{design_id}

URL Parameters

design_id  string
The id of the design to be deleted

Orders API

APIs related to the orders

Get Pincode Details

requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.printrove.com/api/external/pincode/600079',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.printrove.com/api/external/pincode/600079'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
curl -X GET \
    -G "https://api.printrove.com/api/external/pincode/600079" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.printrove.com/api/external/pincode/600079"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Request

GET api/external/pincode/{pincode}

URL Parameters

pincode  string
The pincode for which the details have to be fetched.

Serviceability

requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.printrove.com/api/external/serviceability',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'country'=> 'India',
            'pincode'=> '600079',
            'weight'=> '500',
            'cod'=> 'true',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.printrove.com/api/external/serviceability'
params = {
  'country': 'India',
  'pincode': '600079',
  'weight': '500',
  'cod': 'true',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
curl -X GET \
    -G "https://api.printrove.com/api/external/serviceability?country=India&pincode=600079&weight=500&cod=true" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.printrove.com/api/external/serviceability"
);

let params = {
    "country": "India",
    "pincode": "600079",
    "weight": "500",
    "cod": "true",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Request

GET api/external/serviceability

Query Parameters

country  string
The country of the destination.

pincode  string
The pincode of the destination.

weight  string
The total weight of the order in gms

cod  string
If set, the order is a COD order.

List All Orders

requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.printrove.com/api/external/orders',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page'=> '1',
            'per_page'=> '10',
            'tracking_number'=> '5465987231',
            'reference_number'=> 'REF1001',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.printrove.com/api/external/orders'
params = {
  'page': '1',
  'per_page': '10',
  'tracking_number': '5465987231',
  'reference_number': 'REF1001',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
curl -X GET \
    -G "https://api.printrove.com/api/external/orders?page=1&per_page=10&tracking_number=5465987231&reference_number=REF1001" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.printrove.com/api/external/orders"
);

let params = {
    "page": "1",
    "per_page": "10",
    "tracking_number": "5465987231",
    "reference_number": "REF1001",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Request

GET api/external/orders

Query Parameters

page  string
The page number. Default is 1

per_page  string
The number of records per page. Cannot be more than 20. Default is 10

tracking_number  string optional
Search using tracking number

reference_number  string optional
Search using reference number

Get Order

requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.printrove.com/api/external/orders/15100',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.printrove.com/api/external/orders/15100'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
curl -X GET \
    -G "https://api.printrove.com/api/external/orders/15100" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.printrove.com/api/external/orders/15100"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Request

GET api/external/orders/{order_id}

URL Parameters

order_id  string optional
The ID of the order

Create Order

requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.printrove.com/api/external/orders',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'reference_number' => 'OD1001',
            'retail_price' => 500.0,
            'customer' => [
                'name' => 'John Doe',
                'email' => 'johndoe@example.com',
                'number' => 9844654321,
                'address1' => '123 Lane, Area',
                'address2' => 'Address Line 2',
                'address3' => 'Landmark here',
                'pincode' => 600001,
                'state' => 'Tamil Nade',
                'city' => 'Chennai',
                'country' => 'India',
            ],
            'order_products' => [
                [
                    'product_id' => 462,
                    'design' => [
                        'front' => [
                            'id' => 7,
                            'dimensions' => [
                                'width' => 3000,
                                'height' => 3000,
                                'top' => 10,
                                'left' => 50,
                            ],
                        ],
                        'back' => [
                            'id' => 6,
                            'dimensions' => [
                                'width' => 3000,
                                'height' => 3000,
                                'top' => 10,
                                'left' => 50,
                            ],
                        ],
                    ],
                    'quantity' => 2,
                    'variant_id' => 460021,
                    'is_plain' => false,
                ],
            ],
            'courier_id' => 7,
            'cod' => true,
            'invoice_url' => 'https://printrove.s3.ap-south-1.amazonaws.com/invoice/od1001.pdf',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.printrove.com/api/external/orders'
payload = {
    "reference_number": "OD1001",
    "retail_price": 500,
    "customer": {
        "name": "John Doe",
        "email": "johndoe@example.com",
        "number": 9844654321,
        "address1": "123 Lane, Area",
        "address2": "Address Line 2",
        "address3": "Landmark here",
        "pincode": 600001,
        "state": "Tamil Nade",
        "city": "Chennai",
        "country": "India"
    },
    "order_products": [
        {
            "product_id": 462,
            "design": {
                "front": {
                    "id": 7,
                    "dimensions": {
                        "width": 3000,
                        "height": 3000,
                        "top": 10,
                        "left": 50
                    }
                },
                "back": {
                    "id": 6,
                    "dimensions": {
                        "width": 3000,
                        "height": 3000,
                        "top": 10,
                        "left": 50
                    }
                }
            },
            "quantity": 2,
            "variant_id": 460021,
            "is_plain": false
        }
    ],
    "courier_id": 7,
    "cod": true,
    "invoice_url": "https:\/\/printrove.s3.ap-south-1.amazonaws.com\/invoice\/od1001.pdf"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
curl -X POST \
    "https://api.printrove.com/api/external/orders" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"reference_number":"OD1001","retail_price":500,"customer":{"name":"John Doe","email":"johndoe@example.com","number":9844654321,"address1":"123 Lane, Area","address2":"Address Line 2","address3":"Landmark here","pincode":600001,"state":"Tamil Nade","city":"Chennai","country":"India"},"order_products":[{"product_id":462,"design":{"front":{"id":7,"dimensions":{"width":3000,"height":3000,"top":10,"left":50}},"back":{"id":6,"dimensions":{"width":3000,"height":3000,"top":10,"left":50}}},"quantity":2,"variant_id":460021,"is_plain":false}],"courier_id":7,"cod":true,"invoice_url":"https:\/\/printrove.s3.ap-south-1.amazonaws.com\/invoice\/od1001.pdf"}'
const url = new URL(
    "https://api.printrove.com/api/external/orders"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reference_number": "OD1001",
    "retail_price": 500,
    "customer": {
        "name": "John Doe",
        "email": "johndoe@example.com",
        "number": 9844654321,
        "address1": "123 Lane, Area",
        "address2": "Address Line 2",
        "address3": "Landmark here",
        "pincode": 600001,
        "state": "Tamil Nade",
        "city": "Chennai",
        "country": "India"
    },
    "order_products": [
        {
            "product_id": 462,
            "design": {
                "front": {
                    "id": 7,
                    "dimensions": {
                        "width": 3000,
                        "height": 3000,
                        "top": 10,
                        "left": 50
                    }
                },
                "back": {
                    "id": 6,
                    "dimensions": {
                        "width": 3000,
                        "height": 3000,
                        "top": 10,
                        "left": 50
                    }
                }
            },
            "quantity": 2,
            "variant_id": 460021,
            "is_plain": false
        }
    ],
    "courier_id": 7,
    "cod": true,
    "invoice_url": "https:\/\/printrove.s3.ap-south-1.amazonaws.com\/invoice\/od1001.pdf"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Request

POST api/external/orders

Body Parameters

reference_number  string
A unique reference number should be provided for every order.

retail_price  number
The total retail price of the order. Should be greater than 0.

customer  object
The customer object

customer.name  string
Length should be between 3-50 characters

customer.email  email optional

customer.number  integer
10 digits for Indian phone numbers

customer.address1  string
Length should be between 3-50 characters

customer.address2  string
Length should be between 3-50 characters

customer.address3  string optional
Length should be between 3-50 characters

customer.pincode  integer optional
6 digits for India, string for International

customer.state  string optional
Compulsory for international orders. Can be fetched from pincode for Indian address

customer.city  string optional
Compulsory for international orders. Can be fetched from pincode for Indian address

customer.country  string
The full country name or the 2 digit alpha code

order_products  array
The array of order products in the order

order_products.*.product_id  integer optional
The Printrove product ID received from the Catalog API. This is not required if variant ID is provided

order_products.*.design  object
This is not required if variant ID is provided

order_products.*.design.front  object optional
Front Design

order_products.*.design.front.id  integer optional
Front Design ID required

order_products.*.design.front.dimensions  object
Front Design Dimensions

order_products.*.design.front.dimensions.width  integer
Front design width

order_products.*.design.front.dimensions.height  integer
Front design height

order_products.*.design.front.dimensions.top  integer
Front design top

order_products.*.design.front.dimensions.left  integer
Front design left

order_products.*.design.back  object optional
Back Design

order_products.*.design.back.id  integer optional
Back Design ID required

order_products.*.design.back.dimensions  object
Back Design Dimensions

order_products.*.design.back.dimensions.width  integer
Back design width

order_products.*.design.back.dimensions.height  integer
Back design height

order_products.*.design.back.dimensions.top  integer
Back design top

order_products.*.design.back.dimensions.left  integer
Back design left

order_products.*.quantity  integer
The quantity of the order product

order_products.*.variant_id  integer optional
The variant ID of your product from the Product Library.

order_products.*.is_plain  boolean optional
Set this to true for plain garments

courier_id  integer optional
A valid serviceable Printrove courier ID. If not provided, the courier will be automatically selected based on your settings.

cod  boolean
Set this to true for COD orders

invoice_url  string optional
The URL of the invoice. Should be A4. Allowed format is pdf

Product Library API

APIs related to the product library

List All Products

requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.printrove.com/api/external/products',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page'=> '1',
            'per_page'=> '10',
            'name'=> 'Kitties',
            'sku'=> 'Kitties-Black-XL',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.printrove.com/api/external/products'
params = {
  'page': '1',
  'per_page': '10',
  'name': 'Kitties',
  'sku': 'Kitties-Black-XL',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
curl -X GET \
    -G "https://api.printrove.com/api/external/products?page=1&per_page=10&name=Kitties&sku=Kitties-Black-XL" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.printrove.com/api/external/products"
);

let params = {
    "page": "1",
    "per_page": "10",
    "name": "Kitties",
    "sku": "Kitties-Black-XL",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Request

GET api/external/products

Query Parameters

page  string
The page number. Default is 1

per_page  string
The number of records per page. Cannot be more than 20. Default is 10

name  string optional
Name of the product to be filtered

sku  string optional
Product containing this particular SKU

Get Product

requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.printrove.com/api/external/products/47',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.printrove.com/api/external/products/47'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
curl -X GET \
    -G "https://api.printrove.com/api/external/products/47" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.printrove.com/api/external/products/47"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Request

GET api/external/products/{product_id}

URL Parameters

product_id  string
The id of the sku

Create A Product

Add a new SKU to the Product Library

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.printrove.com/api/external/products',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Product Number 1',
            'product_id' => 1,
            'design' => [
                'front' => [
                    'id' => 13,
                    'dimensions' => [
                        'width' => 3000,
                        'height' => 3000,
                        'top' => 10,
                        'left' => 50,
                    ],
                ],
                'back' => [
                    'id' => 19,
                    'dimensions' => [
                        'width' => 3000,
                        'height' => 3000,
                        'top' => 10,
                        'left' => 50,
                    ],
                ],
            ],
            'variants' => [
                [
                    'product_id' => 10,
                    'sku' => 'Product 1-Black XL',
                ],
                [],
            ],
            'is_plain' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.printrove.com/api/external/products'
payload = {
    "name": "Product Number 1",
    "product_id": 1,
    "design": {
        "front": {
            "id": 13,
            "dimensions": {
                "width": 3000,
                "height": 3000,
                "top": 10,
                "left": 50
            }
        },
        "back": {
            "id": 19,
            "dimensions": {
                "width": 3000,
                "height": 3000,
                "top": 10,
                "left": 50
            }
        }
    },
    "variants": [
        {
            "product_id": 10,
            "sku": "Product 1-Black XL"
        },
        []
    ],
    "is_plain": true
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
curl -X POST \
    "https://api.printrove.com/api/external/products" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"Product Number 1","product_id":1,"design":{"front":{"id":13,"dimensions":{"width":3000,"height":3000,"top":10,"left":50}},"back":{"id":19,"dimensions":{"width":3000,"height":3000,"top":10,"left":50}}},"variants":[{"product_id":10,"sku":"Product 1-Black XL"},[]],"is_plain":true}'
const url = new URL(
    "https://api.printrove.com/api/external/products"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Product Number 1",
    "product_id": 1,
    "design": {
        "front": {
            "id": 13,
            "dimensions": {
                "width": 3000,
                "height": 3000,
                "top": 10,
                "left": 50
            }
        },
        "back": {
            "id": 19,
            "dimensions": {
                "width": 3000,
                "height": 3000,
                "top": 10,
                "left": 50
            }
        }
    },
    "variants": [
        {
            "product_id": 10,
            "sku": "Product 1-Black XL"
        },
        []
    ],
    "is_plain": true
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Request

POST api/external/products

Body Parameters

name  string
The product title

product_id  integer
Parent Product ID

design  object optional
Design object

design.front  Front optional
Design object

design.front.id  integer optional
Front Design ID

design.front.dimensions  object
Front Design Dimensions

design.front.dimensions.width  integer
Front design width

design.front.dimensions.height  integer
Front design height

design.front.dimensions.top  integer
Front design top

design.front.dimensions.left  integer
Front design left

design.back  Back optional
Design object

design.back.id  integer optional
Back Design ID required

design.back.dimensions  object
Back Design Dimensions

design.back.dimensions.width  integer
Back design width

design.back.dimensions.height  integer
Back design height

design.back.dimensions.top  integer
Back design top

design.back.dimensions.left  integer
Back design left

variants  object[]
An array of the variants in this product

variants[].product_id  integer
Child product ID

variants[].sku  string optional
SKU of the variant

is_plain  boolean optional
Send this as true if no design is to be printed. Only for garments. required