AtaraPay Docs

AtaraPay Docs

  • Integration
  • API Reference

›Payouts

Integration Overview

  • Get Started
  • Ground-up Development
  • Framework Development

Authentication

  • Calculation of Auth Token

Payment Plugin

  • Inline Integration
  • Standard Integration
  • Go Live

eCommerce Plugin

  • WooCommerce Payment Plugin
  • Magento Payment Extension
  • Shopify Payment Plugin

Payouts

  • Service Provider API
  • Create Service Provider
  • Get Service Provider
  • Delete Service Provider
  • Update Order Commission (Business Seller)
  • Update Order Commission (Marketplace Operator)

Milestone Payments

  • Overview
  • Create Project
  • Update Project
  • Get Project

Order Status Automation

  • Overview
  • Delivery Completed API.
  • Seller Cancels Order API
  • Buyer Cancels Order API
  • Order Status API

Order Notification

  • Overview
  • Delivery Complete Notification
  • Buyer Accepts Order Notification
  • Buyer Rejects Order Notification
  • Buyer Cancels Order Notification
  • Buyer Cancels Disputed Order Notification
  • Seller Cancels Order Notification
  • Seller Cancels Disputed Order Notification
  • Second Delivery Attempt Notification
  • Generation of Security Token

Resources

  • Status Definition
  • Get Bank Details
  • Marketplace Integration
  • Product Features List

Update Order Commission (Business Seller)

This API is used to add the Service Provider to the order, reflecting any commission that the seller 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/order/update
For Live : https://api.atarapay.com/api/serviceprovider/order/update
Field nameRequiredDescription
authtokenYesThis is calculated using the steps mentioned here Calculation of Auth Token
commissonYesThis is the seller's commission that would be received at payout. The commission is represented in numeric value
sp_idYesThis is the Service Provider Id that is generated when a Service Provider is created
order_idYesThis 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": 66,
            "order_id": 2400,
            "commisson": 50,
            "created_at": "2020-02-24 21:59:53",
            "updated_at": "2020-02-24 21:59:53",
            "service_provider": {
                "id": 4,
                "firstname": "Emeka",
                "lastname": "Adeniyi",
                "phone": "+2348082094382",
                "email": "emeka.adeniyi@atarapay.com",
                "bank_code": "221",
                "nip_bank_code": "000000",
                "bank_name": "Axis",
                "bank_account_name": "Emeka Adeniyi",
                "bank_account_number": "1234567890",
                "recipient_code": "",
                "created_at": "2020-02-20 16:54:01",
                "updated_at": "2020-02-24 21:58:24"
            }
        }
    ]
}

Failure Response

{
    "status": "error",
    "message": "Service Provider with id (1) does not exist, Please add Service Provider then try"
}

Sample codes

C#

var client = new RestClient("http://test-api.atarapay.com/api/serviceprovider/order/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__&sp_id=__Service_Provider_Id__&order_id=__Order_Id__", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

PHP

$request = new HttpRequest();
$request->setUrl('http://test-api.atarapay.com/api/serviceprovider/order/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__',
  'sp_id' => '__Service_Provider_Id__',
  '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/order/update");

req.headers({
  "cache-control": "no-cache",
  "content-type": "application/x-www-form-urlencoded"
});

req.form({
  "authtoken": "__Auth_token_calculated__",
  "commisson": "__Order_Commision__",
  "sp_id": "__Service_Provider_Id__",
  "order_id": "__Order_Id__"
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
← Delete Service ProviderUpdate Order Commission (Marketplace Operator) →
Docs
IntegrationeCommerce PluginsAPI ReferenceAtaraPay
Other Links
About UsFrequently Asked QuestionsReport a Bug
Merchants
BenefitsOur Merchants
Follow @atarapayonline
AtaraPay
Copyright © 2024 AtaraPay