Delete Service Provider
This API is used to delete the Service Provider associated with the seller. Below are the Fields that are to be sent via API using the POST
Method to the Url:
For Staging : http://test-api.atarapay.com/api/serviceprovider/delete
For Live : https://api.atarapay.com/api/serviceprovider/delete
Field name | Required | Description |
---|---|---|
authtoken | Yes | This is calculated using the steps mentioned here Calculation of Auth Token |
sp_id | Yes | This is the Service Provider Id that was generated when using the Create Service Provider |
Successfull Response
{
"status": "success",
"message": "Service Provider Deleted successfully",
"data": [
{
"id": 1,
"firstname": "Emeka",
"lastname": "Adeniyi",
"phone": "+2348082094382",
"email": "emeka.adeniyi@atarapay.com",
"bank_code": "221",
"nip_bank_code": "000000",
"bank_name": "Axis Bank",
"bank_account_name": "Emeka Adeniyi",
"bank_account_number": "1234567890",
"recipient_code": "",
"created_at": "2020-02-10 17:53:01",
"updated_at": "2020-02-24 21:19:09"
}
]
}
Failure Response
{
"status": "error",
"message": "The authtoken field is required."
}
Sample codes
C#
var client = new RestClient("http://test-api.atarapay.com/api/serviceprovider/delete");
var request = new RestRequest(Method.DELETE);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "authtoken=__Auth_token_calculated__&sp_id=__Service_Provider_Id__", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
PHP
$request = new HttpRequest();
$request->setUrl('http://test-api.atarapay.com/api/serviceprovider/delete');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders(array(
'cache-control' => 'no-cache',
'content-type' => 'application/x-www-form-urlencoded'
));
$request->setContentType('application/x-www-form-urlencoded');
$request->setPostFields(array(
'authtoken' => '__Auth_token_calculated__',
'sp_id' => '__Service_Provider_Id__'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
Node Js
var unirest = require("unirest");
var req = unirest("DELETE", "http://test-api.atarapay.com/api/serviceprovider/delete");
req.headers({
"postman-token": "213c8b13-9b83-f314-7ae5-32a3dd7ee7b8",
"cache-control": "no-cache",
"content-type": "application/x-www-form-urlencoded"
});
req.form({
"authtoken": "__Auth_token_calculated__",
"sp_id": "__Service_Provider_Id__"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});