AtaraPay Docs

AtaraPay Docs

  • Integration
  • API Reference

›Order Status Automation

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

Delivery Completed API

This API is used to automatically mark the order as delivered on AtaraPay when the seller delivers the order from the eCommerce or delivery app which causes email/ SMS notification to be sent to the buyer to accept or reject same.

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/callback/order
for live: https://api.atarapay.com/api/api/callback/order
Field nameRequiredDescription
authtokenYesThis is calculated using the steps mentioned here Calculation of Auth Token
orderYesThis is Order Number from AtaraPay
statusYesThis is the status to be marked. Pass the value as delivered
emailOptionalEmail address of the buyer
phone_numberYesPhone number of the buyer

Successfull Response

{
    "status": "success",
    "message": "pod_created",
    "data": {
        "phone": "+2348082094382",
        "email": "emeka.adeniyi@atarapay.com",
        "order": "3021"
    }
}

Failure Response

{
    "status": "error",
    "message": "Invalid request to Process, Order has been already Processed"
}

Sample codes

C#

var client = new RestClient("http://test-api.atarapay.com/api/callback/order");
var request = new RestRequest(Method.POST);
request.AddHeader("postman-token", "7eb16eb4-c395-7477-de57-1723ea02f1c6");
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__&order=__Order_NO__&status=delivered&phone_number=__Buyer_Phone_Number__&email=__Buyer_Email__", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://test-api.atarapay.com/api/callback/order",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "authtoken=__AUTH_TOKEN_CALCULATED__&order=__Order_NO__&status=delivered&phone_number=__Buyer_Phone_Number__&email=__Buyer_Email__",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded",
    "postman-token: 147f6e58-9642-81aa-fc66-e301fd7713a9"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Node Js

var unirest = require("unirest");

var req = unirest("POST", "http://test-api.atarapay.com/api/callback/order");

req.headers({
  "postman-token": "43b9ee82-e77d-f0ee-645d-e658b86ad0ef",
  "cache-control": "no-cache",
  "content-type": "application/x-www-form-urlencoded"
});

req.form({
  "authtoken": "__AUTH_TOKEN_CALCULATED__",
  "order": "__Order_NO__",
  "status": "delivered",
  "phone_number":"__Buyer_Phone_Number__",
  "email": "__Buyer_Email__"
});

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

  console.log(res.body);
});

Possible Error Message

Error MessageField namePossible Reason
Invalid authtoken. Does not match any record.authtokenThe authtoken is not correctly calculated. Please refer here to the steps Calculation of Auth Token.
No such order exists for the seller.orderThe order number sent does not belong to the seller associated with the calculated authtoken
Invalid status sent.statusThis field accepts only the following values delivered,cancelled,buyer_cancel,order. Any other value passed would generate the error.
Invalid action. This request has already been processedorderThe order Id passed has been processed earlier.
← OverviewSeller Cancels Order API →
Docs
IntegrationeCommerce PluginsAPI ReferenceAtaraPay
Other Links
About UsFrequently Asked QuestionsReport a Bug
Merchants
BenefitsOur Merchants
Follow @atarapayonline
AtaraPay
Copyright © 2024 AtaraPay