Product

Manage Product

Create Product

POST ‎https://<domain>/<api prefix>/<version>/commerce/product/create/

This API endpoint will create a product under an external-api-product type.

Headers

NameTypeDescription

apikey*

string

apikey

Authorization*

string

Bearer access token

Request Body

NameTypeDescription

bundle_id*

string

Bundle id(bundle unique id)

name*

string

Product bundle name

bundle_name_translations*

string

Translations for a product bundle. A Bundle name in English is required.

description_translations*

string

Product description, Description in English is required.

short_description_translations*

string

Product short description, A short description in English is required.

varients*

string

At least one varient is required. Varient must contain price, product-name, and whole-sale-price. and ensure that the selected product type only contains these three varients. Additionally, add a key product-sku (product unique sku).

attributes*

string

The attribute must contain business-volume, points, and, cumulative-volume.

​HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}

Note:-

By using this API endpoint you can create a product under product type external-api-product.

Body Parameters are JSON.stringify, Refer below block for the body parameter structure, and also refer sample code.

{
    "bundle_id":"<bundle_id>",
    "name":"<bundle_name>",
    "bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
    "description_translations":{"en": "<description_en>","de": "<description_dn>"},
    "short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
    "varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"}],
    "attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
}

Sample Code

Node

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://<domain>/<api prefix>/<version>/commerce/product/create/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "bundle_id":"<bundle_id>",
    "name":"<bundle_name>",
    "bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
    "description_translations":{"en": "<description_en>","de": "<description_dn>"},
    "short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
    "varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"}],
    "attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/commerce/product/create/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "bundle_id":"<bundle_id>",
    "name":"<bundle_name>",
    "bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
    "description_translations":{"en": "<description_en>","de": "<description_dn>"},
    "short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
    "varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"}],
    "attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
}',
  CURLOPT_HTTPHEADER => array(
    'apikey: <apikey>',
    'Authorization: Bearer <access token>',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Error Responses

Status Code

Error Type

FIeld

Description

401

Request Failed

Required product type for creating product using api is not created.

400

Validation Error

bundle_id

Bundle id is required.

This field may not be blank.

Produt with same bundle id is already exist.

400

Validation Error

name

This field is required.

This field may not be blank.

Ensure this field has no more than 200 characters.

400

Validation Error

bundle_name_translations

This field is required.

Bundle Name for en language is required.

400

Validation Error

description_translations

This field is required.

Description of en language is required.

400

Validation Error

short_description_translations

This field is required.

A short description of en language is required.

400

Validation Error

varients

This field is required.

You can't possible add a product under the requested product type. Select a product type have only Price, Whole sale price and Product name as varients.

One of the varient object is not valid, check each varient objects contains price,product-name,whole-sale-price and product-sku.

At least one varient is required.

Product id should be a unique value.

Product id may not be a null value. Same product id's recieved.

400

Validation Error

attributes

This field is required.

You cant possible to add product under the requested product type. Select a product type have only Business-volume, Pointes and Cumulative-volume as attributes.

Attribute should contains Business-volume, Points and Cumulative-volume, not include another attributes.

Business-volume is required.

Points is required.

Cumulative-volume is required.

Attribute must contains Business-volume, Points and Cumulative-volume.

Update Product

POST ‎https://<domain>/<api prefix>/<version>/commerce/product/update/

This API endpoint will update a product bundle if it's an external-api-product type .

Headers

NameTypeDescription

apikey*

string

apikey

Authorization*

string

Access token

Request Body

NameTypeDescription

bundle_id*

string

Product bundle unique id

name*

string

New name or existing name for bundle.

bundle_name_translations*

string

Existing or New Translations for a product bundle.

description_translations*

string

Existing or New Translations for Product description

short_description_translations*

string

Existing or New Translations for Product short description,

varients*

string

Varient must contain price, product-name, and whole-sale-price. Additionally, add a key product-sku with aexisting sku as a value if u want to update existing variant or give new sku as a value to add new product varient.

attributes*

string

The attribute must contain business-volume, points, and, cumulative-volume.

​HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}

Note:-

By using this API endpoint you can update a product that is under external-api-product.

Additionally, add a key product-sku with a existing id as a value if you want to update the existing varient. Give new id as a value of product-sku for adding a new product varient.

Body Parameters are JSON.stringify, Refer below block for the body parameter structure, and also refer sample code.

{
    "bundle_id":"<bundle_id>",
    "name":"<bundle_name>",
    "bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
    "description_translations":{"en": "<description_en>","de": "<description_dn>"},
    "short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
    "varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":<product_sku>},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":<product_sku>}],
    "attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
}

