PrintXpand API
Once you integrate our tool to your e-store, it is important to sync the store data regularly into the tool. And with our API followed by some configuration steps you can easily set it up. Let’s see how:
Note:
– To make sure API calling works without any glitches, you must set this header:
X-Requested-With:XMLHttpRequest
– You will get token via email once you complete the purchase of API from us.
Category
With this API, you can create/update single as well as multiple categories. For that, you will have to run the following API calls. If the category is already created, it will be updated directly.
Single Category
To create single category run the following API call:
Action : Create/Update Categroy
URL :
METHOD : POST
REQUEST :
{ "category":{ "148799651939":{ "id":"148799651939", "name":"Stationary", "parent_id":0, "status":1 } }, "token":"XXXXXXXXXXXXXXXXXXXXXXXXXX" }
RESPONSE
Success:
{ "success":{ "148799651939":"1" } }
Error Types:
Error-1
{ "error":{ "message":"Invalid Data. Please try with proper data" } }
Error-2
{ "error":{ "message":"Invalid token. Please try with proper token" } }
Error-3
{ "error": { "message": "Invalid configuration setting value like a token. Please try with proper confidential details." } }
Error-4
{ "error":{ "message":"Please send proper data like id, name and parent id of Category" } }
Error-5
{ { "error":[ { "id":"148799651939", "message":"URL key for specified store already exists." } ] }
Multiple Categories
To create multiple categories run the following API call:
Action : Create/Update Categroy
URL :
METHOD : POST
REQUEST :
{ "category": { "148799651940":{ "id":"148799651940", "name":"Books", "parent_id":0, "status":1 }, "148799651941":{ "id":"148799651941", "name":"Pen", "parent_id":0, "status":1 } }, "token":"XXXXXXXXXXXXXXXXXXXXXXXXXX" }
RESPONSE
Success:
{ "success": { "148799651940":"2", "148799651941":"3" } }
Error Types:
Error-1
{ "error":{ "message":"Invalid Data. Please try with proper data" } }
Error-2
{ "error":{ "message":"Invalid token. Please try with proper token" } }
Error-3
{ "error": { "message": "Invalid configuration setting value like a token. Please try with proper confidential details." } }
Error-4
{ "error":{ "message":"Please send proper data like id, name and parent id of Category" } }
Error-5
{ { "error":[ { "id":"148799651939", "message":"URL key for specified store already exists." } ] }
Customer
With this API, you can create/update single as well as multiple customers. For that, you will have to run the following API calls. If the customer is already created, it will be updated directly.
Single Customer
To create single customer run the following API call:
Action : Create/Update Customer
URL :
METHOD : POST
REQUEST :
{ "customer": { "2591499354201":{ "id":2591499354201, "first_name":"Peter", "last_name":"Marino", "email":"peter.marino@gmail.com" } }, "token":"XXXXXXXXXXXXXXXXXXXXXXXXXX" }
RESPONSE
Success:
{ "success": { "2591499354201":"1" } }
Error Types:
Error-1
{ "error":{ "message":"Invalid Data. Please try with proper data" } }
Error-2
{ "error":{ "message":"Invalid token. Please try with proper token" } }
Error-3
{ "error": { "message": "Invalid configuration setting value like a token. Please try with proper confidential details." } }
Error-4
{ "error":{ "message":"Please pass the id of customer." } }
Multiple Customers
To create multiple customers run the following API call:
Action : Create/Update Customer
URL :
METHOD : POST
REQUEST :
{ "customer": { "2591499354201":{ "id":2591499354201, "first_name":"Peter", "last_name":"Marino", "email":"peter.marino@gmail.com" }, "2591499354202": { "id":2591499354202, "first_name":"Dale", "last_name":"Nguyen", "email":"dale@dalenguyen.me" } }, "token":"XXXXXXXXXXXXXXXXXXXXXXXXXX" }
RESPONSE
Success:
{ "success":{ "2591499354201":"1", "2591499354202":"2" } }
Error Types:
Error-1
{ "error":{ "message":"Invalid Data. Please try with proper data" } }
Error-2
{ "error":{ "message":"Invalid token. Please try with proper token" } }
Error-3
{ "error": { "message": "Invalid configuration setting value like a token. Please try with proper confidential details." } }
Error-4
{ "error":{ "message":"Please pass the id of customer." } }
Product
With this API, you can create/update Simple as well as Configurable products. For that, you will have to run the following API calls. If the product is already created, it will be updated directly.
Note: Images will only sync at the time of product creation in the Magento side. You will have to set updated images manually.
Simple Product
To create simple product run the following API call:
Action : Create/Update Single Product
URL :
METHOD : POST
REQUEST :
{ "product": { "1000001": { "id": 1000001, "name": "Book", "price": "99.99", "special_price": "", "category_id": "148799651939", "status": 1, "enable_product_designer": 1, "type": "simple", "images": [ { "src": "https://miro.medium.com/max/2000/1*-T8oo_JoKkMxfnPKLt_Ciw.jpeg" }, { "src": "https://dailymedia.case.edu/wp-content/uploads/2017/11/22132433/book-glasses.jpg" } ] } }, "token": "XXXXXXXXXXXXXXXXXXXXXXXXXX" }
RESPONSE
Success:
{ "success": { "1000001": "66" } }
Error Types:
Error-1
{ "error": { "message": "Invalid Data. Please try with proper data" } }
Error-2
{ "error": { "message": "Invalid token. Please try with proper token" } }
Error-3
{ "error": { "message": "Invalid configuration setting value like a token. Please try with proper confidential details." } }
Error-4
{ "error": { "message": "Please pass product Required data like id, name, and type must be simple or configurable" } }
Error-5
{ "error": { "message": "Please pass vaild price." } }
Error-6
{ "error": { "message": "Please pass vaild special_price." } }
Error-7
{ "error": { "12586454": "Number of 2 Child product is not created due to required data" } }
Configurable Product
To create configurable product run the following API call:
Action : Create/Update Product
URL :
METHOD : POST
REQUEST :
{ "product": { "1000003": { "id": 1000003, "name": "Tshirt", "price": "299.00", "special_price": "", "category_id": "148799651939", "enable_product_designer": "1", "images": [ { "src": "https://cdn.shopify.com/s/files/1/0254/7518/6787/products/v11.jpg?v=1569475691" } ], "attribute_names": "Size,Color", "type": "configurable", "variations": { "1000004": { "id": 1000004, "price": "299.00", "special_price": "", "category_id": "148799651939", "attributes": [ { "name": "Size", "option": "M" }, { "name": "Color", "option": "RED" } ], "images": [ { "src": "https://cdn.shopify.com/s/files/1/0254/7518/6787/products/v14_8a104c8a-3d0f-475b-984d-e335059ede5c.jpg?v=1569475691" } ] }, "1000005": { "id": 1000005, "price": "299.00", "special_price": "", "category_id": "148799651939", "attributes": [ { "name": "Size", "option": "M" }, { "name": "Color", "option": "BLUE" } ], "images": [ { "src": "https://cdn.shopify.com/s/files/1/0254/7518/6787/products/v13_6777faae-01fe-4431-8639-2a1265cce506.jpg?v=1569475691" } ] } } } }, "token": "XXXXXXXXXXXXXXXXXXXXXXXXXX" }
RESPONSE
Success:
{ "success": { "1000003": "9", "1000004": "11", "1000005": "42" } }
Error Types:
Error-1
{ "error": { "message": "Invalid Data. Please try with proper data" } }
Error-2
{ "error": { "message": "Invalid token. Please try with proper token" } }
Error-3
{ "error": { "message": "Invalid configuration setting value like a token. Please try with proper confidential details." } }
Error-4
{ "error": { "message": "Please pass product Required data like id, name, and type must be simple or configurable" } }
Error-5
{ "error": { "message": "Please pass vaild price." } }
Error-6
{ "error": { "message": "Please pass vaild special_price." } }
Error-7
{ "error": { "12586454": "Number of 2 Child product is not created due to required data" } }
Orders
The below API call is used for creating orders.
Action : Orders
URL :
METHOD : POST
REQUEST :
{ "order": { "15000000010": { "order_id": 15000000010, "design_id": [ "1524", "1525", "1526" ], "item_price": [ "22.00", "22.00", "22.00" ], "item_qty": [ 2, 3 ], "shipping_address": { "first_name": "Jane", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": 45.4203521, "longitude": -75.69314750000001, "name": "Jane Smith", "country_code": "CA", "province_code": "ON" }, "sub_total": "220.00" } }, "token": "XXXXXXXXXXXXXXXXXXXXXXXXXX" }
RESPONSE
Success:
{ "success": { "15000000010": "66" } }
Error Types:
Error-1
{ "error": { "message": "Invalid Data. Please try with proper data" } }
Error-2
{ "error": { "message": "Invalid token. Please try with proper token" } }
Error-3
{ "error": { "message": "Invalid configuration setting value like a token. Please try with proper confidential details." } }
Error-4
{ "error": { "message": "Order design id, item price, and item qty is not equaled." } }
Error-5
{ "error": { "message": "Please pass valid shipping address." } }
Error-6
{ "error": { "message": "Please pass qty or price according to design id." } }