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.
Request
Response
Request
Headers
apikey
required
string
apikey
Authorization
required
string
Bearer access token
Body Parameters
bundle_id
required
string
Bundle id(bundle unique id)
name
required
string
Product bundle name
bundle_name_translations
required
string
Translations for a product bundle. A Bundle name in English is required.
description_translations
required
string
Product description, Description in English is required.
short_description_translations
required
string
Product short description, A short description in English is required.
varients
required
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-id (product unique id).
attributes
required
string
The attribute must contain business-volume, points, and, cumulative-volume.
Response
200: OK
​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-id":"<product_id>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-id":"<product_id>"}],
"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-id":"<product_id>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-id":"<product_id>"}],
"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-id":"<product_id>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-id":"<product_id>"}],
"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-id.

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 .
Request
Response
Request
Headers
apikey
required
string
apikey
Authorization
required
string
Access token
Body Parameters
bundle_id
required
string
Product bundle unique id
name
required
string
New name or existing name for bundle.
bundle_name_translations
required
string
Existing or New Translations for a product bundle.
description_translations
required
string
Existing or New Translations for Product description
short_description_translations
required
string
Existing or New Translations for Product short description,
varients
optional
string
Varient must contain price, product-name, and whole-sale-price. Additionally, add a key product-id with aexisting id as a value if u want to update existing variant or give new id as a value to add new product varient.
attributes
optional
string
The attribute must contain business-volume, points, and, cumulative-volume.
Response
200: OK
​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 which is under external-api-product.

Additionally, add a key product-id with a existing id as a value if you want to update the existing varient. Give new id as a value of product-id 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-id":<product_id>},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-id":<product_id>}],
"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-id":<product_id>},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-id":<product_id>}],
"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-id":<product_id>},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-id":<product_id>}],
"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-id.

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

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.
Request
Response
Request
Headers
apikey
required
string
apikey
Authorization
required
string
Bearer access token
Query Parameters
bundle_id
required
string
Bundle id
Response
200: OK
​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.
Request
Response
Request
Headers
apikey
required
string
apikey
Authorization
required
string
Bearer access token
Query Parameters
bundle_id
required
string
Bundle id
product_id
required
string
Product id.
Response
200: OK
​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_id

This field is required.

This field may not be blank.

Product id 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.
Request
Response
Request
Headers
apikey
required
string
apikey
Authorization
required
string
Bearer access token
Query Parameters
offset
optional
string
​
limit
optional
string
​
name
optional
string
Product Bundle name
category
optional
string
Product type
Response
200: OK
​HTTP/1.1 200 OK
Content-Type: application/json
​
Body:
{
"status_code": 200,
"errors": {},
"data": {
"results": [
{
"id": <product_id>,
"title": "<product_name>",
"sku": "<product_sku>",
"product_type": {
"id": <product_type_id>,
"name": "<product_type_name>",
"slug": "<produt_type_slug>"
},
"bundle_id": {
"id": <bundli_id>,
"name": "<bundli_name>",
"slug": "<bundle_slug>"
},
"status": <product_active_status>,
"created": "<created_date>",
"base_price": "<product_price>"
}
...
],
"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.
Request
Response
Request
Headers
apikey
required
string
Apikey
Authorization
required
string
Bearer access token
Response
200: OK
​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-id":"<product_id>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-id":"<product_id>"}],
"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-id":"<product_id>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-id":"<product_id>"}],
"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-id":"<product_id>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-id":"<product_id>"}],
"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-id":"<product_id>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-id":"<product_id>"}],
"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-id":"<product_id>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-id":"<product_id>"}],
"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-id":"<product_id>"},{"price":<product_price>,"product-name":"<product_name>","whole-sale-price":<whole_sale_price>,"product-id":"<product_id>"}],
"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.
Request
Response
Request
Headers
apikey
required
string
Apikey
Authorization
required
string
Bearer access token
Response
200: OK
​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;

​

​