Sample Code

Node

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://<domain>/<api prefix>/<version>/commerce/product/update/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "bundle_id":"<bundle_id>",
    "name":"<bundle_name>",
    "bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
    "description_translations":{"en": "<description_en>","de": "<description_dn>"},
    "short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
    "varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":<product_sku>},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":<product_sku>}],
    "attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
})

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/commerce/product/update/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "bundle_id":"<bundle_id>",
    "name":"<bundle_name>",
    "bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
    "description_translations":{"en": "<description_en>","de": "<description_dn>"},
    "short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
    "varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":<product_sku>},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":<product_sku>}],
    "attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
}',
  CURLOPT_HTTPHEADER => array(
    'apikey: <apikey>',
    'Authorization: Bearer <access token>',
    'Content-Type: application/json',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Error Responses

Status Code

Error Type

FIeld

Description

400

Invalid Input

bundle_id

Bundle id is required.

This field may not be blank.

Bundle does not exist.

Requested bundle is not under the external api product category.

400

Validation Error

name

This field is required.

This field may not be blank.

Ensure this field has no more than 200 characters.

400

Validation Error

description_translations

This field is required.

Description of en language is required.

400

Validation Error

short_description_translations

This field is required.

A short description of en language is required.

400

Validation Error

varients

You can't possible add a product under the requested product type. Select a product type have only Price, Whole sale price and Product name as varients.

One of the varient object is not valid, check each varient objects contains price,product-name,whole-sale-price and product-sku.

At least one varient is required.

Product sku should be a unique value. Product sku may not be a null value. Same product sku's recieved.

400

Validation Error

attributes

You cant possible to add product under the requested product type. Select a product type have only Business-volume, Pointes and Cumulative-volume as attributes.

Attribute should contains Business-volume, Points and Cumulative-volume, not include another attributes.

Business-volume is required.

Points is required.

Cumulative-volume is required.

Attribute must contains Business-volume, Points and Cumulative-volume.

Delete Product Bundle

DELETE ‎https://<domain>/<api prefix>/<version>/commerce/product/delete/

This API endpoint will delete a product bundle if it's an external-api-product type.

Query Parameters

NameTypeDescription

bundle_id*

string

Bundle id

Headers

NameTypeDescription

apikey*

string

apikey

Authorization*

string

Bearer access token

​HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}

Sample Code

Node

var request = require('request');
var options = {
  'method': 'DELETE',
  'url': 'https://<domain>/<api prefix>/<version>/commerce/product/delete/?bundle_id=<bundle_id>',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/commerce/product/delete/?bundle_id=<bundle_id>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
  CURLOPT_HTTPHEADER => array(
    'apikey: <apikey>',
    'Authorization: Bearer <access token>'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Error Responses

Status Code

Error Type

FIeld

Description

400

Invalid Input

bundle_id

Bundle id is required.

This field may not be blank.

Product Bundle does not exist.

Product Bundle is not a external-api-product type.

401

Request Failed

The product contains in a order that is not completed yet.

The package purchased by some users.

Delete Product Varient

DELETE ‎https://<domain>/<api prefix>/<version>/commerce/product/delete/product-varient/

This API endpoint will delete a varient (product) from the product bundle if it's an external-api-product type.

Query Parameters

NameTypeDescription

bundle_id*

string

Bundle id

product_sku*

string

Product sku.

Headers

NameTypeDescription

apikey*

string

apikey

Authorization*

string

Bearer access token

​HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}

Sample Code

Node

var request = require('request');
var options = {
  'method': 'DELETE',
  'url': 'https://<domain>/<api prefix>/<version>/commerce/product/delete/product-varient/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/commerce/product/delete/product-varient/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
  CURLOPT_HTTPHEADER => array(
    'apikey: <apikey>',
    'Authorization: Bearer <access token>',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Error Responses

Status Code

Error Type

FIeld

Description

400

Validation Error

product_sku

This field is required.

This field may not be blank.

Product sku is not valid.

Product does not exist.

400

Validation Error

bundle_id

This field is required.

This field may not be blank.

401

Request Failed

Only one varient left under the product bundle, can't delete it.

You can delete a product under the external-api-product not athor category product.

Only one varient left under the prouct bundle, can't delete it.

List Products

GET ‎https://<domain>/<api prefix>/<version>/commerce/product/list/

This API endpoint List product bundle with product details.

Query Parameters

NameTypeDescription

offset

string

limit

string

name

string

Product Bundle name

category

string

Product type

Headers

NameTypeDescription

apikey*

string

apikey

Authorization*

string

Bearer access token

​HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {
        "results": [
             {
                "name": "<bundli_name>",
                "product_type": "<product_type>",
                "status": <status>,
                "products": [
                    {
                        "product_id": "<product_id>",
                        "name": "<product_name>",
                        "product_type": "<product_type_name>",
                        "base_price": "<product_price>",
                        "status": <status>,
                        "image": "<image>"
                    }
                ],
                "bundle_id": "<bundle_id>"
            },
            ...
        ],
        "count": <list_count>,
        "previous": <previous_page_url>,
        "next": <next_page_url>
    }
}

Sample Code

Node

var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://<domain>/<api prefix>/<version>/commerce/product/list/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/commerce/product/list/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'apikey: <apikey>',
    'Authorization: Bearer <access token>'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Create Bulk Products

POST ‎https://<domain>/<api prefix>/<version>/commerce/product/bulk/create/

This API endpoint will create bulk product.

Headers

NameTypeDescription

apikey*

string

Apikey

Authorization*

string

Bearer access token

​HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {
        "Product_creation_failed": {
            "same_bundle_id": [<return if already exist product with same bundle id.>],
            "bundle_id_null": [<return if bunle is a null value.>],
            "bundle_id_not_found": [<return if bundle id is not given.>]
        }
    }
}

Body params :- JSON.stringify

[
    {
        "bundle_id":"<bundle_id>",
        "name":"<bundle_name>",
        "bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
        "description_translations":{"en": "<description_en>","de": "<description_dn>"},
        "short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
        "varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sk>"}],
        "attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
    },
    {
        "bundle_id":"<bundle_id>",
        "name":"<bundle_name>",
        "bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
        "description_translations":{"en": "<description_en>","de": "<description_dn>"},
        "short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
        "varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sju>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"}],
        "attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
    },
    ...
]

