Returns a paginated list of taxes sorted by id
in descending order.
List All Taxes
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/taxes/' \ -H 'Authorization: Bearer SECRET_KEY'
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api.vendloop.com/taxes', 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/taxes", 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/taxes") .addHeader("Authorization", "Bearer SECRET_KEY") .build() val response = client.newCall(request).execute()
Sample Response
{ "status":true, "message":"Tax records found", "data":[ { "code":"vat10", "id":"2", "name":"VAT @10%", "rate":"10.0000", "type":"percent" }, { "code":"vat5", "id":"1", "name":"VAT @5%", "rate":"5.0000", "type":"percent" } ], "metadata":{ "limit":50, "start":1, "total":2 } }
{ "status": false, "message": "Tax records not found" }
Fetch a Single Tax
Returns details of a tax with the given ID.
Header
Authorization String |
Set value to Bearer SECRET_KEY |
id required integer |
Auto-generated unique ID |
code string |
Specify the code for this tax. this is ignored if the id parameter is used |
curl -L 'https://api.vendloop.com/taxes/{id_or_code}' \ -H 'Authorization: Bearer SECRET_KEY'
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api.vendloop.com/taxes/{id_or_code}', 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/taxes/{id_or_code}", 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/taxes/{id_or_code}") .addHeader("Authorization", "Bearer SECRET_KEY") .build() val response = client.newCall(request).execute()
Sample Response
{ "status":true, "message":"Tax record found", "data":{ "code":"vat10", "id":"2", "name":"VAT @10%", "rate":"10.0000", "type":"percent" } }
{ "status": false, "message": "Tax record not found" }
Delete a Single Tax
Delete tax with the given ID.
Header
Authorization String |
Set value to Bearer SECRET_KEY |
id required integer |
The ID of the tax to be deleted. |
curl -L 'http://api.vendloop.com/taxes/delete' \ -H 'Authorization: Bearer SECRET_KEY' \ -F 'id="{id}"'
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api.vendloop.com/taxes/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/taxes/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/taxes/delete") .post(body) .addHeader("Authorization", "Bearer SECRET_KEY") .build() val response = client.newCall(request).execute()
Sample Response
{ "status":true, "message":"Tax record deleted" }
{ "status": false, "message": "Tax record not found" }