PrintXpand V3.0- 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
email Yes 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
email Yes 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) :

custom_optionsNoJson Array( { “title”:string ‘Message’,”sort_order”:number 1 },)

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”})

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) :

custom_optionsNoJson Array( { “title”:string ‘Message’,”sort_order”:number 1 },)

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”})

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:{} :

custom_optionsNoJson Array( { “title”:string ‘Message’,”sort_order”:number 1 },)

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”})

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:{} :

custom_optionsNoJson Array( { “title”:string ‘Message’,”sort_order”:number 1 },)

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”})

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 :

{
  "orders": {
    "103": {
      "order_id": 103,
      "currency_id": "INR",
      "email": "jenny.albama@gmail.com",
      "discount": 0,
      "status": "Awaiting check payment",
      "grandtotal": 168.75,
      "increment_id": 103,
      "shipping_address": {
        "firstname": "Jenny",
        "lastname": "Albama",
        "street": "Dev Aurum",
        "city": "Ahmedabad",
        "state": "Gujarat",
        "country": "India",
        "postcode": "380051",
        "country_id": "IN",
        "telephone": ""
      },
      "billing_address": {
        "firstname": "Jenny",
        "lastname": "Albama",
        "street": "Dev Aurum",
        "city": "Ahmedabad",
        "state": "Gujarat",
        "country": "India",
        "postcode": "380051",
        "country_id": "IN",
        "telephone": ""
      },
      "items": {
        "195": {
          "product_id": "195",
          "price": 168.75,
          "design_id": "36",
          "qty": "1",
          "associateProductId": "0",
          "additional_options": {
            "Product Design": "Yes",
            "_Product Design": "36",
           "_designer_url": "YOUR_DESIGN_URL",
            "_image_url": "YOUR_IMAGE_URL"
            }
          }
        }
      }
    }
}


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 int
currency_id Yes int
email Yes String
discount No int
status No int
grand_total Yes decimal
increment_id Yes int
shipping_address Yes array()
billing_address Yes array()

 

 

items array{}

 

Field Name Required Value Data Type
product_id Yes int
price Yes decimal
design_id Yes int
qty Yes int
associateProductId No int

 

 

additional_options array{}

 

Field Name Required Value Data Type
Product Design Yes String
_designer_url No String

 

 

shipping_address array{}

 

Field Name Required Value Data Type
firstname Yes String
lastname Yes String
street No String
city No String
state No String
country No String
postcode No String
country_id No String
telephone No String

 

 

billing_address array {}

 

Field Name Required Value Data Type
fistname Yes String
lastname Yes String
street No String
city No String
state No String
country No String
postcode No numeric
country_id No String
telephone No numeric

 

 

Error Validation Example

 

REQUEST

{
  "orders": {
    "103": {
      "order_id":"",
      "currency_id": "INR",
      "email": "jenny.albama@gmail.com",
      "discount": 0,
      "status": "Awaiting check payment",
      "grandtotal": 168.75,
      "increment_id": 103,
      "shipping_address": {
        "firstname": "Jenny",
        "lastname": "Albama",
        "street": "Dev Aurum",
        "city": "Ahmedabad",
        "state": "Gujarat",
        "country": "India",
        "postcode": "380051",
        "country_id": "IN",
        "telephone": ""
      },
      "billing_address": {
        "firstname": "Jenny",
        "lastname": "Albama",
        "street": "Dev Aurum",
        "city": "Ahmedabad",
        "state": "Gujarat",
        "country": "India",
        "postcode": "380051",
        "country_id": "IN",
        "telephone": ""
      },
      "items": {
        "195": {
          "product_id": "195",
          "price": 168.75,
          "design_id": "36",
          "qty": "1",
          "associateProductId": "0",
          "additional_options": {
            "Product Design": "Yes",
            "_Product Design": "36",
            "_designer_url": "YOUR_DESIGN_URL",
            "_image_url": "YOUR_IMAGE_URL"
            }
          }
        }
      }
    }
  }
}

RESPONSE

[
  {
    "response": [
      {
        "id": 103,
        "code": 404,
        "status": "error",
        "message": "Please pass the value of the key order_id"
      }
    ]
  }
]

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 :

