Product Attribute

Manage product attributes

Create attribute

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

This endpoint will help to create a new attribute to the system

Headers

Name
Type
Description

apikey*

string

apikey

Authorization*

string

Bearer access token

Request Body

Name
Type
Description

name*

dict

Attribute name, eg: {"en":"<name>"}

description*

dict

Attribute description, eg:{"en":"<description>"}

data_type*

string

Data type, possible values are String, Integer, Float, and Boolean.

widget*

string

Supported widgets are select_box, radio_button, color_box, textfield, textarea, and datepicker.

options*

array

contains at least one dict with the following keys

{"status": <boolean>,"label":"<string>","value":"<string>","weight":<integer>}

is_unique

boolean

is_display

boolean

is_required

boolean

attribute_for

string

general or varients

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

Sample Code

Node

PHP

Error Responses

Status Code

Error Type

Field

Description

400

Validation Error

name

Name for {language code} language is required.

400

Validation Error

description

Description for {language code} langauge is required.

400

Validation Error

widget

{widget name} is not a valid choice. Supported widgets are {widgets}.

400

Validation Error

widget

{widget name} is not a valid choice. Supported widgets for data type {data type} is/are {widget/widgets}.

400

Validation Error

data_type

{data_type} is not a valid choice. Supported data types are {data}.

400

Validation Error

widget

{widget} widget can't be selected for an {data_type} data type.

400

Validation Error

options

The selected widget-data_type attribute doesn't support any options. leave it as empty or no need to mention.

400

Validation Error

options

This field is required.

400

Validation Error

name

All languages of names must have a description of the corresponding language.

List Attributes

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

This endpoint will return list of available product attributes

Query Parameters

Name
Type
Description

en_name

string

English name

Headers

Name
Type
Description

apikey*

string

apikey

Authorization*

string

Bearer access token

Sample Node

Node

PHP

Get A Attribute

GET ‎https://<domain>/<api prefix>/<version>/commerce/product/get/attribute/<attribute id>/

This endpoint will return a single attribute details

Headers

Name
Type
Description

apikey*

string

apikey

Aurthorization*

string

Bearer access token

Sample code

Node

PHP

Delete Attribute

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

This endpoint will help to delete a product attribute from the system.

Headers

Name
Type
Description

apikey*

string

apikey

Authorization*

string

Bearer access token

Sample code

Node

PHP

Update Attribute

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

This endpoint will help to edit a product attribute details.

Headers

Name
Type
Description

apikey*

string

apikey

Authorization*

string

Bearer access token

Request Body

Name
Type
Description

String

Same as create attribute

Sample code

Node

PHP

Last updated

Was this helpful?