List All Products

get https://api.vendloop.com/products

Returns a paginated list of products sorted by id in descending order.

Header

Authorization
String
Set value to Bearer SECRET_KEY
name
string
Specify the name for this product. only products with the given name will be returned
category_id
integer
If included, only products in the given category ID will be returned
brand_id
integer
If included, only products with the given brand ID will be returned
unit_id
integer
If included, only products with the given unit ID will be returned
hidden
integer
If included, only visible or hidden products will be returned. One of: 0 or 1.
limit
integer
Specify how many records you want to retrieve per page. If not specified we use a default value of 50.
curl -L 'https://api.vendloop.com/products/' \
-H 'Authorization: Bearer SECRET_KEY'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.vendloop.com/products',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer SECRET_KEY'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer SECRET_KEY");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.vendloop.com/products", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
val client = OkHttpClient()
val request = Request.Builder()
  .url("https://api.vendloop.com/products")
  .addHeader("Authorization", "Bearer SECRET_KEY")
  .build()
val response = client.newCall(request).execute()

Sample Response

{
  "status":true,
  "message":"Product records found",
  "data":[
    {
      "id":"9",
      "sku":"5387185683651",
      "barcode_type":"ean13",
      "name":"Shoes",
      "description":"",
      "type":"standard",
      "hidden":"0",
      "unit_cost":"90.0000",
      "unit_price":"100.0000",
      "alert_quantity":"0.0000",
      "image_url":"https://app.vendloop.com/uploads/thumbs/09f171e35d717dd50ccde15227cb2534.jpg",
      "quantity":"307.0000",
      "tax_method":"addition",
      "tax":null,
      "category":{
        "id":"7",
        "name":"Footwears",
        "code":"footwear",
        "hidden":"0",
        "image_url":null
      },
      "brand":{
        "id":"7",
        "name":"Nike",
        "code":"nike",
        "image_url":null
      },
      "purchase_unit":{
        "id":"9",
        "name":"Carton",
        "code":"carton",
        "base_unit":null,
        "operator":null,
        "unit_value":null,
        "operation_value":null
      },
      "sale_unit":{
        "id":"9",
        "name":"Pairs",
        "code":"Pairs",
        "base_unit":null,
        "operator":null,
        "unit_value":null,
        "operation_value":null
      },
      "variants":[
        {
          "id":"5",
          "name":"Men's",
          "sku":"5387185683651",
          "barcode_type":"ean13",
          "unit_cost":"90.0000",
          "unit_price":"100.0000",
          "quantity":"221.0000",
          "image_url":"https://app.vendloop.com/uploads/thumbs/a7be6aa9294f9c381df94ca5b42db4e7.jpg"
        },
        {
          "id":"6",
          "name":"Women",
          "sku":"93155795",
          "barcode_type":"code128",
          "unit_cost":"90.0000",
          "unit_price":"100.0000",
          "quantity":"73.0000",
          "image_url":"https://app.vendloop.com/uploads/thumbs/0d860ba884dadeeff3e51bd6fdf2e635.jpg"
        },
        {
          "id":"7",
          "name":"Children / Red",
          "sku":"61611658",
          "barcode_type":"code128",
          "unit_cost":"90.0000",
          "unit_price":"90.0000",
          "quantity":"6.0000",
          "image_url":null
        },
        {
          "id":"8",
          "name":"Children / Green",
          "sku":"88551553",
          "barcode_type":"code128",
          "unit_cost":"70.0000",
          "unit_price":"80.0000",
          "quantity":"7.0000",
          "image_url":null
        }
      ]
    }
  ],
  "metadata":{
    "limit":50,
    "start":1,
    "total":1
  }
}
{
    "status": false,
    "message": "Product records not found"
}

Fetch a Single Product

get https://api.vendloop.com/products/{id_or_sku}

Returns details of a product with the given ID.

Header

