List All Customers

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

Returns a paginated list of customers 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/customers/' \
-H 'Authorization: Bearer SECRET_KEY'
<?php

$curl = curl_init();

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

Sample Response

{
  "status":true,
  "message":"Customer records found",
  "data":[
    {
      "id":"2",
      "name":"Freddy Joe",
      "email":"[email protected]",
      "phone":"1234567890",
      "deposit_amount":"1100.0000",
      "award_points":"205"
    }
  ],
  "metadata":{
    "limit":50,
    "start":1,
    "total":1
  }
}
{
    "status": false,
    "message": "Customer records not found"
}

Fetch a Single Customer

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

Returns details of a customer with the given ID.

Header

Authorization
String
Set value to Bearer SECRET_KEY
id required
integer
Auto-generated unique ID
email
string
The customer’s email address.
curl -L 'https://api.vendloop.com/customers/{id}' \
-H 'Authorization: Bearer SECRET_KEY'
<?php

$curl = curl_init();

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

Sample Response

{
  "status":true,
  "message":"Customer record found",
  "data":{
    "id":"2",
    "name":"Freddy Joe",
    "email":"[email protected]",
    "phone":"1234567890",
    "deposit_amount":"1100.0000",
    "award_points":"205"
  }
}
{
    "status": false,
    "message": "Customer record not found"
}

Delete a Single Customer

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

Delete customer with the given ID.

Header

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

$curl = curl_init();

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

Sample Response

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