JSON API » products » products/get

Gets the fields of a product.

Input parameters

Normally requires authentication and the administrator role privilege if getting a product available to purchase, else the commerce role privilege. If called without authentication, only the information field is returned.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.RecommendedNone.
auth_passwordStringAuthentication password.RecommendedNone.
idIntegerID of product to get.Yes

Responses

ProductDescription
200Success.
402Your role does not allow this.
404The product does not exist, or you do not have permission to view it.

Data returned

Fields of product.

Example: With required and recommended parameters

http://enswitch.example.com/api/json/products/get/?auth_username=user;auth_password=password;id=123

{ "responses":[ { "product":200, "key":"", "message":"OK" } ], "data":{ "id":123, "name":"example", ... } }

Change history

VersionChanges
3.13Function added.