List All Price Groups

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

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

Header

Authorization
String
Set value to Bearer SECRET_KEY
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/price_groups/' \
-H 'Authorization: Bearer SECRET_KEY'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.vendloop.com/price_groups',
  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/price_groups", 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/price_groups")
  .addHeader("Authorization", "Bearer SECRET_KEY")
  .build()
val response = client.newCall(request).execute()

Sample Response

{
  "status":true,
  "message":"Price groups found",
  "data":[
    {
      "id":"1",
      "name":"VIP",
      "product_prices":[
        {
          "id":"1",
          "product_id":"11",
          "unit_price":"100.0000",
          "name":"WAC Test",
          "sku":"15366966"
        },
        {
          "id":"2",
          "product_id":"26",
          "unit_price":"100.0000",
          "name":"Apple",
          "sku":"16132561"
        },
        {
          "id":"3",
          "product_id":"4",
          "unit_price":"100.0000",
          "name":"Bottle Water",
          "sku":"16216661"
        }
      ]
    }
  ],
  "metadata":{
    "limit":50,
    "start":1,
    "total":1
  }
}
{
  "status": false,
  "message": "Price group not found"
}

Fetch a Single Price Group

get https://api.vendloop.com/price_groups/{id}

Returns details of a price group with the given ID.

Header

Authorization
String
Set value to Bearer SECRET_KEY
id required
integer
Auto-generated unique ID
curl -L 'https://api.vendloop.com/price_groups/{id}' \
-H 'Authorization: Bearer SECRET_KEY'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.vendloop.com/price_groups/{id}',
  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/price_groups/{id}", 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/price_groups/{id}")
  .addHeader("Authorization", "Bearer SECRET_KEY")
  .build()
val response = client.newCall(request).execute()

Sample Response

{
  "status":true,
  "message":"Price group found",
  "data":{
    "id":"1",
    "name":"VIP",
    "product_prices":[
      {
        "id":"1",
        "product_id":"11",
        "unit_price":"100.0000",
        "name":"WAC Test",
        "sku":"15366966"
      },
      {
        "id":"2",
        "product_id":"26",
        "unit_price":"100.0000",
        "name":"Apple",
        "sku":"16132561"
      },
      {
        "id":"3",
        "product_id":"4",
        "unit_price":"100.0000",
        "name":"Bottle Water",
        "sku":"16216661"
      }
    ]
  }
}
{
    "status": false,
    "message": "Price group not found"
}

Delete a Single Price Group

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

Delete price group with the given ID.

Header

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

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.vendloop.com/price_groups/delete',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('id' => '{id}'),
  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}");

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

fetch("https://api.vendloop.com/price_groups/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}")
  .build()
val request = Request.Builder()
  .url("https://api.vendloop.com/price_groups/delete")
  .post(body)
  .addHeader("Authorization", "Bearer SECRET_KEY")
  .build()
val response = client.newCall(request).execute()

Sample Response

{
  "status":true,
  "message":"Price group deleted"
}
{
  "status": false,
  "message": "Price group not found"
}