Authorization
String
Set value to Bearer SECRET_KEY
id required
integer
Auto-generated unique ID
sku
string
Specify the sku for this product. this is ignored if the id parameter is used
name
string
Specify the name for this product. only products with the given name will be returned
category_id
integer
If included, only product in the given category ID will be returned
brand_id
integer
If included, only product with the given brand ID will be returned
unit_id
integer
If included, only product with the given unit ID will be returned
hidden
integer
If included, only visible or hidden product will be returned. One of: 0 or 1.
limit
integer
Specify how many records you want to retrieve per page. If not specified we use a default value of 50.
curl -L 'https://api.vendloop.com/products/{id_or_sku}' \
-H 'Authorization: Bearer SECRET_KEY'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.vendloop.com/products/{id_or_sku}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer SECRET_KEY'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer SECRET_KEY");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.vendloop.com/products/{id_or_sku}", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
val client = OkHttpClient()
val request = Request.Builder()
  .url("https://api.vendloop.com/products/{id_or_sku}")
  .addHeader("Authorization", "Bearer SECRET_KEY")
  .build()
val response = client.newCall(request).execute()

Sample Response

{
  "status":true,
  "message":"Product record found",
  "data":{
    "id":"9",
    "sku":"5387185683651",
    "barcode_type":"ean13",
    "name":"Shoes",
    "description":"",
    "type":"standard",
    "hidden":"0",
    "unit_cost":"90.0000",
    "unit_price":"100.0000",
    "alert_quantity":"0.0000",
    "image_url":"https://app.vendloop.com/uploads/thumbs/09f171e35d717dd50ccde15227cb2534.jpg",
    "quantity":"307.0000",
    "tax_method":"addition",
    "tax":null,
    "category":{
      "id":"7",
      "name":"Footwears",
      "code":"footwear",
      "hidden":"0",
      "image_url":null
    },
    "brand":{
      "id":"7",
      "name":"Nike",
      "code":"nike",
      "image_url":null
    },
    "purchase_unit":{
      "id":"9",
      "name":"Carton",
      "code":"carton",
      "base_unit":null,
      "operator":null,
      "unit_value":null,
      "operation_value":null
    },
    "sale_unit":{
      "id":"9",
      "name":"Pairs",
      "code":"Pairs",
      "base_unit":null,
      "operator":null,
      "unit_value":null,
      "operation_value":null
    },
    "variants":[
      {
        "id":"5",
        "name":"Men's",
        "sku":"5387185683651",
        "barcode_type":"ean13",
        "unit_cost":"90.0000",
        "unit_price":"100.0000",
        "quantity":"221.0000",
        "image_url":"https://app.vendloop.com/uploads/thumbs/a7be6aa9294f9c381df94ca5b42db4e7.jpg"
      },
      {
        "id":"6",
        "name":"Women",
        "sku":"93155795",
        "barcode_type":"code128",
        "unit_cost":"90.0000",
        "unit_price":"100.0000",
        "quantity":"73.0000",
        "image_url":"https://app.vendloop.com/uploads/thumbs/0d860ba884dadeeff3e51bd6fdf2e635.jpg"
      },
      {
        "id":"7",
        "name":"Children / Red",
        "sku":"61611658",
        "barcode_type":"code128",
        "unit_cost":"90.0000",
        "unit_price":"90.0000",
        "quantity":"6.0000",
        "image_url":null
      },
      {
        "id":"8",
        "name":"Children / Green",
        "sku":"88551553",
        "barcode_type":"code128",
        "unit_cost":"70.0000",
        "unit_price":"80.0000",
        "quantity":"7.0000",
        "image_url":null
      }
    ]
  }
}
{
    "status": false,
    "message": "Product record not found"
}

Delete a Single Product

post https://api.vendloop.com/products/delete

Delete product with the given ID.

Header

Authorization
String
Set value to Bearer SECRET_KEY
id required
integer
The ID of the product to be deleted.
curl -L 'http://api.vendloop.com/products/delete' \
-H 'Authorization: Bearer SECRET_KEY' \
-F 'id="{id_or_sku}"'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.vendloop.com/products/delete',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('id' => '{id_or_sku}'),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer SECRET_KEY'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer SECRET_KEY");

var formdata = new FormData();
formdata.append("id", "{id_or_sku}");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.vendloop.com/products/delete", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
val client = OkHttpClient()
val mediaType = "text/plain".toMediaType()
val body = MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("id","{id_or_sku}")
  .build()
val request = Request.Builder()
  .url("https://api.vendloop.com/products/delete")
  .post(body)
  .addHeader("Authorization", "Bearer SECRET_KEY")
  .build()
val response = client.newCall(request).execute()

Sample Response

{
  "status":true,
  "message":"Product record deleted"
}
{
    "status": false,
    "message": "Product record not found"
}