PrintXpand Custom API
We are following Magneto 2 OAuth-based Authentication to communicate with our API. Please visit this link that helps to make the authentication (refer to Magento2-API-OAuth-based_authentication.php).
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 a single customer run the following API call:
ACTION : Create/Update Single Customer
REQUEST TYPE : POST
END POINTS : <HOST>/rest/V1/customer/create/
Request Data (json) :
{ "customer": { "123456": { "id": "123456", "first_name": "jessica", "last_name": "vincent", "email": "jessica.v@gmail.com" } } }
RESPONSE
Success:
[ { "response": [ { "id": "123456", "code": "200", "status": "success", "message": "Customer created successfully!" } ] } ]
Required Request (Data Fields) :
Field Name | Required Value | Data Type |
---|---|---|
id | Yes | String |
first_name | No | String |
last_name | No | String |
No | String |
Note: The ‘first name’ and ‘last name’ will only be updated.
Error Validation Example
REQUEST
{ "customer": { "123456": { "id": "1234001", "first_name": "Missy", "last_name": "Colone", "email": "mscolne08@gmail.com" }, "1213456": { "id": "1234516", "first_name": "George", "last_name": "Kisty", "email": "george.kisty78@gmail.com" } } }
RESPONSE
[ { "response": [ { "id": "1234001", "code": 200, "status": "success", "message": "Customer Updated successfully!" }, { "id": "1234516", "code": 400, "status": "error", "message": "A customer with the same email address already exists in an associated website." } ] } ]
Multiple Customers
To create multiple customers run the following API call:
ACTION : Create/update Multiple Custmers
REQUEST TYPE : POST
END POINTS : <HOST>/rest/V1/customer/create/
REQUEST DATA (json) :
{ "customer": { "1001": { "id": "1001", "first_name": "Jessica", "last_name": "vincent", "email": "jessica.v@gmail.com" }, "1002": { "id": "1002", "first_name": "Streak", "last_name": "Styris", "email": "streakstyris@10@gmail.com" } } }
RESPONSE
Success:
[ { "response": [ { "id": "1001", "code": "200", "status": "success", "message": "Customer Created successfully!" }, { "id": "1002", "code": "200", "status": "success", "message": "Customer Updated successfully!" } ] } ]
Required Request (Data Fields) :
Field Name | Required Value | Data Type |
---|---|---|
id | Yes | String |
first_name | No | String |
last_name | No | String |
No | String |
Note: The ‘first name’ and ‘last name’ will only be updated.
Error Validation Example
REQUEST
{ "customer": { "123456": { "id": "123456", "first_name": "Veronica", "last_name": "Saddik", "email": "veronica.seddik32@gmail.com" }, "1213456": { "id": "", "first_name": "Niky", "last_name": "Cooper", "email": "nk.cooper@gmail.com" } } }
RESPONSE
[ { "response": [ { "id": "123456", "code": 200, "status": "success", "message": "Customer Updated successfully!" }, { "code": 404, "status": "error", "message": "Please pass valid customer Id!" } ] } ]
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.
Create/Update: Single Category
Single Category
To create a Single Category run the following API call:
ACTION: Create/Update Single Categroy
REQUEST TYPE: POST
END POINTS : <HOST>/rest/V1/category/create/
REQUEST DATA(json) :
{ "category": { "101": { "id": "101", "name": "Stationary", "parent_id": 0, "status": 1 } } }
RESPONSE :
Success:
[ { "response": [ { "id": 101, "code": "200", "status": "success", "message": "Category created successfully!" } ] } ]
Requirement Description : sync category first either product is not assigned in the category.
Required Request (Data Fields) :
Field Name | Required Value | Data Type |
---|---|---|
id | Yes | String |
name | Yes | String |
parent_id | No | String |
status | No | int(0,1) |
Error Validation Example
REQUEST
{ "category": { "1001": { "id": 1001, "name": "Book", "parent_id": "", "status": 1 }, "1002": { "id": 0, "name": "Electronics", "parent_id": "1215", "status": 1 } } }
RESPONSE
[ { "response": [ { "id": 1001, "code": 200, "status": "success", "message": "Category Updated successfully!" }, { "code": 404, "status": "error", "message": "Please send proper data like id, name and parent id of Category!" } ] } ]
Create/Update: Multiple Categories
Multiple Categories
To create Multiple Categories run the following API call:
ACTION: Create/Update Multiple Categroies
REQUEST TYPE: POST
END POINTS : <HOST>/rest/V1/category/create/
REQUEST DATA(json) :
{ "category": { "101": { "id": "101", "name": "Stationary", "parent_id": 0, "status": 1 }, "102": { "id": "102", "name": "Apparel", "parent_id": 0, "status": 1 }, "103": { "id": "103", "name": "Mens", "parent_id": "102", "status": 1 } } }
RESPONSE
Success:
[ { "response": [ { "id": 101, "code": "200", "status": "success", "message": "Category created successfully!!" }, { "id": 102, "code": "200", "status": "success", "message": "Category updated successfully!!" }, { "id": 103, "code": "200", "status": "success", "message": "Category created successfully!!" } ] } ]
Required Request (Data Fields) :
Field Name | Required Value | Data Type |
---|---|---|
id | Yes | String |
name | Yes | String |
parent_id | No | String |
status | No | int(0,1) |
Delete: Single Category
Delete: Single Category
To Delete a Single Category run the following API call:
ACTION: Delete Single Categroy
REQUEST TYPE: POST
END POINTS : <HOST>/rest/V1/category/delete/
REQUEST DATA(json) :
{ "category": [ "101" ] }
RESPONSE :
Success:
[ { "response": [ { "id": "101", "code": "200", "status": "success", "message": "Category Deleted Successfully!" } ] } ]
Required Request (Data Fields) :
Field Name | Required Value | Data Type |
---|---|---|
id | Yes | String |
Error Validation Example
REQUEST
{ "category": [ 10001, 4545454 ] }
RESPONSE
[ { "response": [ { "id": 10001, "code": 200, "status": "success", "message": "Category Deleted successfully!" }, { "id": 4545454, "code": 404, "status": "error", "message": "Category Id is not Found!" } ] } ]
Delete: Multiple Categories
Delete: Multiple Categories
To Delete Multiple Categories run the following API call:
ACTION: Delete Multiple Categroies
REQUEST TYPE: POST
END POINTS : <HOST>/rest/V1/category/delete/
REQUEST DATA(json) :
{ "category": [ "1001", "1002" ] }
RESPONSE :
Success:
[ { "response": [ { "id": "1001", "code": "200", "status": "success", "message": "Category Deleted successfully!" }, { "id": "1002", "code": "200", "status": "success", "message": "Category Deleted successfully!" } ] } ]
Required Request (Data Fields) :
Field Name | Required Value | Data Type |
---|---|---|
id | Yes | String |
Error Validation Example
REQUEST
{ "category": [ 1001, 1003 ] }
RESPONSE
[ { "response": [ { "id": 1001, "code": 200, "status": "success", "message": "Category Deleted successfully!" }, { "id": 1003, "code": 404, "status": "error", "message": "Category Id is not Found!" } ] } ]
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.
Simple: Single Product
To create a Simple: Single Product run the following API call:
Action : Create/Update Single Product
URL : <HOST>/rest/V1/product/create/
METHOD : POST
REQUEST :
{ "product": { "10001": { "id": 10001, "name": "Simple Tshirt", "price": "70.12", "special_price": "", "category_id": "101", "status": 1, "enable_product_designer": 1, "tier_price": [ { "price": "50", "qty": "15" }, { "price": "40", "qty": "20" } ], "images": [ { "src": "image_src" } ], "type": "simple" "custom_options": [ { "title": string 'Message for packaging', "type": string "field", "sort_order": number 1, "is_require": number (0/1) 0, "price": decimal 45, "price_type": string "fixed", "sku": alphanumeric "85465da", "max_characters": numeric 100 }, { 'title' : string "Test Option", 'type' : string "file", 'is_require' : number (0/1) 0, "sort_order": number 3, 'price' : decimal 2, 'price_type' : string "fixed", 'sku' :alphanumeric "testsku", 'file_extension' :string "png,jpg", 'image_size_x' : number as string "100", 'image_size_y' : number as string "20" }, { "sort_order": 2, "title": "Color", "price_type": "fixed", "type": "drop_down", "is_require": 0, "price": 23, "sku": "854465da", "max_characters": 208, "values": [ { "title": "RED", "value": "red", "sort_order": 1, "price": 10, "price_type": "fixed", "sku": "fgh45", "is_delete": 0 }, { "title": "Yellow", "sort_order": 2, "value": "yellow", "price": 10, "price_type": "fixed", "sku": "fhfgh5", "is_delete": 0 } ] }, { "title": "My test", "type": "date_time", "sort_order": 3, "is_require": 0, "price": 5, "price_type": "fixed", "sku": "85465da" }, ] } } }
Note:
– “image_src” contains a source path that specifies the full path of the source image.
– Custom Options:
The below is the type which is used in “type”: “field”
text (morefield: ‘max_characters’)
field
area
file (mf: ‘file_extension’, ‘image_size_x’, ‘image_size_y’)
select (mf: ‘value_id’, ‘title’, ‘sort_order’)
drop_down
radio
checkbox
multiple
date
date
date_time
time
RESPONSE
Success:
[ { "response": [ { "id": 10001, "code": "200", "status": "success", "message": "Product Created Successfully!" } ] } ]
Note: “id” will be same in Success response.
Required Request (Data Fields) :
Field Name | Required Value | Data Type |
---|---|---|
id | Yes | String |
name | Yes | String |
price | No | Float |
category_ids | No | String (comma(,) seperated) |
status | No | Number(0,1) |
enable_product_designer | No | Number(0,1) |
images | No | Array() {“src”:”Path”} |
type | Yes | String (“Simple”,”Configurable”) Only |
tier_price | No | Json Array({“price”:”value”,”qty”:”value”}) | custom_options | No | Json Array( { “title”:string ‘Message’,”sort_order”:number 1 },) |
Error Validation Example
REQUEST
{ "product": { "10001": { "id": 10001, "name": "", "price": "70.12", "special_price": "", "category_id": "101", "status": 1, "enable_product_designer": 1, "tier_price": [ { "price": "50", "qty": "15" }, { "price": "40", "qty": "20" } ], "images": [ { "src": "image_src" } ], "type": "simple" } } }
RESPONSE
[ { "response": [ { "id": 10001, "code": 404, "status": "error", "message": "Please pass the proper product data like id,name and type. Also, product type must be either simple or configurable of Magento." } ] } ]
Simple: Multiple Products
To create a Simple: Multiple Product run the following API call:
Action : Create/Update Multiple Products
URL : <HOST>/V1/product/create/
METHOD : POST
REQUEST :
{ "product": { "10001": { "id": 10001, "name": "Sport Tshirt White", "price": "70.12", "special_price": "", "category_id": "1001", "status": 1, "enable_product_designer": 1, "tier_price": [ { "price": "50", "qty": "15" }, { "price": "40", "qty": "20" } ], "images": [ { "src": "image_url" } ], "type": "simple" "custom_options": [ { "title": string 'Message for packaging', "type": string "field", "sort_order": number 1, "is_require": number (0/1) 0, "price": decimal 45, "price_type": string "fixed", "sku": alphanumeric "85465da", "max_characters": numeric 100 }, { 'title' : string "Test Option", 'type' : string "file", 'is_require' : number (0/1) 0, "sort_order": number 3, 'price' : decimal 2, 'price_type' : string "fixed", 'sku' :alphanumeric "testsku", 'file_extension' :string "png,jpg", 'image_size_x' : number as string "100", 'image_size_y' : number as string "20" }, { "sort_order": 2, "title": "Color", "price_type": "fixed", "type": "drop_down", "is_require": 0, "price": 23, "sku": "854465da", "max_characters": 208, "values": [ { "title": "RED", "value": "red", "sort_order": 1, "price": 10, "price_type": "fixed", "sku": "fgh45", "is_delete": 0 }, { "title": "Yellow", "sort_order": 2, "value": "yellow", "price": 10, "price_type": "fixed", "sku": "fhfgh5", "is_delete": 0 } ] }, { "title": "My test", "type": "date_time", "sort_order": 3, "is_require": 0, "price": 5, "price_type": "fixed", "sku": "85465da" }, ] }, "10002": { "id": 10002, "name": "Sport Tshirt Red", "price": "70.12", "special_price": "", "category_id": "1001", "status": 1, "enable_product_designer": 1, "tier_price": [ { "price": "50", "qty": "15" }, { "price": "40", "qty": "20" } ], "images": [ { "src": "image_url" } ], "type": "simple" "custom_options": [ { "title": string 'Message for packaging', "type": string "field", "sort_order": number 1, "is_require": number (0/1) 0, "price": decimal 45, "price_type": string "fixed", "sku": alphanumeric "85465da", "max_characters": numeric 100 }, { 'title' : string "Test Option", 'type' : string "file", 'is_require' : number (0/1) 0, "sort_order": number 3, 'price' : decimal 2, 'price_type' : string "fixed", 'sku' :alphanumeric "testsku", 'file_extension' :string "png,jpg", 'image_size_x' : number as string "100", 'image_size_y' : number as string "20" }, { "sort_order": 2, "title": "Color", "price_type": "fixed", "type": "drop_down", "is_require": 0, "price": 23, "sku": "854465da", "max_characters": 208, "values": [ { "title": "RED", "value": "red", "sort_order": 1, "price": 10, "price_type": "fixed", "sku": "fgh45", "is_delete": 0 }, { "title": "Yellow", "sort_order": 2, "value": "yellow", "price": 10, "price_type": "fixed", "sku": "fhfgh5", "is_delete": 0 } ] }, { "title": "My test", "type": "date_time", "sort_order": 3, "is_require": 0, "price": 5, "price_type": "fixed", "sku": "85465da" }, ] }, "10034": { "id": 10034, "name": "Sport Tshirt Blue", "price": "70.12", "special_price": "", "category_id": "1001", "status": 1, "enable_product_designer": 1, "tier_price": [ { "price": "50", "qty": "15" }, { "price": "40", "qty": "20" } ], "images": [ { "src": "image_url" } ], "type": "simple" "custom_options": [ { "title": string 'Message for packaging', "type": string "field", "sort_order": number 1, "is_require": number (0/1) 0, "price": decimal 45, "price_type": string "fixed", "sku": alphanumeric "85465da", "max_characters": numeric 100 }, { 'title' : string "Test Option", 'type' : string "file", 'is_require' : number (0/1) 0, "sort_order": number 3, 'price' : decimal 2, 'price_type' : string "fixed", 'sku' :alphanumeric "testsku", 'file_extension' :string "png,jpg", 'image_size_x' : number as string "100", 'image_size_y' : number as string "20" }, { "sort_order": 2, "title": "Color", "price_type": "fixed", "type": "drop_down", "is_require": 0, "price": 23, "sku": "854465da", "max_characters": 208, "values": [ { "title": "RED", "value": "red", "sort_order": 1, "price": 10, "price_type": "fixed", "sku": "fgh45", "is_delete": 0 }, { "title": "Yellow", "sort_order": 2, "value": "yellow", "price": 10, "price_type": "fixed", "sku": "fhfgh5", "is_delete": 0 } ] }, { "title": "My test", "type": "date_time", "sort_order": 3, "is_require": 0, "price": 5, "price_type": "fixed", "sku": "85465da" }, ] } } }
Note:
– “image_src” contains a source path that specifies the full path of the source image.
– Custom Options:
The below is the type which is used in “type”: “field”
text (morefield: ‘max_characters’)
field
area
file (mf: ‘file_extension’, ‘image_size_x’, ‘image_size_y’)
select (mf: ‘value_id’, ‘title’, ‘sort_order’)
drop_down
radio
checkbox
multiple
date
date
date_time
time
RESPONSE
Success:
[ { "response": [ { "id": 10001, "code": "200", "status": "success", "message": "Product Updated Successfully!" }, { "id": 10002, "code": "200", "status": "success", "message": "Product Updated Successfully!" }, { "id": 10034, "code": "200", "status": "success", "message": "Product Updated Successfully!" } ] } ]
Note: “image_src” contains a source path which specifies the full path of the source image.
Required Request (Data Fields) :
Field Name | Required Value | Data Type |
---|---|---|
id | Yes | String |
name | Yes | String |
price | No | Float |
category_ids | No | String (comma(,) seperated) |
status | No | Number(0,1) |
enable_product_designer | No | Number(0,1) |
images | No | Array() {“src”:”Path”} |
type | Yes | String (“Simple”,”Configurable”) Only |
tier_price | No | Json Array({“price”:”value”,”qty”:”value”}) | custom_options | No | Json Array( { “title”:string ‘Message’,”sort_order”:number 1 },) |
Error Validation Example
REQUEST
{ "product": { "10001": { "id": 10001, "name": "Test1111111", "price": "70.12", "special_price": "Test 11111", "category_id": "101", "status": 1, "enable_product_designer": 1, "tier_price": [ { "price": "50", "qty": "15" }, { "price": "40", "qty": "20" } ], "images": [ { "src": "image_src" } ], "type": "simple" } } }
RESPONSE
[ { "response": [ { "id": 10001, "code": 404, "status": "error", "message": "Please pass vaild special_price." } ] } ]
Configurable: Single Product
To create a Simple: Multiple Product run the following API call:
Action : Create/Update Configurable: Single Product
URL : <HOST>/rest/V1/product/create/
METHOD : POST
REQUEST :
{ "product": { "10004": { "id": 10004, "name": "Configurable Product", "price": "55.55", "special_price": "", "category_id": "101,102", "status": 1, "enable_product_designer": 1, "images": [ { "src": "image_url" }, { "src": "image_url" }, { "src": "image_url" }, { "src": "image_url" } ], "attribute_names": "Size,Color", "type": "configurable", "variations": { "10002": { "id": 10002, "status": "1", "price": "55.55", "special_price": "", "images": [ { "src": "image_url" }, { "src": "image_url" } ], "attributes": [ { "name": "Size", "option": "M" }, { "name": "Color", "option": "Red" } ] }, "10003": { "id": 10003, "status": "0", "price": "55.55", "special_price": "", "images": [ { "src": "image_url" } ], "attributes": [ { "name": "Size", "option": "M" }, { "name": "Color", "option": "Pink" } ] } }, "custom_options": [ { "title": "Message for packaging", "type": "field", "sort_order": 1, "is_require": 0, "price": 45, "price_type": "fixed", "sku": "85465da", "max_characters": 100 }, { "title": "Test Option", "type": "file", "is_require": 0, "sort_order": 3, "price": 2, "price_type": "fixed", "sku": "testsku", "file_extension": "png,jpg", "image_size_x": "100", "image_size_y": "20" }, { "sort_order": 2, "title": "Color", "price_type": "fixed", "type": "drop_down", "is_require": 0, "price": 23, "sku": "854465da", "max_characters": 208, "values": [ { "title": "RED", "value": "red", "sort_order": 1, "price": 10, "price_type": "fixed", "sku": "fgh45", "is_delete": 0 }, { "title": "Yellow", "sort_order": 2, "value": "yellow", "price": 10, "price_type": "fixed", "sku": "fhfgh5", "is_delete": 0 } ] }, { "title": "My test", "type": "date_time", "sort_order": 3, "is_require": 0, "price": 5, "price_type": "fixed", "sku": "85465da" } ] } } }
– Custom Options:
The below is the type which is used in “type”: “field”
text (morefield: ‘max_characters’)
field
area
file (mf: ‘file_extension’, ‘image_size_x’, ‘image_size_y’)
select (mf: ‘value_id’, ‘title’, ‘sort_order’)
drop_down
radio
checkbox
multiple
date
date
date_time
time
RESPONSE
Success:
[ { "response": [ { "id": 10001, "code": "200", "status": "success", "message": "Product Created Successfully!" } ] } ]
Note: “id” will be same in Success response.
RESPONSE
Success:
[ { "response": [ { "id": 10004, "code": "200", "status": "success", "message": "Product Updated Successfully!" } ] } ]
Required Request (Data Fields) :
Field Name | Required Value | Data Type |
---|---|---|
id | Yes | String |
name | Yes | String |
price | No | Float |
category_ids | No | String (comma(,) seperated) |
status | No | Number(0,1) |
enable_product_designer | No | Number(0,1) |
images | No | Array() {“src”:”Path”} |
type | Yes | String (“Simple”,”Configurable”) Only |
variations | Yes | json :{} (as shown below) |
variations json:{} :
Field Name | Required Value | Data Type |
---|---|---|
id | Yes | String |
price | No | Number,Float |
special_price | No | Number,Float |
status | No | Number(0,1) |
images | No | Array() {“src”:”Path”} |
tier_price | No | Json Array({“price”:”value”,”qty”:”value”}) |
attributes | Yes | Json Array({“name”:”value”,”option”:”value”}) | custom_options | No | Json Array( { “title”:string ‘Message’,”sort_order”:number 1 },) |
Error Validation Example
REQUEST
{ "product": { "10004": { "id": 10004, "name": "Configurable Product", "price": "55.55", "special_price": "", "category_id": "101,102", "status": 1, "enable_product_designer": 1, "images": [ { "src": "image_url" }, { "src": "image_url" }, { "src": "image_url" }, { "src": "image_url" } ], "attribute_names": "Size,Color", "type": "configurable", "variations": "" } } }
RESPONSE
[ { "response": [ { "id": "10004", "code": 404, "status": "error", "message": "Configurable product and its sub-products must have proper attribute values." } ] } ]
Configurable: Multiple Products
To create a Configurable: Multiple Products run the following API call:
Action : Create/Update Configurable: Multiple Products
URL : <HOST>/rest/V1/product/create/
METHOD : POST
REQUEST :
{ "product": { "10008": { "id": "10008", "name": "Adidas Tshirt-11", "price": "55.55", "special_price": "", "category_id": "101,102", "status": 1, "enable_product_designer": 1, "images": [ { "src": "image_src" }, { "src": "image_src" } ], "attribute_names": "Size,Color", "type": "configurable", "variations": { "10005": { "id": "10005", "status": 1, "price": "55.55", "special_price": "", "images": [ { "src": "image_src" } ], "attributes": [ { "name": "Size", "option": "M" }, { "name": "Color", "option": "Red" } ] }, "10006": { "id": "10006", "status": 1, "price": "55.55", "special_price": "", "images": [ { "src": "image_src" } ], "attributes": [ { "name": "Size", "option": "M" }, { "name": "Color", "option": "Pink" } ] }, "10007": { "id": "10007", "status": 1, "price": "55.55", "special_price": "", "images": [ { "src": "image_src" } ], "attributes": [ { "name": "Size", "option": "M" }, { "name": "Color", "option": "Purpal" } ] } }, "custom_options": [ { "title": "Message for packaging", "type": "field", "sort_order": 1, "is_require": 0, "price": 45, "price_type": "fixed", "sku": "85465da", "max_characters": 100 }, { "title": "Test Option", "type": "file", "is_require": 0, "sort_order": 3, "price": 2, "price_type": "fixed", "sku": "testsku", "file_extension": "png,jpg", "image_size_x": "100", "image_size_y": "20" }, { "sort_order": 2, "title": "Color", "price_type": "fixed", "type": "drop_down", "is_require": 0, "price": 23, "sku": "854465da", "max_characters": 208, "values": [ { "title": "RED", "value": "red", "sort_order": 1, "price": 10, "price_type": "fixed", "sku": "fgh45", "is_delete": 0 }, { "title": "Yellow", "sort_order": 2, "value": "yellow", "price": 10, "price_type": "fixed", "sku": "fhfgh5", "is_delete": 0 } ] }, { "title": "My test", "type": "date_time", "sort_order": 3, "is_require": 0, "price": 5, "price_type": "fixed", "sku": "85465da" } ] }, "10012": { "id": 10012, "name": "Adidas Shirt", "price": "55.55", "special_price": "", "category_id": "101,102", "status": 1, "enable_product_designer": 1, "images": [ { "src": "image_src" }, { "src": "image_src" } ], "attribute_names": "Size,Color", "type": "configurable", "variations": { "10009": { "id": "10009", "status": 1, "price": "55.55", "special_price": "", "category_id": "201,301", "images": [ { "src": "image_src" } ], "attributes": [ { "name": "Size", "option": "M" }, { "name": "Color", "option": "Red" } ] }, "10010": { "id": "10010", "status": 1, "price": "55.55", "special_price": "", "images": [ { "src": "image_src" } ], "attributes": [ { "name": "Size", "option": "M" }, { "name": "Color", "option": "Pink" } ] }, "10011": { "id": "10011", "status": 1, "price": "55.55", "special_price": "", "category_id": "101,102", "images": [ { "src": "image_src" } ], "attributes": [ { "name": "Size", "option": "M" }, { "name": "Color", "option": "Purpal" } ] } }, "custom_options": [ { "title": "Message for packaging", "type": "field", "sort_order": 1, "is_require": 0, "price": 45, "price_type": "fixed", "sku": "85465da", "max_characters": 100 }, { "title": "Test Option", "type": "file", "is_require": 0, "sort_order": 3, "price": 2, "price_type": "fixed", "sku": "testsku", "file_extension": "png,jpg", "image_size_x": "100", "image_size_y": "20" }, { "sort_order": 2, "title": "Color", "price_type": "fixed", "type": "drop_down", "is_require": 0, "price": 23, "sku": "854465da", "max_characters": 208, "values": [ { "title": "RED", "value": "red", "sort_order": 1, "price": 10, "price_type": "fixed", "sku": "fgh45", "is_delete": 0 }, { "title": "Yellow", "sort_order": 2, "value": "yellow", "price": 10, "price_type": "fixed", "sku": "fhfgh5", "is_delete": 0 } ] }, { "title": "My test", "type": "date_time", "sort_order": 3, "is_require": 0, "price": 5, "price_type": "fixed", "sku": "85465da" } ] } } }
RESPONSE
Success:
[ { "response": [ { "id": 10008, "code": "200", "status": "success", "message": "Product Updated Successfully!" }, { "id": 10012, "code": "200", "status": "success", "message": "Product Updated Successfully!" } ] } ]
Note:
– Custom Options:
The below is the type which is used in “type”: “field”
text (morefield: ‘max_characters’)
field
area
file (mf: ‘file_extension’, ‘image_size_x’, ‘image_size_y’)
select (mf: ‘value_id’, ‘title’, ‘sort_order’)
drop_down
radio
checkbox
multiple
date
date
date_time
time
RESPONSE
Required Request (Data Fields) :
Field Name | Required Value | Data Type |
---|---|---|
id | Yes | String |
name | Yes | String |
price | No | Float |
category_ids | No | String (comma(,) seperated) |
status | No | Number(0,1) |
enable_product_designer | No | Number(0,1) |
images | No | Array() {“src”:”Path”} |
type | Yes | String (“Simple”,”Configurable”) Only |
variations | Yes | json :{} (as shown below) |
variations json:{} :
Field Name | Required Value | Data Type |
---|---|---|
id | Yes | String |
price | No | Number,Float |
special_price | No | Number,Float |
status | No | Number(0,1) |
images | No | Array() {“src”:”Path”} |
tier_price | No | Json Array({“price”:”value”,”qty”:”value”}) |
attributes | Yes | Json Array({“name”:”value”,”option”:”value”}) | custom_options | No | Json Array( { “title”:string ‘Message’,”sort_order”:number 1 },) |
Delete: Single Product
To Delete a Single Product run the following API call:
ACTION: Delete Single Product
REQUEST TYPE: POST
END POINTS : <HOST>/rest/V1/product/delete/
REQUEST DATA(json) :
{ "product": [ "10001" ] }
RESPONSE
Success:
[ { "response": [ { "id": "10001", "code": "200", "status": "success", "message": "Product Deleted successfully!" } ] } ]
Required Request (Data Fields) :
Field Name | Required Value | Data Type |
---|---|---|
product | Yes | String array():Ex:Array of product ids |
Error Validation Example
REQUIREMENT
{ "product": [ 10001, 4545454 ] }
RESPONSE
[ { "response": [ { "id": 10001, "code": 200, "status": "success", "message": "Prodcut Deleted successfully!" }, { "id": 4545454, "code": 404, "status": "error", "message": "Product Id is Not Found!" } ] } ]
Delete: Multiple Products
To Delete Multiple Products run the following API call:
ACTION: Delete Multiple Products
REQUEST TYPE: POST
END POINTS : <HOST>/rest/V1/product/delete/
REQUEST DATA(json) :
{ "product": [ "10001", "100011" ] }
RESPONSE
Success:
[ { "response": [ { "id": "10001", "code": "200", "status": "success", "message": "Product Deleted succesfully!" }, { "id": "100011", "code": "400", "status": "error", "message": "Product Id is Not Found!" } ] } ]
Required Request (Data Fields) :
Field Name | Required Value | Data Type |
---|---|---|
product | Yes | String array():Ex:Array of product ids |
Error Validation Example
REQUEST
{ "product": [ 1001 ] }
RESPONSE
[ { "response": [ { "id": 1001, "code": 404, "status": "error", "message": "Product Id is Not Found!" } ] } ]
Configure Product Designer
When the Product Designer area is configured, call below API to display the design area on the product as the customer clicks on the product image.
Save design URL and image URL
To save a design URL and Image URL run the following API call:
URL : End Point of Third Party
METHOD : POST
REQUEST :
{ "image_url": "image_url", "designer_url": "designer_url", "enable_product_designer": 0, "integration_product_id": 10001 }
RESPONSE
Success:
[ { "response": "success" } ]
Order
With this API, you can create Order for Single Order and Multiple Orders.
Single Order
The below API call is used for creating a Single Order.
Action : Create a Single Order
URL : <HOST>/rest/V1/order/create/
METHOD : POST
REQUEST :
{ "order": { "11001": { "order_id": "11001", "shipping_address": { "name": "PrintXpand", "address1": "44, Elispa" "address2": "830 W Washington Blvd", "phone": "777-777-7777", "city": "California", "state": "Ontario", "country": "USA", "country_code": "US", "zip": "90004" }, "sub_total": "66.00", "status": "Success", "design_id": [ "1524", "1525", "1526" ], "item_price": [ "22.00", "22.00", "22.00" ], "item_qty": [ 2, 3, 5 ] } } }
RESPONSE :
Success:
[ { "response": [ { "id": "11001", "code": "200", "status": "success", "message": "Order Created successfully!!" } ] } ]
Required Request (Data Fields) :
Field Name | Required Value | Data Type |
---|---|---|
order_id | Yes | String |
sub_total | Yes | String |
item_price | Yes | int array() |
item_qty | Yes | int array() |
design_id | Yes | int array() |
status | No | String() |
shipping_address | Yes | json :{} |
Shipping Adress json :{}
Field Name | Required Value | Data Type |
---|---|---|
name | Yes | String |
address1 | No | String |
address2 | No | String |
city | No | String |
state | No | String |
country | No | String |
zip | No | String |
phone | No | String |
Error Validation Example
REQUEST
{ "order": { "1406539694128": { "order_id": "1406539694128", "shipping_address": { "name": "Vincy", "address1": "Sun Heritage, 14, Abott Main Road", "address2": "Besides Mysong FM station", "phone": "777-777-7777", "city": "Denver", "state": "colorado", "country": "USA", "country_code": "US", "zip": "740011" }, "design_id": [ "1524", "1525" ], "status": "Open", "sub_total": "220.00", "item_price": [ "22.00", "22.00", "22.00" ], "item_qty": [ 2, 3, 5 ] } } }
RESPONSE
[ { "response": [ { "id": "1406539694128", "code": 404, "status": "error", "message": "Order design id, item price, and item qty is not equaled" } ] } ]
Multiple Orders
The below API call is used for creating Multiple Orders.
Action : Create Multiple Orders
URL : <HOST>/rest/V1/order/create/
METHOD : GET/POST
REQUEST :
{ "order": { "1406539694128": { "order_id": "1406539694128", "shipping_address": { "name": "Vinni Seika", "address1": "830 W Washington Blvd", "address2": "830 W Washington Blvd", "phone": "777-777-7777", "city": "Fakecity", "state": "California", "country": "USA", "country_code": "US", "zip": "90004" }, "design_id": [ "1524", "1525", "1526" ], "sub_total": "220.00", "status": "Success", "item_price": [ "22.00", "22.00", "22.00" ], "item_qty": [ 2, 3, 5 ] }, "1406539923504": { "order_id": "1406539923504", "shipping_address": { "name": "Jane Peter", "address1": "830 W Washington Blvd", "address2": "830 W Washington Blvd", "phone": "777-777-7777", "city": "Los Angeles", "state": "California", "country": "USA", "country_code": "US", "zip": "90004" }, "design_id": [ "1524", "1525", "1526" ], "sub_total": "220.00", "status": "Success", "item_price": [ "22.00", "22.00", "22.00" ], "item_qty": [ 2, 3, 5 ] }, "1409158479920": { "order_id": "1409158479920", "shipping_address": { "name": "Veronica", "address1": "321 Alps Commercial", "address2": "Midway Street", "phone": "777-777-7777", "city": "Dallas", "state": "Texas", "country": "USA", "country_code": "US", "zip": "53014" }, "design_id": [ "1524", "1525", "1526" ], "sub_total": "220.00", "status": "Success", "item_price": [ "22.00", "22.00", "22.00" ], "item_qty": [ 2, 3, 5 ] }, "1409170898992": { "order_id": "1409170898992", "shipping_address": { "name": "Veronica", "address1": "321 Alps Commercial", "address2": "Midway Street", "phone": "777-777-7777", "city": "Dallas", "state": "Texas", "country": "USA", "country_code": "US", "zip": "90014" }, "design_id": [ "1524", "1525", "1526" ], "sub_total": "220.00", "status": "Success", "item_price": [ "22.00", "22.00", "22.00" ], "item_qty": [ 2, 3, 5 ] }, "1409172930608": { "order_id": "1409172930608", "shipping_address": { "name": "Veronica", "address1": "321 Alps Commercial", "address2": "Midway Street", "phone": "777-777-7777", "city": "Dallas", "state": "Texas", "country": "USA", "country_code": "US", "zip": "90014" }, "design_id": [ "1524", "1525", "1526" ], "sub_total": "220.00", "status": "Success", "item_price": [ "22.00", "22.00", "22.00" ], "item_qty": [ 2, 3, 5 ] } } }
RESPONSE
Success:
[ { "response": [ { "id": "1406539694128", "code": "200", "status": "success", "message": "Order updated successfully!" }, { "id": "1406539923504", "code": "200", "status": "success", "message": "Order updated successfully!" }, { "id": "1409158479920", "code": "200", "status": "success", "message": "Order updated successfully!" }, { "id": "1409170898992", "code": "200", "status": "success", "message": "Order updated successfully!" }, { "id": "1409172930608", "code": "200", "status": "success", "message": "Order updated successfully!" } ] } ]
Field Name | Required Value | Data Type |
---|---|---|
order_id | Yes | String |
sub_total | Yes | String |
item_price | Yes | int array() |
item_qty | Yes | int array() |
design_id | Yes | int array() |
status | No | String() |
shipping_address | Yes | json :{} |
Shipping Adress json :{}
Field Name | Required Value | Data Type |
---|---|---|
name | Yes | String |
address1 | No | String |
address2 | No | String |
city | No | String |
state | No | String |
country | No | String |
zip | No | String |
phone | No | String |
Custom Success/Error Codes
The following Sucess / Error Response will get after API calls.
Error Response
You will get two types of Error Responses after API calls: Error 400 and 404 (Client-side Errors)
The browser returns 400 error status response code indicates the Bad Request.
The browser returns 404 error status response code indicates the server doesn’t find anything on the requested location. The requested resource could not be found but may be available in the future
Success Response
You will get two types of Success Responses after API calls: Success 200 and 201
The 200 success status response code indicates that the request has succeeded and fulfilled.
The 201 success status response code indicates that the request has partially succeeded but some of the data may not be responded.