{
  "orders": {
    "103": {
      "order_id": 103,
      "currency_id": "INR",
      "email": "jenny.albama23@gmail.com",
      "discount": 0,
      "status": "Awaiting check payment",
      "grandtotal": 168.75,
      "increment_id": 103,
      "shipping_address": {
        "firstname": "Jenny",
        "lastname": "Albama",
        "street": "Dev Aurum",
        "city": "Ahmedabad",
        "state": "Gujarat",
        "country": "India",
        "postcode": "380051",
        "country_id": "IN",
        "telephone": ""
      },
      "billing_address": {
        "firstname": "Jenny",
        "lastname": "Albama",
        "street": "Dev Aurum",
        "city": "Ahmedabad",
        "state": "Gujarat",
        "country": "India",
        "postcode": "380051",
        "country_id": "IN",
        "telephone": ""
      },
      "items": {
        "195": {
          "product_id": "195",
          "price": 168.75,
          "design_id": "36",
          "qty": "1",
          "associateProductId": "0",
          "additional_options": {
            "Product Design": "Yes",
            "_Product Design": "36",
           "_designer_url": "YOUR_DESIGN_URL",
            "_image_url": "YOUR_IMAGE_URL"
            }
          }
        }
      }
    },
    "104": {
      "order_id": 104,
      "currency_id": "INR",
      "email": "nick.saha@gmail.com",
      "discount": 0,
      "status": "Awaiting check payment",
      "grandtotal": 168.75,
      "increment_id": 104,
      "shipping_address": {
        "firstname": "Nick",
        "lastname": "Saha",
        "street": "Dev Aurum",
        "city": "Ahmedabad",
        "state": "Gujarat",
        "country": "India",
        "postcode": "380051",
        "country_id": "IN",
        "telephone": ""
      },
      "billing_address": {
        "firstname": "Nick",
        "lastname": "Saha",
        "street": "Dev Aurum",
        "city": "Ahmedabad",
        "state": "Gujarat",
        "country": "India",
        "postcode": "380051",
        "country_id": "IN",
        "telephone": ""
      },
      "items": {
        "195": {
          "product_id": "195",
          "price": 168.75,
          "design_id": "37",
          "qty": "1",
          "associateProductId": "0",
          "additional_options": {
            "Product Design": "Yes",
            "_Product Design": "37",
           "_designer_url": "YOUR_DESIGN_URL",
            "_image_url": "YOUR_IMAGE_URL"
            }
          }
        }
      }
 }

 

RESPONSE

 

Success:

[
  {
    "response": [
      {
        "id": "103",
        "code": "200",
        "status": "success",
        "message": "Order updated successfully!"
      },
      {
        "id": "104",
        "code": "200",
        "status": "success",
        "message": "Order updated successfully!"
      }
    ]
  }
]

Required Request (Data Fields) :

 

Field Name Required Value Data Type
order_id Yes int
currency_id Yes int
email Yes String
discount No int
status No int
grand_total Yes decimal
increment_id Yes int
shipping_address Yes array()
billing_address Yes array()

 

 

items array{}

 

Field Name Required Value Data Type
product_id Yes int
price Yes decimal
design_id Yes int
qty Yes int
associateProductId No int

 

 

additional_options array{}

 

Field Name Required Value Data Type
Product Design Yes String
_designer_url No String

 

 

shipping_address array{}

 

Field Name Required Value Data Type
firstname Yes String
lastname Yes String
street No String
city No String
state No String
country No String
postcode No numeric
country_id No String
telephone No numeric

 

 

billing_address array{}

 

Field Name Required Value Data Type
fistname Yes String
lastname Yes String
street No String
city No String
state No String
country No String
postcode No String
country_id No String
telephone 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 a 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 been fulfilled.

 

The 201 success status response code indicates that the request has partially succeeded but some of the data may not be responded to.

Save Configuration

This is the json format for the Save configuration.

 

URL : <HOST>/rest/V1/save/configuration/

{
"source_url": "YOUR_SOURCE_URL",
"add_to_cart_url": "YOUR_ADD_TO_CART_URL",
"login_url": "YOUR_LOG_IN_URL",
"logout_url": "YOUR_LOGOUT_URL",
"authenticate_url": "YOUR_AUTHENTICATE_URL",
"save_design_url": "YOUR_SAVE_DESIGN_URL",
"currency": "INR",
"locale": "en_US"
}

 

Note: All the above fields are mandatory. The currency must be in the ISO format. i.e. INR, USD.