Update Order Commission (Marketplace Operator)
This API is used to add the associated seller to the order, reflecting any commission that the marketplace operator desires for same order. Find below the list of parameters that are needed to be sent via the API using the POST
Method to the Url:
For Staging : http://test-api.atarapay.com/api/serviceprovider/marketplaceOrder/update
For Live : https://api.atarapay.com/api/serviceprovider/marketplaceOrder/update
Field name | Required | Description |
---|---|---|
authtoken | Yes | This is calculated using the steps mentioned here Calculation of Auth Token |
commisson | Yes | This is the marketplace operator's commission that would be received at payout. The commission is represented in numeric value |
order_id | Yes | This refers to the AtaraPay Order Id created after successful payment is made into escrow for the provider's service |
Successfull Response
{
"status": "success",
"message": "Service provider and commission successfully associated with the order",
"data": {
"id": 154,
"order_id": 4198,
"sp_type": "Marketplace Service Provider",
"commission": 30,
"test": null,
"comments": null,
"created_at": "2021-06-12 17:07:01",
"updated_at": "2021-06-12 17:07:01",
"service_provider": {
"id": 120,
"is_marketplace": null,
"marketplace_child": 72,
"individual": 1,
"business_name": null,
"business_address": null,
"business_address_2": null,
"business_city": null,
"business_state": null,
"business_country": null,
"business_email": null,
"year_of_inc": null,
"cac_certificate": null,
"memorandum_of_article": null,
"company_profile": null,
"siteURL": null,
"test": "",
"comments": "",
"deleted_at": null,
"created_at": "2019-08-29 17:58:26",
"updated_at": "2019-08-29 17:58:26"
}
}
}
Failure Response
{
"status": "error",
"message": "Seller with id (1) is not associated to the marketplace operator, Please associate seller then try again"
}
Sample codes
C#
var client = new RestClient("http://test-api.atarapay.com/api/serviceprovider/marketplaceOrder/update");
var request = new RestRequest(Method.PUT);
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__&commisson=__Order_Commision__&order_id=__Order_Id__", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
PHP
$request = new HttpRequest();
$request->setUrl('http://test-api.atarapay.com/api/serviceprovider/marketplaceOrder/update');
$request->setMethod(HTTP_METH_PUT);
$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__',
'commisson' => '__Order_Commision__',
'order_id' => '__Order_Id__'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
Node Js
var unirest = require("unirest");
var req = unirest("PUT", "http://test-api.atarapay.com/api/serviceprovider/marketplaceOrder/update");
req.headers({
"cache-control": "no-cache",
"content-type": "application/x-www-form-urlencoded"
});
req.form({
"authtoken": "__Auth_token_calculated__",
"commisson": "__Order_Commision__",
"order_id": "__Order_Id__"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});