Sample Code

Node

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://<domain>/<api prefix>/<version>/commerce/product/bulk/create/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify([{
        "bundle_id":"<bundle_id>",
        "name":"<bundle_name>",
        "bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
        "description_translations":{"en": "<description_en>","de": "<description_dn>"},
        "short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
        "varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"}],
        "attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
     },
     {
        "bundle_id":"<bundle_id>",
        "name":"<bundle_name>",
        "bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
        "description_translations":{"en": "<description_en>","de": "<description_dn>"},
        "short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
        "varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"}],
        "attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
     },
    ...
    ])

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/commerce/product/bulk/create/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'[
   {
        "bundle_id":"<bundle_id>",
        "name":"<bundle_name>",
        "bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
        "description_translations":{"en": "<description_en>","de": "<description_dn>"},
        "short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
        "varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"}],
        "attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
   },
   {
        "bundle_id":"<bundle_id>",
        "name":"<bundle_name>",
        "bundle_name_translations":{"en": "<bundle_name_en>","de": "<bundle_name_de>"},
        "description_translations":{"en": "<description_en>","de": "<description_dn>"},
        "short_description_translations":{"en": "<short_description_en>","de": "<short_description_de>"},
        "varients":[{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-sku":"<product_sku>"}],
        "attributes":{"business-volume":<business-volume>, "points":<reward_point>, "cumulative-volume":<cumulative_volume>}
   },
    ...
  ]',
  CURLOPT_HTTPHEADER => array(
    'apikey: <apikey>',
    'Authorization: Bearer <access token>',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Error Responses

Status Code

Error Type

FIeld

Description

400

Request Failed

Required product type for creating product using api is not created.

Maximum bulk create product count is 50.

Check error responses of the create product endpoint.

List API Product

GET ‎https://<domain>/<api prefix>/<version>/commerce/product/list/api-products/

This API endpoint will return a list of products that are created by api.

Headers

NameTypeDescription

apikey*

string

Apikey

Authorization*

string

Bearer access token

​HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {
        "results": [
            {
                "bundle_id": "<bundle_id>",
                "bundle_name": "<bundle_name>",
                "products": [
                    {
                        "product_id": "<product_id>",
                        "name": "<product_name1>",
                        "base_price": <base_price>,
                        "status": <status>
                    },
                    ...
                ]
            },
            ...
        ],
        "count": <list_count>,
        "previous": <previous_page_url>,
        "next": <next_page_url>
    }
}

Sample Code

Node

var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://<domain>/<api prefix>/<version>/commerce/product/list/api-products/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>',
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/commerce/product/list/api-products/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'apikey: <apikey>',
    'Authorization: Bearer <access token>',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Last updated