AtaraPay Docs

AtaraPay Docs

  • Integration
  • API Reference

›Payment Plugin

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

Standard Integration

2. Standard Integration

Form Data Configuration

When integrating for staging/test environments please use the url specified for staging and use the live URL when integrating for production/live. The URL should be specified as the form action attribute.

  • Staging URL: http://pay.staging.atarapay.com
  • Live URL: https://pay.atarapay.com

Making a request call

A request can be made directly from a web form or mobile application using a webview to initialize a payment for an order, for testing you can make a request using the CURL script below:

  • The authorization type is Bearer and my_public_key should be replaced with the Public Key found in your seller dashboard at API > API Keys > Public Key
  • The order details are to be specified in your form specified as the name of each value or sent as www-form-encoded
  • The currency value should either be NGN for Nigerian Naira or USD for United State Dollars

Mobile App Integration

Webview is required for mobile app implementations, this can be obtained by using Webview plugin or package from package managers or importing it directly from the mobile SDK library depending on the framework or language.

CURL Request for testing

curl -X POST -H "Authorization: Bearer my-public-key" 
-F "email=customer_email"
-F "phone_number=customer_phone" 
-F "amount=amount" 
-F  "http://pay.staging.atarapay.com"

Required Parameters and expected values

Parameters:

'token' => 'required',
'email' => 'required|email',
'phone_number' => 'required|numeric',
'currency' => 'required|max:3|in:NGN,USD',
'amount' => 'required', _amount in kobo_
'amount_fx' => 'required_if_currency=USD',
'customer_firstname' => 'required',
'customer_lastname' => 'required',
'order_product_id' => 'required|numeric',
'order_product_name' => 'required',
'order_product_desc' => 'optional',
'order_product_dimension'=> 'nullable',
'order_product_quantity'=> 'nullable'
'order_product_weight'=> 'nullable',
'delivery_date' => 'required',
'delivery_location' => 'required',
'recipient' => 'required|phone_number',
'alt_recipient' => 'required|phone_number,
'type' => 'required', _set as 1_,
'is_marketplace' => 'optional|numeric|default:0',
'seller_phone' => 'required_if:is_marketplace=1|phone',
'sp_id' => 'optional|numeric',
'sp_commission' => 'optional|numeric',
'callback_url' => 'required|url'
'product_type' => 'required'
Field nameRequiredDescription
tokenYesYour public key obtain from your Atarapay dashboard
emailYesEmail Address of the customer
phone_numberYesPhone Number of the customer
currencyYesTransaction Currency (NGN or USD)
amountYesAmount in kobo
amount_fxYesAmount converted to USD (required if currency is USD)
customer_firstnameYesCustomer's First name
customer_lastnameYesCustomer's Last name
order_product_idYesThe seller's product ID
order_product_nameYesThe seller's product name
order_product_descOptionalThe seller's product Description
delivery_dateYesThe seller's delivery date
delivery_locationYesThe customer's delivery location
recipientYesThe phone number of the customer
alt_recipientOptionalPhone number of someone else to receive the order that is not the customer
typeYesTransaction type (Always set to 1)
is_marketplaceOptionalset to 1 if the merchant is registered as a Marketplace Operator on Atarapay's platform
seller_phoneYesThe AtaraPay phone number of the merchant's service provider that is registered with AtaraPay (if is_marketplace = 1)
sp_idOptionalService Provider ID associated to a seller
sp_commissionOptionalService Provider Commission for a transaction
callback_urlYesThis is the Callback link provided by you to receive response and status from AtaraPay.
order_product_dimensionYesProduct dimension of the item. The format is Lenght x Width x Height in centimeters (cm). Note that AtaraPay only supports one item type in the cart.
product_typeNoProduct type value should be ‘physical’ or ‘virtual’. A physical product is one that is shippable and has weight and dimensions like a pair of shoes. A virtual is one that is not shippable and doesn’t have weight and dimension like website development.
order_product_weightNoProduct weight of the item in kilograms (kg)

Request Payload Example

{
  "token":"your-public-key",
  "amount": 110075,
  "amount_fx": "1100.75",
  "callback_url": "http://woocommerce.atarapay.com/wc-api/at_wc_atara_gateway",
  "currency": "NGN",
  "customer_firstname": "Ogundele",
  "customer_lastname": "Damilare",
  "delivery_date": "2022-09-23 12:21:54",
  "delivery_location": "Bosso Ile-eja Akoko North East Akoko North East NG ",
  "email": "iconcept573@gmail.com",
  "order_product_desc": "Samsung Galaxy Tab",
  "order_product_id": "7441",
  "order_product_name": "Samsung Galaxy Tab S3 SM-T825 - 9.7 Inch, 32GB, 4GB, 4G LTE, Silver With S Pen",
  "order_product_weight": 1,
  "order_product_quantity": 1,
  "order_product_dimension": '1 x 2 x 4cm',
  "product_type": "physical",
  "phone_number": "+2348111904455",
  "platform": "Woocommerce",
  "recipient": "+2348111904455",
  "sp_commission": "null",
  "sp_id": "null"
  "type": 1
}

Marketplace Seller Option

If you are registered as a Marketplace Operator, please set the is_marketplace parameter to 1 and seller_phone parameter to thephone number of a valid atarapay seller account on your store, but if you are registered as a Business Seller, you can leave the is_marketplace parameter as 0 and set seller_phone to null.

Your marketplace app can be integrated to AtaraPay by registering with either the Marketplace Operator or Business Seller role. For details on the differences they offer, click here.

Expected Response

The response is an html template that is to be consumed in a webview and we would take it up from there. 😊🚀 Click click here to view simulation of the buyer journey.

Figure 6

Error Response Format

If API request fails you should get an error response in the format below.

Error Response:

{
  "currency is required",
  "amount is required",
  "amount_fx is required",
  "customer_firstname is required",
  "customer_lastname is required",
  "customer_email is required",
  "customer_phone is required",
  "order_product_id is required",
  "order_product_name is required",
  "order_product_desc is required",
  "recipient is required",
  "delivery_date is required",
  "delivery_location is required",
  "is_marketplace is required",
  "seller_phone is required",
  "callback_url is required"
  "delivery_type is required"
}

Successful Payment Response

After the customer makes a payment, they will automatically be redirected to the callback URL provided by you. In addition to the provided callback URL, you will receive the AtaraPay order ID and Product ID specified in the POST request. You can then get the order details from the the order ID via the api click here.

Contact Us

For further details or bug report please contact our support team at support@atarapay.com or you can visit our website at www.atarapay.com and start a LIVE CHAT.

← Inline IntegrationGo Live →
  • 2. Standard Integration
    • Form Data Configuration
    • Making a request call
    • Mobile App Integration
    • CURL Request for testing
    • Required Parameters and expected values
    • Marketplace Seller Option
    • Expected Response
    • Error Response Format
    • Successful Payment Response
  • Contact Us
Docs
IntegrationeCommerce PluginsAPI ReferenceAtaraPay
Other Links
About UsFrequently Asked QuestionsReport a Bug
Merchants
BenefitsOur Merchants
Follow @atarapayonline
AtaraPay
Copyright © 2024 AtaraPay