NAV
cURL PHP Python Java .NET Node Ruby

Introduction

Payabbhi provides language bindings in PHP, Python,
Java, .Net, NodeJS, Ruby and growing list of programming
languages in the form of Client Libraries.

Code examples can be viewed in the right panel by
switching to the programming language of your choice
by clicking on the tabs.

API Endpoint

https://payabbhi.com/api/v1

The Payabbhi API is built around the principles of HTTP and REST. The API has clean, resource-oriented URLs. JSON is used as the marshalling format for API responses which includes errors. HTTP status codes are used to represent API errors. The API strictly adheres to the principles of REST and uses HTTP verbs to denote the operations supported by the API.

To make it easy for developers to try out our APIs, the accounts provide separate set of test mode and live mode API keys. Using the appropriate set of keys directs the API calls to the respective environment. All API calls hitting the test environment are short-circuited and do not reach the banks or processors and therefore do not result in real movement of money. The API keys can be managed via the Developer Portal.

Authentication

Payabbhi performs API authentication via HTTP Basic Auth using Access ID as username and Secret Key as password. These keys are managed from the Portal. The Secret Key determines the privileges associated with your account and is similar to a password in that respect. Therefore the Secret Key should be kept confidential. It should not be shared in client-side code or any other location where it becomes publicly accessible.

Payabbhi Client Libraries wrap the details of the API authentication mechanism and make it simpler to call the API.

Payabbhi API supports only HTTPS requests. API calls made over plain HTTP will therefore fail.

$ curl -u access_id:secret_key \
	https://payabbhi.com/api/v1/payments/pay_mUy6UYsRvIxH9Qi2
$client = new \Payabbhi\Client('access_id', 'secret_key');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
import com.payabbhi.Payabbhi;
Payabbhi.accessId =  "access_id";
Payabbhi.secretKey = "secret_key";
using Payabbhi;
var client = new Client("accessId", "secretKey");
const payabbhi = require('payabbhi')('access_id', 'secret_key');
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'

Errors

The Payabbhi API attempts to return the appropriate HTTP status code for every API request to indicate success or failure.

HTTP Status Code Summary

HTTP Status Code     Description
200 - OK Worked as expected.
400 - Bad Request Invalid API request due to omitted required field or invalid field value etc. 1
401 - Unauthorized Authentication Error. Access ID or Secret Key is invalid.
404 - Not Found The requested resource does not exist.
5xx - Server Errors gateway_error or api_error.

Error Response

The Payabbhi API returns JSON with an error type and message in case of any error during the request. In case the error is caused by a field, the field name is specified in the error response.

Normal error response

com.payabbhi.exception.GatewayException JSON :
{
  "error": {
    "type": "gateway_error",
    "message": "The gateway request timed out",
    "field": null
  }
}

Error response due to invalid field

com.payabbhi.model.InvalidRequestException JSON :
{
  "error": {
    "type": "invalid_request_error",
    "message": "The amount is invalid",
    "field": "amount"
  }
}

ATTRIBUTES

type string
Refer to Error Types. This maps to Exception classes in Client Libraries where applicable.
message string
A verbose message providing details of the error
field string
Contains the field name when the error is related to a specific field

Error Types

Type                                  Meaning
invalid_request_error Invalid API request. Check details in message attribute for correcting the request.
authentication_error Access ID or Secret Key is invalid.
gateway_error Error due to back-end PSP or Gateway. Additional details in message attribute.
api_error Something unexpected took place on Payabbhi side.

Handling Errors

<?php
try {
  // Use Payabbhi's library to make requests...
} catch(\Payabbhi\Error\InvalidRequest $e) {
  // Invalid API request due to omitted required field or
  // invalid field value etc
  print('HTTP Status is:' . $e->getHttpStatus() . "\n");
  print('Error Description is:' . $e->getDescription() . "\n");
  print('Error Field is:' . $e->getField() . "\n");
} catch (\Payabbhi\Error\Authentication $e) {
  // Authentication error. Access ID or Secret Key is invalid.
  // (Ensure that API keys in Portal are used in the code)
} catch (\Payabbhi\Error\ApiConnection $e) {
  // Network communication with Payabbhi failed
} catch (\Payabbhi\Error\SignatureVerification $e) {
  // The payment signature did not pass verification check.
} catch (\Payabbhi\Error\Gateway $e) {
  // Error due to back-end PSP or Gateway.
} catch (\Payabbhi\Error\Api $e) {
  // Something unexpected took place on Payabbhi side.
} catch (\Payabbhi\Error\Base $e) {
  // Generic error raised by Payabbhi library.
} catch (Exception $e) {
  // Catch-all Exception not related to Payabbhi Library.
}
try:
  # Use Payabbhi's library to make requests...
  pass
except payabbhi.error.InvalidRequestError as e:
  # Invalid API request due to omitted required field or
  # invalid field value etc
  print "HTTP Status is: %s" % e.http_status
  print "Error Description is: %s" % e.description
  print "Error Field is: %s" % e.field
except payabbhi.error.AuthenticationError as e:
  # Authentication error. Access ID or Secret Key is invalid.
  # (Ensure that API keys in Portal are used in the code)
  pass
except payabbhi.error.APIConnectionError as e:
  # Network communication with Payabbhi failed
  pass
except payabbhi.error.SignatureVerificationError as e:
  # The payment signature did not pass verification check.
  pass
except payabbhi.error.GatewayError as e:
  # Error due to back-end PSP or Gateway.
  pass
except payabbhi.error.APIError as e:
  # Something unexpected took place on Payabbhi side.
  pass   
except payabbhi.error.PayabbhiError as e:
  # Generic error raised by Payabbhi library.
  pass  
except Exception as e:
  # Catch-all Exception not related to Payabbhi Library.
  pass
try {
  // Use Payabbhi's library to make requests...
} catch(com.payabbhi.exception.InvalidRequestException e) {
  // Invalid API request due to omitted required field or invalid
  // field value etc
  System.out.println(e.toString());
} catch (com.payabbhi.exception.AuthenticationException e) {
  // Authentication exception. Access ID or Secret Key is invalid.
  // (Ensure that API keys in Portal are used in the code)
} catch (com.payabbhi.exception.GatewayException e) {
  // Error due to back-end PSP or Gateway.
} catch (com.payabbhi.exception.ApiException e) {
  // Generic error raised by Payabbhi library.
} catch (com.payabbhi.exception.PayabbhiException e) {
  // Generic error raised by Payabbhi library.
} catch (Exception e) {
  // Catch-all Exception not related to Payabbhi Library.
}
try {
  // Use Payabbhi's library to make requests...
} catch (Payabbhi.Error.InvalidRequestError e) {
  // Invalid API request due to omitted required field or invalid
  // field value etc.
  Console.WriteLine("HTTP Status Code is: " + e.HttpStatusCode.GetHashCode());
  Console.WriteLine("Error Description is: " + e.Description);
  Console.WriteLine("Error Field is: " + e.Field);
} catch (Payabbhi.Error.AuthenticationError e) {
  // Authentication error. Access ID or Secret Key is invalid.
  // (Ensure that API keys in Portal are used in the code).
} catch (Payabbhi.Error.ApiConnectionError e) {
  // Network communication with Payabbhi failed.
} catch (Payabbhi.Error.SignatureVerificationError e) {
  // The payment signature did not pass verification check.
} catch (Payabbhi.Error.GatewayError e) {
  // Error due to back-end PSP or Gateway.
} catch (Payabbhi.Error.ApiError e) {
  // Something unexpected took place on Payabbhi side.
} catch (Payabbhi.Error.BaseError e) {
  // Generic error raised by Payabbhi library.
} catch (Exception e) {
  // Catch-all Exception not related to Payabbhi Library.
}
// Payabbhi NodeJS Client Library API are promises. Promises
// support asynchronous style of error handling.
switch (error.type) {
  case 'InvalidRequestError':
    // Invalid API request due to omitted required field or invalid
    // field value etc
    print "HTTP Status is: %s" % error.statusCode
    print "Error Description is: %s" % error.stack
    print "Error Message is: %s" % error.message
    break;
  case 'AuthenticationError':
    // Authentication error. Access ID or Secret Key is invalid.
    // (Ensure that API keys in Portal are used in the code)
    break;
  case 'APIConnectionError':
    // Network communication with Payabbhi failed
    break;
  case 'SignatureVerificationError':
    // The payment signature did not pass verification check.
    break;
  case 'GatewayError':
    // Error due to back-end PSP or Gateway.
    break;
  case 'APIError':
    // Something unexpected took place on Payabbhi side.
    break;
  case 'PayabbhiError':
    // Generic error raised by Payabbhi library.
    break;
  default:
    // Catch-all Exception not related to Payabbhi Library.
    break;
}

APIError

begin
  # Use Payabbhi's library to make requests...
rescue Payabbhi::InvalidRequestError => e
  # Invalid API request due to omitted required field or invalid
  # field value etc.
  puts "HTTP Status is: #{e.http_code}"
  puts "Error Description is: #{e.backtrace}"
  puts "Error Message is: #{e.message}"
rescue Payabbhi::AuthenticationError => e
  # Authentication error. Access ID or Secret Key is invalid.
  # (Ensure that API keys in Portal are used in the code)
rescue Payabbhi::APIConnectionError => e
  # Network communication with Payabbhi failed
rescue Payabbhi::SignatureVerificationError => e
  # The payment signature did not pass verification check.
rescue Payabbhi::GatewayError => e
  # Error due to back-end PSP or Gateway.
rescue Payabbhi::APIError => e
  # Something unexpected took place on Payabbhi side.
rescue Payabhhi::PayabbhiError => e
  # Generic error raised by Payabbhi library.
rescue Exception => e
  # Catch-all Exception not related to Payabbhi Library.
end

The code that makes the API request should check the HTTP Status code of the response. In case of error response, the error type and message attribute should be examined.

The Payabbhi Client libraries raise exceptions mapped to API error response where applicable. These exception classes are documented. We recommend judicious handling of all possible exceptions.

List

JSON Response:

com.payabbhi.model.PayabbhiCollection<T> JSON :
{
  "total_count": 2,
  "object": "list",
  "data": [
    {
      "id": "order_aCsXtMDdTafnDbHd",
      "object": "order",
      "amount": 1000,
      "currency": "INR",
      "merchant_order_id": "ordRefNo123456",
      "status": "created",
      "payment_attempts": 0,
      "notes": {
        "reason": "pen"
      },
      "created_at": 1495546689
    },
    {
      "id": "order_D9kQbGJAmGwJ2XMK",
      "object": "order",
      "amount": 1000,
      "currency": "INR",
      "merchant_order_id": "ordRefNo789789",
      "status": "paid",
      "payment_attempts": 1,
      "notes": null,
      "created_at": 1495546414
    }
  ]
}

Payabbhi API supports list calls to retrieve multiple resources, for example /api/v1/payments returns a list of payments and /api/v1/refunds returns a list of refunds.

List Response Format

The list APIs return multiple objects in a common List Response format.

total_count positive integer or zero
Returns the total count of objects matching the request parameters.
object string
Represents the object type which in this case is list
data array
An array of objects matching the request parameters. If no objects exist, the resulting array will be empty.

Notes

Example Request:

$ curl https://payabbhi.com/api/v1/orders \
  -u access_id:secret_key \
  -d amount=10000 \
  -d merchant_order_id=ordRefNo123456 \
  -d notes[item_count]=2 \
  -d notes[sales_channel]=website \
  -d currency=INR   
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->order->create(array('merchant_order_id' => 'ordRefNo123456',
                     'amount' => 10000,
                     'currency' => 'INR',
                     'notes' => array('item_count' => '2',
                                      'sales_channel' => 'website')));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
created_order = client.order.create(data={'amount':10000,
                                          'merchant_order_id': 'ordRefNo123456',
                                          'currency':'INR',
                                          'notes': {'item_count': '2', 'sales_channel': 'website'}
                                         })
import com.payabbhi.Payabbhi;
Payabbhi.accessId =  "access_id";
Payabbhi.secretKey = "secret_key";
Order created_order = Order.create(
              new HashMap<String, Object>() {
                {
                  put("merchant_order_id", "ordRefNo123456");
                  put("amount", 10000);
                  put("currency", "INR");
                  put("notes", new HashMap<String, Object>() {
                    {
                          put("item_count", "2");
                          put("sales_channel", "website");
                    }
                  });
                }
              });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var createdOrder = client.Order.Create(
          new Dictionary<string, object>() {
              {"merchant_order_id", "ordRefNo123456"},
              {"amount", 10000},
              {"currency", "INR"},
              {"notes", new Dictionary<string, object>(){
                    {"item_count", "2"},
                    {"sales_channel", "website"}}}});
const payabbhi = require('payabbhi')('access_id', 'secret_key');
payabbhi.orders.create({
      merchant_order_id: 'ordRefNo123456',
      amount: 10000,
      currency: 'INR',
      notes: {
        item_count: 2,
        sales_channel: 'website'
      }
    }, (error, order) => {
      // order contains created order details in JSON format.
});
require 'payabbhi'
Payabbhi.access_id= 'access_id'
Payabbhi.secret_key= 'secret_key'
order = Payabbhi::Order.create  merchant_order_id: 'ordRefNo123456',
                                currency: "INR",
                                amount: 10000,
                                notes: {
                                  item_count: 2,
                                  sales_channel: "website"
                                }

JSON Response

com.payabbhi.model.Order JSON :
{
  "id": "order_aCsXtMDdTafnDbHd",
  "object": "order",
  "amount": 10000,
  "currency": "INR",
  "merchant_order_id": "ordRefNo123456",
  "status": "created",
  "payment_attempts": 0,
  "notes": {
    "item_count": "2",
    "sales_channel": "website"
  },
  "created_at": 1495546689
}

Payabbhi API supports a metadata parameter named notes for Order, Payment, Refund etc. Notes can be useful for storing additional information about the object in a structured format. For example, you may like to store billing_address, shipping_address, item count, sales_channel etc along with the Order object. Or for Refund object, you may like to store the order cancellation date, reason etc.

notes is a set of key/value pairs. Payabbhi supports up to 15 keys, with key names up to 40 characters long and values up to 256 characters.

Pagination

The list APIs support pagination based on optional arguments like count and skip. The pagination is applied on the list of objects that matches the API request.

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/orders?count=2
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->order->all(array('count'=>2));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.order.all(data={'count': 2})
import com.payabbhi.Payabbhi;
Payabbhi.accessId =  "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Order> orders = Order.all(
  new HashMap<String, Object>() {
    {
      put("count", 2);
    }
});
using Payabbhi;
var client = new Client("accessId", "secretKey");
var orders = client.Order.All(
              new Dictionary<string, object>() {
                {"count", 2} } );
const payabbhi = require('payabbhi')('access_id', 'secret_key');
payabbhi.orders.all({ count: 2 },
  (error, orders) => {
    // orders is list of Order Objects
});
require 'payabbhi'
Payabbhi.access_id= 'access_id'
Payabbhi.secret_key= 'secret_key'
orders = Payabbhi::Order.all count: 2

JSON Response:

com.payabbhi.model.PayabbhiCollection<Order> JSON :
{
  "total_count": 2,
  "object": "list",
  "data": [
    {
      "id": "order_aCsXtMDdTafnDbHd",
      "object": "order",
      "amount": 1000,
      "currency": "INR",
      "merchant_order_id": "ordRefNo123456",
      "status": "created",
      "payment_attempts": 0,
      "notes": {
        "reason": "pen"
      },
      "created_at": 1495546689
    },
    {
      "id": "order_D9kQbGJAmGwJ2XMK",
      "object": "order",
      "amount": 1000,
      "currency": "INR",
      "merchant_order_id": "ordRefNo789789",
      "status": "paid",
      "payment_attempts": 1,
      "notes": null,
      "created_at": 1495546414
    }
  ]
}

Arguments

count default is 10
A limit on the number of objects to be returned, between 1 and 100.
skip default is 0
Represents number of objects to be skipped.

Orders

The Order Object

JSON Response

com.payabbhi.model.Order JSON :
{
  "id": "order_aCsXtMDdTafnDbHd",
  "object": "order",
  "amount": 1000,
  "currency": "INR",
  "merchant_order_id": "ordRefNo123456",
  "status": "created",
  "payment_attempts": 0,
  "notes": {
    "item_count": "2",
    "sales_channel": "website"
  },
  "created_at": 1495546689
}

ATTRIBUTES

id string
Unique identifier of order object.
object string, value is "order"
Represents the object type which in this case is order.
amount positive integer
A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00). Minimum amount is 100 paise.
currency string
Three-letter ISO currency code. Currently only INR is supported.
merchant_order_id string
The order_id or transaction_id or checkout_reference_no. etc at Merchant end which corresponds to this order.
status string
The order status is one of created, payment_attempted or paid.
payment_attempts positive integer or zero
Number of payment attempts against this Order.
notes json object
Set of key/value pairs that you can attach to an order object. It can be useful for storing additional information about the order object in a structured format.
created_at timestamp
Order creation timestamp. Measured in seconds since the Unix epoch.

Create an order

Definition

POST https://payabbhi.com/api/v1/orders
<?php
$client->order->create();
client.order.create()
Order created_order = Order.create()
client.Order.Create()
payabbhi.orders.create(
  (error, order) => {
  ...
});
Payabbhi::Order.create

Example Request:

$ curl https://payabbhi.com/api/v1/orders \
  -u access_id:secret_key \
  -d amount=10000 \
  -d merchant_order_id=ordRefNo123456 \
  -d notes[item_count]=2 \
  -d notes[sales_channel]=website \
  -d currency=INR
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->order->create(array('merchant_order_id' => 'ordRefNo123456',
                     'amount' => 10000,
                     'currency' => 'INR',
                     'notes' => array('item_count' => '2',
                                      'sales_channel' => 'website')));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
created_order = client.order.create(data={'amount': 10000,
                                          'merchant_order_id': 'ordRefNo123456',
                                          'currency': 'INR',
                                          'notes': {'item_count': '2', 'sales_channel': 'website'}
                                         })
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Order created_order = Order.create(
              new HashMap<String, Object>() {
                {
                  put("merchant_order_id", "ordRefNo123456");
                  put("amount", 10000);
                  put("currency", "INR");
                  put("notes", new HashMap<String, Object>() {
                    {
                          put("item_count", "2");
                          put("sales_channel", "website");
                    }
                  });
                }
              });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var createdOrder = client.Order.Create(
          new Dictionary<string, object>() {
              {"merchant_order_id", "ordRefNo123456"},
              {"amount", 10000},
              {"currency", "INR"},
              {"notes", new Dictionary<string, object>(){
                    {"item_count", "2"},
                    {"sales_channel", "website"}}}});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.orders.create({
      amount: 10000,
      merchant_order_id: 'ordRefNo123456',
      currency: 'INR',
      notes: {
        item_count: 2,
        sales_channel: 'website'
      }
    }, (error, order) => {
    // order contains created order details in JSON format.
});
require 'payabbhi'
Payabbhi.access_id= 'access_id'
Payabbhi.secret_key= 'secret_key'
order = Payabbhi::Order.create  merchant_order_id: 'ordRefNo123456',
                                currency: "INR",
                                amount: 10000,
                                notes: {
                                  item_count: 2,
                                  sales_channel: "website"
                                }

JSON Response

com.payabbhi.model.Order JSON :
{
  "id": "order_aCsXtMDdTafnDbHd",
  "object": "order",
  "amount": 10000,
  "currency": "INR",
  "merchant_order_id": "ordRefNo123456",
  "status": "created",
  "payment_attempts": 0,
  "notes": {
    "item_count": "2",
    "sales_channel": "website"
  },
  "created_at": 1495546689
}

Creates a new order.

ARGUMENTS

merchant_order_id
The order_id or transaction_id or checkout_reference_no. etc at Merchant end which corresponds to this order.
amount
A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00). Minimum amount is 100 paisa.
currency
Three-letter ISO currency code. Currently only INR is supported.
payment_auto_capture default is true
Bool value to specify whether the payment created against this order will get automatically captured. Currently only true is supported. If false is passed, it will be overridden to true.
notes
Set of key/value pairs that you can attach to an order object. It can be useful for storing additional information about the order object in a structured format. For example you can store the order description, order sales_channel etc

Returns

Returns the order object if order creation is successful.

List all orders

Definition

GET https://payabbhi.com/api/v1/orders
<?php
$client->order->all();
client.order.all()
PayabbhiCollection<Order> orders = Order.all();
client.Order.All()
payabbhi.orders.all(
  (error, orders) => {
    ...
});
Payabbhi::Order.all

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/orders?count=2
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->order->all(array('count'=>2));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.order.all(data={'count': 2})
import com.payabbhi.Payabbhi;
Payabbhi.accessId =  "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Order> orderCollection = Order.all(
        new HashMap<String, Object>() {
          {
            put("count", 2);
          }
        });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var orders = client.Order.All(
              new Dictionary<string, object>() {
                {"count", 2} } );
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.orders.all({ count: 2 },
  (error, orders) => {
    // orders is list of Order Objects
});
require 'payabbhi'
Payabbhi.access_id= 'access_id'
Payabbhi.secret_key= 'secret_key'
orders = Payabbhi::Order.all count: 2

JSON Response:

com.payabbhi.model.PayabbhiCollection<Order> JSON :
{
  "total_count": 2,
  "object": "list",
  "data": [
    {
      "id": "order_aCsXtMDdTafnDbHd",
      "object": "order",
      "amount": 1000,
      "currency": "INR",
      "merchant_order_id": "ordRefNo123456",
      "status": "created",
      "payment_attempts": 0,
      "notes": {
        "item_count": "2",
        "sales_channel": "website"
      },
      "created_at": 1495546689
    },
    {
      "id": "order_D9kQbGJAmGwJ2XMK",
      "object": "order",
      "amount": 1000,
      "currency": "INR",
      "merchant_order_id": "ordRefNo789789",
      "status": "paid",
      "payment_attempts": 1,
      "notes": null,
      "created_at": 1495546414
    }
  ]
}

Returns a list of orders created previously. The orders are listed in reverse chronological order, with the most recent order appearing first.

ARGUMENTS

count default is 10
A limit on the number of order objects to be returned. This can range between 1 and 100.
skip default is 0
Represents number of order objects to be skipped.
from
A filter criterion based on the created_at field of an object. Value can be a timestamp. Returns Orders created on or after this timestamp.
to
A filter criterion based on the created_at field of an object. Value can be a timestamp. Returns Orders created on or before this timestamp.
authorized boolean
If true, only those Orders should be returned for which Payments are currently in authorized status.
merchant_order_id
A filter on the order list based on the merchant_order_id field.

Returns

An object with total_count attribute containing the total count of orders matching the given request, object attribute containing list and data attribute containing an array of order objects.

Each element in the array of data attribute is a separate order object. If no orders exist, the resulting array will be empty.

You can optionally set the filter criteria to only retrieve orders that match the criteria.

Retrieve an order

Definition

GET https://payabbhi.com/api/v1/orders/{order_id}
<?php
$client->order->retrieve({order_id});
client.order.retrieve({order_id})
 Order order = Order.retrieve({order_id})
client.Order.Retrieve({order_id})
payabbhi.orders.retrieve(orderId,
  (error, order) => {
    ...
});
Payabbhi::Order.retrieve(order_id)

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/orders/order_aCsXtMDdTafnDbHd
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->order->retrieve('order_aCsXtMDdTafnDbHd');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.order.retrieve('order_aCsXtMDdTafnDbHd')
import com.payabbhi.Payabbhi;
Payabbhi.accessId =  "access_id";
Payabbhi.secretKey = "secret_key";
Order order = Order.retrieve("order_aCsXtMDdTafnDbHd");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var order = client.Order.Retrieve("order_aCsXtMDdTafnDbHd");
const payabbhi = require('payabbhi')('access_id','secret_key');

payabbhi.orders.retrieve('order_aCsXtMDdTafnDbHd',
  (error, order) => {
    // order is the Order object retrieved
});
require 'payabbhi'
Payabbhi.access_id= 'access_id'
Payabbhi.secret_key= 'secret_key'
order = Payabbhi::Order.retrieve('order_aCsXtMDdTafnDbHd')

JSON Response

com.payabbhi.model.Order JSON :
{
  "id": "order_aCsXtMDdTafnDbHd",
  "object": "order",
  "amount": 1000,
  "currency": "INR",
  "merchant_order_id": "ordRefNo123456",
  "status": "created",
  "payment_attempts": 0,
  "notes": {
    "item_count": "2",
    "sales_channel": "website"
  },
  "created_at": 1495546689
}

Returns a Order object matching the order_id. Else it returns an error response.

ARGUMENTS

order_id
The identifier of the order to be retrieved.

Returns

Returns an order object given a valid order identifier was provided, and returns an error otherwise.

List all payments for an order

Definition

GET https://payabbhi.com/api/v1/orders/{order_id}/payments
<?php
$client->order->retrieve({order_id})->payments();
client.order.retrieve({order_id}).payments()
PayabbhiCollection<Payment> paymentCollection = Order.payments({order_id})
client.Order.Retrieve({order_id}).Payments();
payabbhi.orders.payments(orderId,
  (error, payments) => {
    ...
});
Payabbhi::Order.payments(order_id)

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/orders/order_D9kQbGJAmGwJ2XMK/payments
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->order->retrieve('order_D9kQbGJAmGwJ2XMK')->payments();
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.order.retrieve('order_D9kQbGJAmGwJ2XMK').payments()
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Payment> payments=Order.payments("order_D9kQbGJAmGwJ2XMK");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var payments = client.Order.Retrieve("order_D9kQbGJAmGwJ2XMK").Payments();
const payabbhi = require('payabbhi')('access_id', 'secret_key');
payabbhi.orders.payments('order_D9kQbGJAmGwJ2XMK',
  (error, payments) => {
    // payments is list of Payment Objects associated with an order
});
require 'payabbhi'
Payabbhi.access_id= 'access_id'
Payabbhi.secret_key= 'secret_key'
payments = Payabbhi::Order.payments('order_D9kQbGJAmGwJ2XMK')

JSON Response:

com.payabbhi.model.PayabbhiCollection<Payment> JSON :
{
  "total_count": 1,
  "object": "list",
  "data": [
    {
      "id": "pay_mUy6UYsRvIxH9Qi2",
      "object": "payment",
      "amount": 1000,
      "currency": "INR",
      "status": "captured",
      "order_id": "order_D9kQbGJAmGwJ2XMK",
      "invoice_id": "",
      "international": false,
      "method": "card",
      "description": "new payment done",
      "card": "visa-debit",
      "bank": "",
      "wallet": "",
      "vpa": "",
      "customer_id": "cust_2BCT1Tvgg1gNjVPu",
      "email": "test@example.com",
      "contact": "9999999999",
      "notes": null,
      "fee": 5,
      "service_tax": 0,
      "payout_amount": 995,
      "payout_type": "Cr",
      "settled": true,
      "settlement_id": "stl_abjBUMNyLnzGbFOC",
      "refunded_amount": 600,
      "refund_status": "partial",
      "refunds": {
        "total_count": 3,
        "object": "list",
        "data": [
          {
            "id": "rfnd_02iOL6yHtrTTVYSw",
            "object": "refund",
            "amount": 200,
            "currency": "INR",
            "payment_id": "pay_mUy6UYsRvIxH9Qi2",
            "notes": {
              "item_count": "2",
              "sales_channel": "website"
            },
            "created_at": 1495554728
          },
          {
            "id": "rfnd_iqPqyu7Ds5UaC434",
            "object": "refund",
            "amount": 200,
            "currency": "INR",
            "payment_id": "pay_mUy6UYsRvIxH9Qi2",
            "notes": null,
            "created_at": 1495547054
          },
          {
            "id": "rfnd_PWrr22qRNIjAkQ9U",
            "object": "refund",
            "amount": 200,
            "currency": "INR",
            "payment_id": "pay_mUy6UYsRvIxH9Qi2",
            "notes": null,
            "created_at": 1495546589
          }
        ]
      },
      "error_code": "",
      "error_description": "",
      "created_at": 1495546415,
      "virtual_account_id": "",
      "payment_page_id": "",
      "bank_response": {},
      "commercial_card": false
    }
  ]
}

Returns a list of all payments for a given order that have previously been created. The payments are listed in reverse chronological order, with the most recent payment appearing first.

ARGUMENTS

order_id
The identifier of the order whose payments are to be retrieved.

Returns

An object with total_count attribute containing the total count of payments corresponding to the given Order, object attribute containing list and a data attribute containing an array of payment objects.

Each element in the array of data attribute is a separate payment object. If no payments exist for the Order, the resulting array will be empty.

Payments

The Payment Object

JSON Response

com.payabbhi.model.Payment JSON :
{
  "id": "pay_mUy6UYsRvIxH9Qi2",
  "object": "payment",
  "amount": 1000,
  "currency": "INR",
  "status": "captured",
  "order_id": "order_D9kQbGJAmGwJ2XMK",
  "invoice_id": "",
  "international": false,
  "method": "card",
  "description": "For online purchase of 3 Items",
  "card": "visa-debit",
  "bank": "",
  "wallet": "",
  "vpa": "",
  "customer_id": "cust_2BCT1Tvgg1gNjVPu",
  "email": "test@example.com",
  "contact": "9999999999",
  "notes": null,
  "fee": 5,
  "service_tax": 0,
  "payout_amount": 995,
  "payout_type": "",
  "settled": false,
  "settlement_id": "",
  "refunded_amount": 400,
  "refund_status": "partial",
  "refunds": {
    "total_count": 2,
    "object": "list",
    "data": [
      {
        "id": "rfnd_PWrr22qRNIjAkQ9U",
        "object": "refund",
        "amount": 200,
        "currency": "INR",
        "payment_id": "pay_mUy6UYsRvIxH9Qi2",
        "notes": {
          "reason": "order_canceled"
        },
        "created_at": 1495546589
      },
      {
        "id": "rfnd_iqPqyu7Ds5UaC434",
        "object": "refund",
        "amount": 200,
        "currency": "INR",
        "payment_id": "pay_mUy6UYsRvIxH9Qi2",
        "notes": {
          "reason": "order_canceled"
        },
        "created_at": 1495547054
      }
    ]
  },
  "error_code": "",
  "error_description": "",
  "created_at": 1495546415,
  "virtual_account_id": "",
  "payment_page_id": "",
  "bank_response": {},
  "commercial_card": false
}

ATTRIBUTES

id string
Unique identifier of Payment object.
object string, value is "payment"
Represents the object type which in this case is payment.
amount positive integer
Payment amount in paisa (e.g., 5000 paisa denotes Rs 50.00)
currency string
Three-letter ISO currency code. Currently only INR is supported.
status string
The status of the payment is either of authorized, captured, refunded or declined.
order_id string
Unique identifier of an Order object created using Payabbhi API.
invoice_id string
Unique identifier of an Invoice object created using Payabbhi API.
international boolean
It is set to true if the payment is done using an international card.
method string
Method used during payment. Currently, it can be one of card, emi, netbanking,wallet,upi or bank_account.
description string
A description field provided by the merchant while initiating Checkout.
card string
When payment method is card or emi, this will contain the card brand-card type example. visa-credit.
bank string
When payment method is card or netbanking, this will contain the bank name.
wallet string
When payment method is wallet, this will contain the wallet brand.
emijson object
When payment method is emi, this will contain tenure, provider, interest_rate and subvention of the EMI plan applicable for this payment.
vpa string
When payment method is upi, this will contain the customer vpa.
customer_id string
Unique identifier of the customer who made this payment.
email string
Payer email address.
contact string
Payer contact number.
notes json object
Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the payment object in a structured format.
fee positive integer or zero
Fee charged by us including service tax, in the smallest currency unit (paisa).
service_tax positive integer or zero
Service tax charged in the smallest currency unit (paisa).
payout_amount positive integer or zero
Amount to be settled to the Merchant, in the smallest currency unit (paisa).
payout_type string, value is either "Cr" or "Dr"
Indicates if Credit to Merchant or Debit from Merchant.
settled boolean
If true, then the payment has been settled.
settlement_id string
Unique identifier of a Settlement object against which the payment was settled.
refunded_amount positive integer
The amount refunded, in the smallest currency unit (paisa).
refund_status string
The refund status of the payment. Can be one of empty string, full or partial.
refunds list
A list of refunds that have been created for the payment.
error_code string
Error code in case of an error during payment.
error_description string
Description corresponding to the error.
created_at timestamp
Payment creation timestamp. Measured in seconds since the Unix epoch.
virtual_account_id string
Unique identifier of a Virtual Account object created using Payabbhi API.
payment_page_id string
Unique identifier of a Payment Page object created using Payabbhi API.
bank_response string
If payment by card/emi is declined by the bank and any specific error code/message is provided as a reason of decline, that will be filled in this list. Otherwise, it will remain empty.
commercial_card boolean
It is set to true if the payment is done via a commercial card.

List all payments

Definition

GET https://payabbhi.com/api/v1/payments
<?php
$client->payment->all();
client.payment.all()
PayabbhiCollection<Payment> paymentCollection = Payment.all()
client.Payment.All();
payabbhi.payments.all(
  (error, payments) => {
    ...
});
Payabbhi::Payment.all

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/payments?count=2
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->payment->all(array('count'=>2));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.payment.all(data={'count': 2})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Payment> paymentCollection = Payment.all(
    new HashMap<String, Object>() {
      {
          put("count", 2);
      }
    });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var payment = client.Payment.All(
              new Dictionary<string, object>() {
                {"count", 2} } );
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.payments.all({ count: 2 },
  (error, payments) => {
    // payments is list of Payment Objects
});
require 'payabbhi'
Payabbhi.access_id= 'access_id'
Payabbhi.secret_key= 'secret_key'
payments = Payabbhi::Payment.all count: 2

JSON Response:

com.payabbhi.model.PayabbhiCollection<Payment> JSON :
{
  "total_count": 2,
  "object": "list",
  "data": [
    {
      "id": "pay_uqkZqU61xerMBmjS",
      "object": "payment",
      "amount": 1000,
      "currency": "INR",
      "status": "authorized",
      "order_id": "order_12FO0iAWg8ZGZukb",
      "invoice_id": "",
      "international": false,
      "method": "card",
      "description": "merchant-provided description",
      "card": "visa-debit",
      "bank": "",
      "wallet": "",
      "vpa": "",
      "customer_id": "cust_2BCT1Tvgg1gNjVPu",
      "email": "test@example.com",
      "contact": "9999999999",
      "notes": null,
      "fee": 0,
      "service_tax": 0,
      "payout_amount": 0,
      "payout_type": "",
      "settled": false,
      "settlement_id": "",
      "refunded_amount": 0,
      "refund_status": "",
      "refunds": {
        "total_count": 0,
        "object": "list",
        "data": []
      },
      "error_code": "",
      "error_description": "",
      "created_at": 1495547101,
      "virtual_account_id": "",
      "payment_page_id": "",
      "bank_response": {},
      "commercial_card": false
    },
    {
      "id": "pay_mUy6UYsRvIxH9Qi2",
      "object": "payment",
      "amount": 1000,
      "currency": "INR",
      "status": "captured",
      "order_id": "order_D9kQbGJAmGwJ2XMK",
      "invoice_id": "",
      "international": false,
      "method": "card",
      "description": "merchant-provided description",
      "card": "visa-debit",
      "bank": "",
      "wallet": "",
      "vpa": "",
      "customer_id": "cust_2BCT1Tvgg1gNjVPu",
      "email": "test@example.com",
      "contact": "9999999999",
      "notes": null,
      "fee": 5,
      "service_tax": 0,
      "payout_amount": 995,
      "payout_type": "",
      "settled": true,
      "settlement_id": "stl_abjBUMNyLnzGbFOC",
      "refunded_amount": 400,
      "refund_status": "partial",
      "refunds": {
        "total_count": 2,
        "object": "list",
        "data": [
          {
            "id": "rfnd_PWrr22qRNIjAkQ9U",
            "object": "refund",
            "amount": 200,
            "currency": "INR",
            "payment_id": "pay_mUy6UYsRvIxH9Qi2",
            "notes": {
              "reason": "order_canceled"
            },
            "created_at": 1495546589
          },
          {
            "id": "rfnd_iqPqyu7Ds5UaC434",
            "object": "refund",
            "amount": 200,
            "currency": "INR",
            "payment_id": "pay_mUy6UYsRvIxH9Qi2",
            "notes": {
              "reason": "order_canceled"
            },
            "created_at": 1495547054
          }
        ]
      },
      "error_code": "",
      "error_description": "",
      "created_at": 1495546415,
      "virtual_account_id": "",
      "payment_page_id": "",
      "bank_response": {},
      "commercial_card": false
    }
  ]
}

Returns a list of payments created previously. The payments are listed in reverse chronological order, with the most recent payment appearing first.

ARGUMENTS

count default is 10
A limit on the number of payment objects to be returned. This can range between 1 and 100.
skip default is 0
Represents number of payment objects to be skipped.
from
A filter criterion based on the created_at field of the Payment object. Value can be a timestamp. Returns Payments created on or after this timestamp.
to
A filter criterion based on the created_at field of the Payment object. Value can be a timestamp. Returns Payments created on or before this timestamp.

Returns

An object with total_count attribute containing the total count of payments matching the given request, object attribute containing list and a data attribute containing an array of payment objects.

Each element in the array of data attribute is a separate payment object. If no payments exist, the resulting array will be empty.

You can optionally set the filter criteria to only retrieve Payments that match the criteria.

Retrieve a payment

Definition

GET https://payabbhi.com/api/v1/payments/{payment_id}
<?php
$client->payment->retrieve({payment_id});
client.payment.retrieve({payment_id})
Payment payment = Payment.retrieve({payment_id})
var payment = client.Payment.Retrieve({payment_id});
payabbhi.payments.retrieve({paymentId},
  (error, payment) => {
    ...
});
Payabbhi::Payment.retrieve({payment_id})

Example Request:

$ curl -u access_id:secret_key \
	https://payabbhi.com/api/v1/payments/pay_mUy6UYsRvIxH9Qi2
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->payment->retrieve('pay_mUy6UYsRvIxH9Qi2');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.payment.retrieve('pay_mUy6UYsRvIxH9Qi2')
import com.payabbhi.Payabbhi;
Payabbhi.accessId =  "access_id";
Payabbhi.secretKey = "secret_key";
Payment payment = Payment.retrieve("pay_mUy6UYsRvIxH9Qi2");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var payment = client.Payment.Retrieve("pay_mUy6UYsRvIxH9Qi2");
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.payments.retrieve('pay_mUy6UYsRvIxH9Qi2',
  (error, payment) => {
    // payment is the retrieved Payment object
});
require 'payabbhi'
Payabbhi.access_id= 'access_id'
Payabbhi.secret_key= 'secret_key'
payment = Payabbhi::Payment.retrieve('pay_mUy6UYsRvIxH9Qi2')

JSON Response

com.payabbhi.model.Payment JSON :
{
  "id": "pay_mUy6UYsRvIxH9Qi2",
  "object": "payment",
  "amount": 1000,
  "currency": "INR",
  "status": "captured",
  "order_id": "order_D9kQbGJAmGwJ2XMK",
  "invoice_id": "",
  "international": false,
  "method": "card",
  "description": "For online purchase of 3 items",
  "card": "visa-debit",
  "bank": "",
  "wallet": "",
  "vpa": "",
  "customer_id": "cust_2BCT1Tvgg1gNjVPu",
  "email": "test@example.com",
  "contact": "9999999999",
  "notes": null,
  "fee": 5,
  "service_tax": 0,
  "payout_amount": 995,
  "payout_type": "",
  "settled": true,
  "settlement_id": "stl_abjBUMNyLnzGbFOC",
  "refunded_amount": 400,
  "refund_status": "partial",
  "refunds": {
    "total_count": 2,
    "object": "list",
    "data": [
      {
        "id": "rfnd_PWrr22qRNIjAkQ9U",
        "object": "refund",
        "amount": 200,
        "currency": "INR",
        "payment_id": "pay_mUy6UYsRvIxH9Qi2",
        "notes": {
          "reason": "order_canceled"
        },
        "created_at": 1495546589
      },
      {
        "id": "rfnd_iqPqyu7Ds5UaC434",
        "object": "refund",
        "amount": 200,
        "currency": "INR",
        "payment_id": "pay_mUy6UYsRvIxH9Qi2",
        "notes": {
          "reason": "order_canceled"
        },
        "created_at": 1495547054
      }
    ]
  },
  "error_code": "",
  "error_description": "",
  "created_at": 1495546415,
  "virtual_account_id": "",
  "payment_page_id": "",
  "bank_response": {},
  "commercial_card":false
}

Returns a Payment object matching the payment_id. Else it returns an error response.

ARGUMENTS

payment_id
The identifier of the payment to be retrieved.

Returns

Returns a payment object, given a valid payment identifier was provided, and returns an error otherwise.

Capture a payment

Definition

POST https://payabbhi.com/api/v1/payments/{payment_id}/capture
<?php
$payment = $client->payment->retrieve({payment_id});
$payment->capture();
payment = client.payment.retrieve({payment_id})
payment.capture()
Payment payment = Payment.retrieve({payment_id})
payment.capture()
client.Payment.Retrieve({payment_id}).Capture();
payabbhi.payments.capture({paymentId},
  (error, payment) => {
    ...
});
Payabbhi::Payment.retrieve({payment_id}).capture

Example Request:

$ curl -u access_id:secret_key -X POST \
  https://payabbhi.com/api/v1/payments/pay_mUy6UYsRvIxH9Qi2/capture
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$payment = $client->payment->retrieve('pay_mUy6UYsRvIxH9Qi2'));
$payment->capture();
import payabbhi
client = payabbhi.Client('access_id','secret_key')
payment = client.payment.retrieve('pay_mUy6UYsRvIxH9Qi2')
payment.capture()
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Payment payment = Payment.retrieve("pay_mUy6UYsRvIxH9Qi2");
payment.capture();
using Payabbhi;
var client = new Client("accessId", "secretKey");
var payment = client.Payment.Retrieve("pay_mUy6UYsRvIxH9Qi2").Capture();
const payabbhi = require('payabbhi')('access_id', 'secret_key');
payabbhi.payments.capture('pay_mUy6UYsRvIxH9Qi2',
  (error, payment) => {
    // Response will be JSON response of type Payment which got captured.
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
payment = Payabbhi::Payment.retrieve('pay_mUy6UYsRvIxH9Qi2')
payment.capture

JSON Response

com.payabbhi.model.Payment JSON :
{
  "id": "pay_mUy6UYsRvIxH9Qi2",
  "object": "payment",
  "amount": 1000,
  "currency": "INR",
  "status": "captured",
  "order_id": "order_D9kQbGJAmGwJ2XMK",
  "invoice_id": "",
  "international": false,
  "method": "card",
  "description": "merchant-provided description",
  "card": "visa-debit",
  "bank": "",
  "wallet": "",
  "vpa": "",
  "customer_id": "cust_2BCT1Tvgg1gNjVPu",
  "email": "test@example.com",
  "contact": "9999999999",
  "notes": null,
  "fee": 0,
  "service_tax": 0,
  "payout_amount": 0,
  "payout_type": "",
  "settled": false,
  "settlement_id": "",
  "refunded_amount": 0,
  "refund_status": "",
  "refunds": {
    "total_count": 0,
    "object": "list",
    "data": []
  },
  "error_code": "",
  "error_description": "",
  "created_at": 1495546415,
  "virtual_account_id": "",
  "payment_page_id": "",
  "virtual_account_id": "",
  "payment_page_id": "",
  "bank_response": {},
  "commercial_card": false
}

Capture an existing, un-captured payment. This call is required to capture a payment that is created with an order whose payment_auto_capture option was set to false. An un-captured payment automatically expires in five working days unless captured explicitly.

ARGUMENTS

payment_id
The identifier of the payment to be captured.
amount default is the authorized amount
A positive integer in the smallest currency unit. The amount to be captured (in paisa) has to be equal to authorized amount.

Returns

Returns the payment object, with a status attribute set as captured. Capturing a payment will fail if the payment is already refunded, failed or captured and will return an error. It will also fail if the amount sent in the amount field is not equal to the authorized amount of the payment

List refunds for a given payment

Definition

GET https://payabbhi.com/api/v1/payments/{payment_id}/refunds
<?php
$client->payment->retrieve({payment_id})->refunds();
client.payment.refunds({payment_id})
PayabbhiCollection<Refund> refundCollection = Payment.refunds({payment_id})
client.Payment.Retrieve({payment_id}).GetRefunds();
payabbhi.payments.refunds({paymentId},
  (error, refunds) => {
    ...
});
Payabbhi::Payment.refunds({payment_id})

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/payments/pay_mUy6UYsRvIxH9Qi2/refunds?count=2
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->payment->retrieve('pay_mUy6UYsRvIxH9Qi2')->refunds(array('count'=>2));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.payment.refunds('pay_mUy6UYsRvIxH9Qi2', data={"count": 2})
import com.payabbhi.Payabbhi;
Payabbhi.accessId =  "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Refund> refunds = Payment.refunds("pay_mUy6UYsRvIxH9Qi2",
    new HashMap<String, Object>() {
      {
          put("count", 2);
      }
    });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var refunds = client.Payment.Retrieve("pay_mUy6UYsRvIxH9Qi2").GetRefunds();
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.payments.refunds('pay_mUy6UYsRvIxH9Qi2',
  (error, refunds) => {
    // refunds is a list of Refund objects
});
require 'payabbhi'
Payabbhi.access_id= 'access_id'
Payabbhi.secret_key= 'secret_key'
refunds = Payabbhi::Payment.refunds('pay_mUy6UYsRvIxH9Qi2')

JSON Response

com.payabbhi.model.PayabbhiCollection<Refund> JSON :
{
  "total_count": 2,
  "object": "list",
  "data": [
    {
      "id": "rfnd_02iOL6yHtrTTVYSw",
      "object": "refund",
      "amount": 200,
      "currency": "INR",
      "payment_id": "pay_mUy6UYsRvIxH9Qi2",
      "notes": {
        "item_count": "2",
        "sales_channel": "website"
      },
      "created_at": 1495554728
    },
    {
      "id": "rfnd_iqPqyu7Ds5UaC434",
      "object": "refund",
      "amount": 200,
      "currency": "INR",
      "payment_id": "pay_mUy6UYsRvIxH9Qi2",
      "notes": {
        "item_count": "2",
        "sales_channel": "website"
      },
      "created_at": 1495547054
    }
  ]
}

Returns a list of refunds for a given payment that have been previously created. The refunds are listed in reverse chronological order, with the most recent refund appearing first.

ARGUMENTS

payment_id
The identifier of the payment whose refunds are to be retrieved.
count default is 10
A limit on the number of refund objects to be returned. This can range between 1 and 100.
skip default is 0
Represents number of refund objects to be skipped
from
A filter criterion based on the created_at field of the refund object. Value can be a timestamp. Returns Refunds created on or after this timestamp.
to
A filter criterion based on the created_at field of the refund object. Value can be a timestamp. Returns Refunds created on or before this timestamp.

Returns

An object with total_count attribute containing the total count of refunds corresponding to the Payment, object attribute containing list and a data attribute containing an array of refund objects.

Each element in the array of data attribute is a separate refund object. If no refunds exist for the payment, the resulting array will be empty.

Refunds

The Refund Object

JSON Response

com.payabbhi.model.Refund JSON :
{
  "id": "rfnd_02iOL6yHtrTTVYSw",
  "object": "refund",
  "amount": 200,
  "currency": "INR",
  "payment_id": "pay_mUy6UYsRvIxH9Qi2",
  "notes": {
    "item_count": "2",
    "sales_channel": "website"
  },
  "created_at": 1495554728
}

ATTRIBUTES

id string
Unique identifier of Refund object.
object string, value is "refund"
Represents the object type which in this case is refund.
amount positive integer
A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00). Refund is created for this amount.
currency string
Three-letter ISO currency code. Currently only INR is supported.
payment_id string
The identifier of the Payment against which refund was created.
notes json object
Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the Refund object in a structured format.
created_at timestamp
Refund creation timestamp. Measured in seconds since the Unix epoch.

Create a refund

Definition

POST https://payabbhi.com/api/v1/payments/{payment_id}/refunds
<?php
$payment = $client->payment->retrieve({payment_id});
$payment->refund();
payment = client.payment.retrieve({payment_id})
payment.refund()
Refund refund = Refund.create({payment_id})
client.Payment.Retrieve({payment_id}).Refund();
payabbhi.refunds.create({paymentId},
  (error, refund) => {
    ...
});
Payabbhi::Refund.create({payment_id})

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/payments/pay_mUy6UYsRvIxH9Qi2/refunds \
  -d amount=200 \
  -d notes[sales_channel]=website
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$payment = $client->payment->retrieve('pay_mUy6UYsRvIxH9Qi2');
$payment->refund(array('amount'=>200,
                      'notes'=>array('sales_channel'=>'website')));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
payment = client.payment.retrieve('pay_mUy6UYsRvIxH9Qi2')
payment.refund(data={'amount': 200,
                     'notes': {'sales_channel': 'website'}
                    })
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Refund refund =
        Refund.create("pay_mUy6UYsRvIxH9Qi2",
        new HashMap<String, Object>() {
          {
            put("amount", 200);
            put("notes", new HashMap<String, Object>() {
            {
                put("sales_channel", "website");
            }
          });
        }
      });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var refund = client.Payment.Retrieve("pay_mUy6UYsRvIxH9Qi2").Refund(
                new Dictionary<string, object>() {
                    {"amount", 200},
                    {"notes", new Dictionary<string, object>(){
                          {"sales_channel", "website"}}}});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.refunds.create('pay_mUy6UYsRvIxH9Qi2', {amount: 200, notes: { sales_channel: 'website'}},
  (error, refund) => {
    // refund is Refund object
});
require 'payabbhi'
Payabbhi.access_id= 'access_id'
Payabbhi.secret_key= 'secret_key'
refund = Payabbhi::Refund.create('pay_mUy6UYsRvIxH9Qi2', { amount: 200,
                                                           notes: {
                                                             "sales_channel": "website"
                                                           }
                                                         })

JSON Response

com.payabbhi.model.Refund JSON :
{
  "id": "rfnd_02iOL6yHtrTTVYSw",
  "object": "refund",
  "amount": 200,
  "currency": "INR",
  "payment_id": "pay_mUy6UYsRvIxH9Qi2",
  "notes": {
    "sales_channel": "website"
  },
  "created_at": 1495554728
}

A refund can be created only for a previously captured payment that is not yet fully refunded.

ARGUMENTS

payment_id
The identifier of the Payment for which refund is being created.
amount default is the captured amount
A positive integer in the smallest currency unit. Minimum amount is 100 paisa. Refund amount is equal to captured amount for full refund. For partial refund, the refund amount is less than or equal to captured amount not yet refunded.
notes
Notes is a key-value store used for storing additional data relating to the object in structured format. For example, while refunding the payment, you can store the refund reason.

Returns

Returns the refund object if the refund is successful. Refunding a payment will fail, if the payment status is one of refunded, failed or authorized. Error response will be returned in case of such failure.

List all refunds

Definition

GET https://payabbhi.com/api/v1/refunds
<?php
$client->refund->all();
client.refund.all()
PayabbhiCollection<Refund> refundCollection = Refund.all()
client.Refund.All();
payabbhi.refunds.all(
  (error, refunds) => {
    ...
});
Payabbhi::Refund.all

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/refunds?count=2
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->refund->all(array('count'=>2));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.refund.all(data={'count': 2})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Refund> refunds=Refund.all(
          new HashMap<String, Object>() {
              {
                put("count", 2);
              }
          });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var refunds = client.Refund.All(
              new Dictionary<string, object>() {
                {"count", 2} } );
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.refunds.all({ count: 2 },
  (error, refunds) => {
    // refunds is a list of Refund objects
});
require 'payabbhi'
Payabbhi.access_id= 'access_id'
Payabbhi.secret_key= 'secret_key'
refunds = Payabbhi::Refund.all count: 2

JSON Response

com.payabbhi.model.PayabbhiCollection<Refund> JSON :
{
  "total_count": 2,
  "object": "list",
  "data": [
    {
      "id": "rfnd_02iOL6yHtrTTVYSw",
      "object": "refund",
      "amount": 200,
      "currency": "INR",
      "payment_id": "pay_mUy6UYsRvIxH9Qi2",
      "notes": {
        "item_count": "2",
        "sales_channel": "website"
      },
      "created_at": 1495554728
    },
    {
      "id": "rfnd_iqPqyu7Ds5UaC434",
      "object": "refund",
      "amount": 200,
      "currency": "INR",
      "payment_id": "pay_mUy6UYsRvIxH9Qi2",
      "notes": {
        "item_count": "2",
        "sales_channel": "website"
      },
      "created_at": 1495547054
    }
  ]
}

Returns a list of refunds created previously. The refunds are listed in reverse chronological order, with the most recent refund appearing first.

ARGUMENTS

count default is 10
A limit on the number of refund objects to be returned. This can range between 1 and 100.
skip default is 0
Represents number of refund objects to be skipped
from
A filter criterion based on the created_at field of the refund object. Value can be a timestamp. Returns Refunds created on or after this timestamp.
to
A filter criterion based on the created_at field of the refund object. Value can be a timestamp. Returns Refunds created on or before this timestamp.

Returns

An object with total_count attribute containing the total count of refunds matching the given request, object attribute containing list and a data attribute containing an array of refund objects.

Each element in the array of data attribute is a separate refund object. If no refunds exist, the resulting array will be empty.

You can optionally set the filter criteria to only retrieve Refunds that match the criteria.

Retrieve a refund

Definition

GET https://payabbhi.com/api/v1/refunds/{refund_id}
<?php
$client->refund->retrieve({refund_id});
client.refund.retrieve({refund_id})
Refund refund = Refund.retrieve({refund_id})
client.Refund.Retrieve({refund_id});
payabbhi.refunds.retrieve({refundId},
  (error, refund) => {
    ...
});
Payabbhi::Refund.retrieve({refund_id})

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/refunds/rfnd_02iOL6yHtrTTVYSw
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->refund->retrieve('rfnd_02iOL6yHtrTTVYSw');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.refund.retrieve('rfnd_02iOL6yHtrTTVYSw')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Refund refund = Refund.retrieve("rfnd_02iOL6yHtrTTVYSw");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var refund = client.Refund.Retrieve("rfnd_02iOL6yHtrTTVYSw");
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.refunds.retrieve('rfnd_02iOL6yHtrTTVYSw',
  (error, refund) => {
    // refund is Refund object
});
require 'payabbhi'
Payabbhi.access_id= 'access_id'
Payabbhi.secret_key= 'secret_key'
refund = Payabbhi::Refund.retrieve('rfnd_02iOL6yHtrTTVYSw')

JSON Response

com.payabbhi.model.Refund JSON :
{
  "id": "rfnd_02iOL6yHtrTTVYSw",
  "object": "refund",
  "amount": 200,
  "currency": "INR",
  "payment_id": "pay_mUy6UYsRvIxH9Qi2",
  "notes": {
    "item_count": "2",
    "sales_channel": "website"
  },
  "created_at": 1495554728
}

Returns a Refund object matching the refund_id. Else it returns an error response.

ARGUMENTS

refund_id
The identifier of the refund to be retrieved.

Returns

Returns a refund object, given a valid refund identifier was provided, and returns an error otherwise.

Events

The Event Object

JSON Response

com.payabbhi.model.Event JSON :
{
  "id":"evt_gCmIpp76zgZynfEO",
  "object": "event",
  "type": "payment.captured",
  "created_at": 1495546532,
  "environment":"live",
  "data": {
    "payment": {
      "id": "pay_mUy6UYsRvIxH9Qi2",
      "object": "payment",
      "amount": 1000,
      "currency": "INR",
      "status": "captured",
      "order_id": "order_D9kQbGJAmGwJ2XMK",
      "international": false,
      "method": "card",
      "description": "merchant-provided description",
      "card": "visa-debit",
      "bank": "",
      "wallet": "",
      "vpa": "",
      "email": "test@example.com",
      "contact": "9999999999",
      "notes": null,
      "fee": 0,
      "service_tax": 0,
      "payout_amount": 0,
      "payout_type": "",
      "settled": false,
      "settlement_id": "",
      "refunded_amount": 0,
      "refund_status": "",
      "refunds": {
        "total_count": 0,
        "object": "list",
        "data": []
      },
      "error_code": "",
      "error_description": "",
      "created_at": 1495546415,
      "virtual_account_id": "",
      "payment_page_id": "",
      "bank_response": {}
    }
  }
}

ATTRIBUTES

id string
Unique identifier of event object.
object string, value is "event"
Represents the object type which in this case is event.
type string
Describes the event type (e.g. payment.captured or payment.declined). Click here for list of event types.
created_at timestamp
Event creation timestamp. Measured in seconds since the Unix epoch.
environment string
Indicates whether the event occurred in live or test mode. Value is either live or test to denote the environment.
data object
Object(s) containing data associated with the event.

List all events

Definition

GET https://payabbhi.com/api/v1/events
<?php
$client->event->all();
client.event.all()
PayabbhiCollection<Event> events = Event.all();
client.Event.All();
payabbhi.events.all(
  (error, events) => {
    ...
});
Payabbhi::Event.all

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/events?count=2
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->event->all(array('count'=>2));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.event.all(data={'count': 2})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Event> events = Event.all(
        new HashMap<String, Object>() {
          {
            put("count", 2);
          }
        });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var events = client.Event.All(new Dictionary<string, object>() {
                {"count", 2}});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.events.all({ count: 2 },
  (error, events) => {
    // events is list of Event Objects
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
events = Payabbhi::Event.all count: 2

JSON Response:

com.payabbhi.model.Event JSON :
{
  "total_count": 2,
  "object": "list",
  "data": [
    {
      "id": "evt_q4ywIKk4aOmtFVf0",
      "object": "event",
      "type": "payment.refunded",
      "created_at": 1495686582,
      "environment": "live",
      "data": {
        "refund": {
          "id": "rfnd_DwYB1QfJwyqTjABf",
          "amount": 1000,
          "created_at": 1495686582,
          "currency": "INR",
          "notes": null,
          "object": "refund",
          "payment_id": "pay_mUy6UYsRvIxH9Qi2"
        }
      }
    },
    {
      "id":"evt_gCmIpp76zgZynfEO",
      "object": "event",
      "type": "payment.captured",
      "created_at": 1495546532,
      "environment":"live",
      "data": {
        "payment": {
          "id": "pay_mUy6UYsRvIxH9Qi2",
          "object": "payment",
          "amount": 1000,
          "currency": "INR",
          "status": "captured",
          "order_id": "order_D9kQbGJAmGwJ2XMK",
          "international": false,
          "method": "card",
          "description": "merchant-provided description",
          "card": "visa-debit",
          "bank": "",
          "wallet": "",
          "vpa": "",
          "email": "test@example.com",
          "contact": "9999999999",
          "notes": null,
          "fee": 0,
          "service_tax": 0,
          "payout_amount": 0,
          "payout_type": "",
          "settled": false,
          "settlement_id": "",
          "refunded_amount": 0,
          "refund_status": "",
          "refunds": {
            "total_count": 0,
            "object": "list",
            "data": []
          },
          "error_code": "",
          "error_description": "",
          "created_at": 1495546415,
          "virtual_account_id": "",
          "payment_page_id": "",
          "bank_response": {}
        }
      }
    }
  ]
}

Returns a list of events created previously. The events are listed in reverse chronological order, with the most recent event appearing first.

ARGUMENTS

count default is 10
A limit on the number of event objects to be returned. This can range between 1 and 100.
skip default is 0
Represents number of event objects to be skipped.
from
A filter criterion based on the created_at field of an object. Value can be a timestamp. Returns Events created on or after this timestamp.
to
A filter criterion based on the created_at field of an object. Value can be a timestamp. Returns Events created on or before this timestamp.
type
A filter criterion based on type of the Event. Value can be any of the event types.

Returns

An object with total_count attribute containing the total count of events matching the given request, object attribute containing list and data attribute containing an array of event objects.

Each element in the array of data attribute is a separate event object. If no events exist, the resulting array will be empty.

You can optionally set the filter criteria to only retrieve events that match the criteria.

Retrieve an event

Definition

GET https://payabbhi.com/api/v1/events/{event_id}
<?php
$client->event->retrieve({event_id})
client.event.retrieve({event_id})
Event event = Event.retrieve({event_id});
client.Event.Retrieve({event_id});
payabbhi.events.retrieve({eventId},
  (error, event) => {
    ...
});
Payabbhi::Event.retrieve({event_id})

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/events/evt_gCmIpp76zgZynfEO
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->event->retrieve('evt_gCmIpp76zgZynfEO');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.event.retrieve('evt_gCmIpp76zgZynfEO')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Event event = Event.retrieve("evt_gCmIpp76zgZynfEO");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var evt = client.Event.Retrieve("evt_gCmIpp76zgZynfEO");
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.events.retrieve('evt_gCmIpp76zgZynfEO',
  (error, event) => {
    // event is the Event object retrieved
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
event = Payabbhi::Event.retrieve('evt_gCmIpp76zgZynfEO')

JSON Response

com.payabbhi.model.Event JSON :
{
  "id": "evt_gCmIpp76zgZynfEO",
  "object": "event",
  "type": "payment.captured",
  "created_at": 1495546532,
  "environment":"live",
  "data": {
    "payment": {
      "id": "pay_mUy6UYsRvIxH9Qi2",
      "object": "payment",
      "amount": 1000,
      "currency": "INR",
      "status": "captured",
      "order_id": "order_D9kQbGJAmGwJ2XMK",
      "international": false,
      "method": "card",
      "description": "merchant-provided description",
      "card": "visa-debit",
      "bank": "",
      "wallet": "",
      "vpa": "",
      "email": "test@example.com",
      "contact": "9999999999",
      "notes": null,
      "fee": 0,
      "service_tax": 0,
      "payout_amount": 0,
      "payout_type": "",
      "settled": false,
      "settlement_id": "",
      "refunded_amount": 0,
      "refund_status": "",
      "refunds": {
        "total_count": 0,
        "object": "list",
        "data": []
      },
      "error_code": "",
      "error_description": "",
      "created_at": 1495546415,
      "virtual_account_id": "",
      "payment_page_id": "",
      "bank_response": {}
    }
  }
}

Returns a Event object matching the event_id. Else it returns an error response. You may provide the event ID as received in a webhook.

ARGUMENTS

event_id
The identifier of the event to be retrieved.

Returns

Returns an event object given a valid event identifier was provided, and returns an error otherwise.

Types of events

This is a list of of events we currently support. A event resource.event is triggered against resource like payment, order etc.

Payments   
payment.captured Occurs whenever a payment is captured.
payment.declined Occurs whenever a payment attempt is declined.
payment.refunded Occurs whenever a refund is successfully requested for a payment, including partial refund.
Orders   
order.paid          Occurs whenever an order is paid.                                        
Subscriptions   
subscription.activated Occurs whenever a subscription is activated.
subscription.trial_will_end Occurs before 3 days of subscription trial period end date.
subscription.past_due Occurs whenever the invoice for any billing period is unpaid.
subscription.on_hold Occurs whenever a subscription is on-hold.
subscription.cancelled Occurs whenever a subscription is cancelled.
Invoices   
invoice.issued Occurs whenever an invoice is issued to the customer.
invoice.partially_paid Occurs whenever an invoice is partially paid.
invoice.paid Occurs whenever an invoice is paid.
invoice.past_due Occurs whenever the due date of an invoice is already passed.
Payment Links   
payment_link.issued Occurs whenever a payment link is issued to the customer.
payment_link.partially_paid Occurs whenever a payment link is partially paid.
payment_link.paid Occurs whenever a payment link is paid.
payment_link.past_due Occurs whenever the due date of a payment link is already passed.
Settlements   
settlement.settled Occurs whenever a settlement has been processed.   
settlement.failed Occurs whenever a settlement was not processed.
Virtual Accounts   
virtual_account.credited Occurs whenever a virtual account has been credited.   
Transfers   
transfer.created Occurs whenever a transfer has been created.   
transfer.reversed Occurs whenever a transfer has been reversed.
Credit Accounts   
credits.added Occurs whenever a credit account has been credited.   
credits.deducted Occurs whenever a credit account has been debited.

Settlements

The Settlement Object

JSON Response

{
  "id": "stl_wmjBUMNyLnzGbFKU",
  "object": "settlement",
  "amount": 952800,
  "currency": "INR",
  "status": "settled",
  "fees": 47200,
  "gst": 7200,
  "utr": "utr29zGbFatpqmKZkQU",
  "settled_at": 1544530263
}

ATTRIBUTES

id string
Unique identifier of Settlement object.
object string, value is "settlement"
Represents the object type which in this case is settlement.
amount positive integer
Amount to be settled, in the smallest currency unit (paisa).
currency string
Three-letter ISO currency code. Currently only INR is supported.
status string
The status of the settlement is either of processing, settled or failed.
fees positive integer
Fees charged by us including gst, in the smallest currency unit (paisa).
gst positive integer
GST charged in the smallest currency unit (paisa).
utr string
Unique Transaction Reference (UTR) number is provided by our banking partners and it can be used to track a particular settlement in your bank account.
settled_at positive integer
Timestamp when a settlement is settled. Measured in seconds since the Unix epoch.

List all settlements

Definition

GET https://payabbhi.com/api/v1/settlements
<?php
$client->settlement->all();
PayabbhiCollection<Settlement> settlements = Settlement.all();
client.settlement.all()
client.Settlement.All();
payabbhi.settlements.all(
  (error, settlements) => {
    ...
});

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/settlements?count=2
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->settlement->all(array('count'=>2));
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Settlement> settlements = Settlement.all(
        new HashMap<String, Object>() {
          {
            put("count", 2);
          }
        });
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.settlement.all(data={'count': 2})
using Payabbhi;
var client = new Client("accessId", "secretKey");
var settlements = client.Settlement.All(
    new Dictionary<string, object>() {
      {"count", 2} } );
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.settlements.all({ count: 2 },
  (error, settlements) => {
    // settlements is list of Settlement Objects
});

JSON Response:

{
  "total_count": 2,
  "object": "list",
  "data": [
    {
      "id": "stl_wmjBUMNyLnzGbFKU",
      "object": "settlement",
      "amount": 952800,
      "currency": "INR",
      "status": "settled",
      "fees": 47200,
      "gst": 7200,
      "utr": "utr29zGbFatpqmKZkQU",
      "settled_at": 1544530263
    },
    {
      "id": "stl_rvJlf9exdFRg3gbt",
      "object": "settlement",
      "amount": 358400,
      "currency": "INR",
      "status": "processing",
      "fees": 141600,
      "gst": 21600,
      "utr": "",
      "settled_at": 0
    }
  ]
}

Returns a list of settlements created previously. The settlement are listed in reverse chronological order, with the most recent settlement appearing first.

ARGUMENTS

count default is 10
A limit on the number of settlement objects to be returned. This can range between 1 and 100.
skip default is 0
Represents number of settlement objects to be skipped.

Returns

An object with total_count attribute containing the total count of settlements matching the given request, object attribute containing list and data attribute containing an array of settlement objects.

Each element in the array of data attribute is a separate settlement object. If no settlements exist, the resulting array will be empty.

You can optionally set the filter criteria to only retrieve settlements that match the criteria.

Retrieve a settlement

Definition

GET https://payabbhi.com/api/v1/settlements/{settlement_id}
<?php
$client->settlement->retrieve({settlement_id});
Settlement settlement = Settlement.retrieve({settlement_id});
client.settlement.retrieve({settlement_id})
client.Settlement.Retrieve({settlement_id});
payabbhi.settlements.retrieve({settlementId},
  (error, settlement) => {
    ...
});

Example Request

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/settlements/stl_wmjBUMNyLnzGbFKU
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->settlement->retrieve('stl_wmjBUMNyLnzGbFKU');
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Settlement settlement = Settlement.retrieve("stl_wmjBUMNyLnzGbFKU");
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.settlement.retrieve('stl_wmjBUMNyLnzGbFKU')
using Payabbhi;
var client = new Client("accessId", "secretKey");
var settlement = client.Settlement.Retrieve("stl_wmjBUMNyLnzGbFKU");
const payabbhi =  require('payabbhi')('access_id','secret_key');
payabbhi.settlements.retrieve('stl_wmjBUMNyLnzGbFKU',
  (error, settlement) => {
    //settlement is the Settlement Object retrieved
});

JSON Response

{
  "id": "stl_wmjBUMNyLnzGbFKU",
  "object": "settlement",
  "amount": 952800,
  "currency": "INR",
  "status": "settled",
  "fees": 47200,
  "gst": 7200,
  "utr": "utr29zGbFatpqmKZkQU",
  "settled_at": 1544530263
}

Returns a Settlement object matching the settlement_id. Else it returns an error response.

ARGUMENTS

settlement_id
The identifier of the settlement to be retrieved.

Returns

Returns an settlement object given a valid settlement identifier was provided, and returns an error otherwise.

Customers

The Customer Object

JSON Response

com.payabbhi.model.Customer JSON :
{
  "id": "cust_yaTTsvmCu8Lqs7Ek",
  "object": "customer",
  "name": "Bruce",
  "email": "a@b.com",
  "contact_no": "9999999999",
  "billing_address": {
    "address_line1": "12 Baker Street",
    "address_line2": "Near Temple",
    "city": "Kolkata",
    "state": "West Bengal",
    "pin": "700156"
  },
  "shipping_address": {
    "address_line1": "12 Baker Street",
    "address_line2": "Near Temple",
    "city": "Kolkata",
    "state": "West Bengal",
    "pin": "700156"
  },
  "gstin": "",
  "notes": null,
  "subscriptions": {
    "total_count": 0,
    "object": "list",
    "data": []
  },
  "created_at": 1539002874
}

ATTRIBUTES

id string
Unique identifier of customer object.
object string, value is "customer"
Represents the object type which in this case is customer.
name string
Name of the Customer.
email string
Email ID of the Customer.
contact_no string
Contact Number of the Customer.
billing_address json object
Billing Address is a key-value pair denoting the billing address of the customer. Valid keys are address_line1, address_line2, city, state, pin.
shipping_address json object
Shipping Address is a key-value pair denoting the shipping address of the customer. Valid keys are address_line1, address_line2, city, state, pin.
gstin string
GSTIN of the Customer.
subscriptions list
A list of subscriptions related to this customer.
notes json object
Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the customer object in a structured format.
created_at timestamp
Customer creation timestamp. Measured in seconds since the Unix epoch.

Create a customer

Definition

POST https://payabbhi.com/api/v1/customers
<?php
$client->customer->create();
client.customer.create()
Customer customer = Customer.create();
client.Customer.Create();
payabbhi.customers.create(
  (error, customer) => {
  ...
});
Payabbhi::Customer.create

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/customers \
  -d email=a@b.com \
  -d contact_no=9999999999
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->customer->create(array("email" => "a@b.com",
                                "contact_no" => "9999999999"));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.customer.create(data={'email': 'a@b.com', 'contact_no': '9999999999'})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Customer customer =
    Customer.create(
        new HashMap<String, Object>() {
          {
            put("email", "a@b.com");
            put("contact_no", "9999999999");
          }
        });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var createdCustomer = client.Customer.Create(new Dictionary<string, object>() {
                        { "email", "a@b.com" },
                        { "contact_no", "9999999999" }});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.customers.create({
      email: 'a@b.com',
      contact_no: '9999999999'
    }, (error, customer) => {
      // customer contains created customer details in JSON format.
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
customer = Payabbhi::Customer.create email: 'a@b.com', contact_no: '9999999999'

JSON Response

com.payabbhi.model.Customer JSON :
{
  "id": "cust_3R7XoNQ7xUOu0BjD",
  "object": "customer",
  "name": "",
  "email": "a@b.com",
  "contact_no": "9999999999",
  "billing_address": null,
  "shipping_address": null,
  "gstin": "",
  "notes": null,
  "subscriptions": {
    "total_count": 0,
    "object": "list",
    "data": []
  },
  "created_at": 1539165161
}

Creates a new customer.

ARGUMENTS

email
Email ID of the Customer.
contact_no
Contact Number of the Customer.
name
Name of the Customer.
gstin
GSTIN of the Customer.
billing_address
Billing Address is a key-value pair denoting the billing address of the customer. Valid keys are address_line1, address_line2, city, state, pin.
shipping_address
Shipping Address is a key-value pair denoting the shipping address of the customer. Valid keys are address_line1, address_line2, city, state, pin.
notes
Notes is a key-value store used for storing additional data relating to the customer object in structured format.

Returns

Returns the customer object if the customer is created successfully. Else it returns an error response.

Update a customer

Definition

PUT https://payabbhi.com/api/v1/customers/{customer_id}
<?php
$client->customer->edit({customer_id});
client.customer.edit({customer_id})
Customer customer = Customer.edit({customer_id});
client.Customer.Retrieve({customer_id}).Update();
payabbhi.customers.edit({customerId},
  (error, customer) => {
    ...
});
Payabbhi::Customer.edit({customer_id})

Example Request:

$ curl -u access_id:secret_key -X PUT \
  https://payabbhi.com/api/v1/customers/cust_yaTTsvmCu8Lqs7Ek \
  -d email=b@c.com \
  -d contact_no=1234567890
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->customer->edit("cust_yaTTsvmCu8Lqs7Ek", array("email" => "b@c.com",
                            "contact_no" => "1234567890"));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.customer.edit('cust_yaTTsvmCu8Lqs7Ek', data={'email': 'b@c.com', 'contact_no': '1234567890'})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Customer customer =
    Customer.edit(
        "cust_yaTTsvmCu8Lqs7Ek",
        new HashMap<String, Object>() {
          {
            put("email", "b@c.com");
            put("contact_no", "1234567890");
          }
        });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var customer = client.Customer.Retrieve("cust_yaTTsvmCu8Lqs7Ek");
customer = customer.Update(new Dictionary<string, object>() {
				{ "email", "b@c.com" },
				{ "contact_no", "1234567890" },
	  });
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.customers.edit('cust_yaTTsvmCu8Lqs7Ek', {
      email: 'b@c.com',
      contact_no: '1234567890'
    }, (error, customer) => {
    // customer contains updated customer details in JSON format.
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
customer = Payabbhi::Customer.edit('cust_yaTTsvmCu8Lqs7Ek',
                                    email: 'b@c.com',
                                    contact_no: '1234567890')

JSON Response

com.payabbhi.model.Customer JSON :
{
  "id": "cust_yaTTsvmCu8Lqs7Ek",
  "object": "customer",
  "name": "",
  "email": "b@c.com",
  "contact_no": "1234567890",
  "billing_address": null,
  "shipping_address": null,
  "gstin": "",
  "notes": null,
  "subscriptions": {
    "total_count": 0,
    "object": "list",
    "data": []
  },
  "created_at": 1539002874
}

Updates a customer

ARGUMENTS

customer_id
The identifier of the customer which needs to be updated.
email
Email ID of the Customer.
contact_no
Contact Number of the Customer.
name
Name of the Customer.
gstin
GSTIN of the Customer.
billing_address
Billing Address is a key-value pair denoting the billing address of the customer. Valid keys are address_line1, address_line2, city, state, pin.
shipping_address
Shipping Address is a key-value pair denoting the shipping address of the customer. Valid keys are address_line1, address_line2, city, state, pin.
notes
Notes is a key-value store used for storing additional data relating to the customer object in structured format.

Returns

Returns the customer object if the customer is updated successfully. Else it returns an error response.

List all customers

Definition

GET https://payabbhi.com/api/v1/customers
<?php
$client->customer->all();
client.customer.all()
PayabbhiCollection<Customer> customers = Customer.all();
client.Customer.All();
payabbhi.customers.all(
  (error, customers) => {
    ...
});
Payabbhi::Customer.all

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/customers?count=2
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->customer->all(array('count'=>2));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.customer.all(data={'count': 2})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Customer> customers = Customer.all(
        new HashMap<String, Object>() {
          {
            put("count", 2);
          }
        });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var customers = client.Customer.All(new Dictionary<string, object>() {
                {"count", 2}});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.customers.all({ count: 2 },
  (error, customers) => {
    // customers is list of Customer Objects
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
customers = Payabbhi::Customer.all count: 2

JSON Response

com.payabbhi.model.Customer JSON :
{
  "total_count": 2,
  "object": "list",
  "data": [
    {
      "id": "cust_2WmsQoSRZMWWkcZg",
      "object": "customer",
      "name": "bruce wayne",
      "email": "g@b.com",
      "contact_no": "7042069316",
      "billing_address": null,
      "shipping_address": null,
      "gstin": "",
      "notes": null,
      "subscriptions": {
        "total_count": 0,
        "object": "list",
        "data": []
      },
      "created_at": 1539003109
    },
    {
      "id": "cust_NDgjdWVgjKyb0qac",
      "object": "customer",
      "name": "",
      "email": "b@b.com",
      "contact_no": "9433894351",
      "billing_address": null,
      "shipping_address": null,
      "gstin": "",
      "notes": null,
      "subscriptions": {
        "total_count": 0,
        "object": "list",
        "data": []
      },
      "created_at": 1539002950
    }
  ]
}

Returns a list of customers created previously. The customers are listed in reverse chronological order, with the most recent customer appearing first.

ARGUMENTS

count default is 10
A limit on the number of customer objects to be returned. This can range between 1 and 100.
skip default is 0
Represents number of customer objects to be skipped
from
A filter criterion based on the created_at field of the customer object. Value can be a timestamp. Returns Customers created on or after this timestamp.
to
A filter criterion based on the created_at field of the customer object. Value can be a timestamp. Returns Customers created on or before this timestamp.

Returns

An object with total_count attribute containing the total count of customers matching the given request, object attribute containing list and a data attribute containing an array of customer objects.

Each element in the array of data attribute is a separate customer object. If no customers exist, the resulting array will be empty.

You can optionally set the filter criteria to only retrieve Customers that match the criteria.

Retrieve a customer

Definition

GET https://payabbhi.com/api/v1/customers/{customer_id}
<?php
$client->customer->retrieve({customer_id});
client.customer.retrieve({customer_id})
Customer customer = Customer.retrieve({customer_id});
client.Customer.Retrieve({customer_id});
payabbhi.customers.retrieve({customerId},
  (error, customer) => {
    ...
});
Payabbhi::Customer.retrieve({customer_id})

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/customers/cust_NDgjdWVgjKyb0qac
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->customer->retrieve('cust_NDgjdWVgjKyb0qac');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.customer.retrieve('cust_NDgjdWVgjKyb0qac')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Customer customer = Customer.retrieve("cust_NDgjdWVgjKyb0qac");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var customer = client.Customer.Retrieve("cust_NDgjdWVgjKyb0qac");
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.customers.retrieve('cust_NDgjdWVgjKyb0qac',
  (error, customer) => {
    // customer is the Customer object retrieved
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
customer = Payabbhi::Customer.retrieve('cust_NDgjdWVgjKyb0qac')

JSON Response

com.payabbhi.model.Customer JSON :
{
  "id": "cust_NDgjdWVgjKyb0qac",
  "object": "customer",
  "name": "",
  "email": "b@b.com",
  "contact_no": "9433894351",
  "billing_address": null,
  "shipping_address": null,
  "gstin": "",
  "notes": null,
  "subscriptions": {
    "total_count": 0,
    "object": "list",
    "data": []
  },
  "created_at": 1539002950
}

Returns a Customer object matching the customer_id. Else it returns an error response.

ARGUMENTS

customer_id
The identifier of the customer to be retrieved.

Returns

Returns a customer object, given a valid customer identifier was provided, and returns an error otherwise.

Products

The Product Object

JSON Response

com.payabbhi.model.Product JSON :
{
  "id": "prod_v0RYyTj4qEj56c12",
  "object": "product",
  "name": "Books",
  "type": "service",
  "unit_label": "MB",
  "notes": {
    "genre": "comedy"
  },
  "created_at": 1539153224
}

ATTRIBUTES

id string
Unique identifier of product object.
object string, value is "product"
Represents the object type which in this case is product.
name string
Name of the product, which should be displayed to the customer in invoice and receipt.
type string
Type of the Product. This can be good or service. Default is service.
unit_label string
Unit of the Product being charged - Megabytes, piece, sms etc.
notes json object
Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the product object in a structured format.
created_at timestamp
Product creation timestamp. Measured in seconds since the Unix epoch.

Create a product

Definition

POST https://payabbhi.com/api/v1/products
<?php
$client->product->create();
client.product.create()
Product created_product = Product.create()
client.Product.Create();
payabbhi.products.create(
  (error, product) => {
  ...
});
Payabbhi::Product.create

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/products \
  -d name=Books \
  -d unit_label=MB \
  -d notes[genre]=comedy
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->product->create(array('name' => "Books",
                              'unit_label' => "MB",
                              'notes'=>array('genre'=>'comedy')));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.product.create(data={'name': 'Books', 'unit_label': 'MB', 'notes': {'genre': 'comedy'}})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Product created_product = Product.create(
              new HashMap<String, Object>() {
                {
                  put("name", "Books");
                  put("type", "service");
                  put("unit_label", "MB");
                  put("notes", new HashMap<String, Object>() {
                    {
                          put("genre", "comedy");
                    }
                  });
                }
              });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var product = client.Product.Create(new Dictionary<string, object>() {
  {"name", "Books"},
  {"unit_label", "MB"},
  {"notes", new Dictionary<string, object>(){{ "genre", "comedy" }}}
});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.products.create({
      name: 'Books',
      unit_label: 'MB',
      notes: {
        genre: 'comedy'
      }
    }, (error, product) => {
      // product contains created product details in JSON format.
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
product = Payabbhi::Product.create name: 'Books',
                                   unit_label: 'MB',
                                   notes: {
                                     genre: 'comedy'
                                   }

JSON Response

com.payabbhi.model.Product JSON :
{
  "id": "prod_v0RYyTj4qEj56c12",
  "object": "product",
  "name": "Books",
  "type": "service",
  "unit_label": "MB",
  "notes": {
    "genre": "comedy"
  },
  "created_at": 1539153224
}

Creates a new product.

ARGUMENTS

name
Name of the Product, which should be displayed to the customer in receipt and invoice.
type default is service
Type of the Product. This can be good or service. Default is service.
unit_label
Unit of the Product being charged - Megabytes, piece, sms etc.
notes
Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the product object in a structured format.

Returns

Returns the product object if the product creation is successful. Else it returns an error response.

List all products

Definition

GET https://payabbhi.com/api/v1/products
<?php
$client->product->all();
client.product.all()
PayabbhiCollection<Product> products = Product.all();
client.Product.All();
payabbhi.products.all(
  (error, products) => {
    ...
});
Payabbhi::Product.all

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/products?count=2
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->product->all(array('count'=>2));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.product.all(data={'count': 2})
import com.payabbhi.Payabbhi;
Payabbhi.accessId =  "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Product> productCollection = Product.all(
        new HashMap<String, Object>() {
          {
            put("count", 2);
          }
        });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var products = client.Product.All(new Dictionary<string, object>() {
                {"count", 2}});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.products.all({ count: 2 },
  (error, products) => {
  // products is list of Product Objects
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
products = Payabbhi::Product.all count: 2

JSON Response

com.payabbhi.model.PayabbhiCollection<Product> JSON :
{
  "total_count": 2,
  "object": "list",
  "data": [
    {
      "id": "prod_v0RYyTj4qEj56c12",
      "object": "product",
      "name": "Books",
      "type": "service",
      "unit_label": "MB",
      "notes": {
        "genre": "comedy"
      },
      "created_at": 1539153224
    },
    {
      "id": "prod_wJ6DyX5Bgg2LqAqt",
      "object": "product",
      "name": "Shows",
      "type": "service",
      "unit_label": "MB",
      "notes": null,
      "created_at": 1538997950
    }
  ]
}

Returns a list of products created previously. The products are listed in reverse chronological product, with the most recent product appearing first.

ARGUMENTS

count default is 10
A limit on the number of product objects to be returned. This can range between 1 and 100.
skip default is 0
Represents number of product objects to be skipped
from
A filter criterion based on the created_at field of the product object. Value can be a timestamp. Returns Products created on or after this timestamp.
to
A filter criterion based on the created_at field of the product object. Value can be a timestamp. Returns Products created on or before this timestamp.

Returns

An object with total_count attribute containing the total count of products matching the given request, object attribute containing list and a data attribute containing an array of product objects.

Each element in the array of data attribute is a separate product object. If no products exist, the resulting array will be empty.

You can optionally set the filter criteria to only retrieve Products that match the criteria.

Retrieve a product

Definition

GET https://payabbhi.com/api/v1/products/{product_id}
<?php
$client->product->retrieve({product_id});
client.product.retrieve({product_id})
 Product product = Product.retrieve({product_id})
client.Product.Retrieve({product_id});
payabbhi.products.retrieve({productId},
  (error, product) => {
    ...
});
Payabbhi::Product.retrieve({product_id})

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/products/prod_v0RYyTj4qEj56c12
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->product->retrieve('prod_v0RYyTj4qEj56c12');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.product.retrieve('prod_v0RYyTj4qEj56c12')
import com.payabbhi.Payabbhi;
Payabbhi.accessId =  "access_id";
Payabbhi.secretKey = "secret_key";
Product product = Product.retrieve("prod_v0RYyTj4qEj56c12");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var product = client.Product.Retrieve("prod_v0RYyTj4qEj56c12");
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.products.retrieve('prod_v0RYyTj4qEj56c12',
  (error, product) => {
    // product is the Product object retrieved
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
product = Payabbhi::Product.retrieve('prod_v0RYyTj4qEj56c12')

JSON Response

com.payabbhi.model.Product JSON :
{
  "id": "prod_v0RYyTj4qEj56c12",
  "object": "product",
  "name": "Books",
  "type": "service",
  "unit_label": "MB",
  "notes": {
    "genre": "comedy"
  },
  "created_at": 1539153224
}

Returns a Product object matching the product_id. Else it returns an error response.

ARGUMENTS

product_id
The identifier of the product to be retrieved.

Returns

Returns a product object, given a valid product identifier was provided, and returns an error otherwise.

Plans

The Plan Object

JSON Response

com.payabbhi.model.Plan JSON :
{
  "id": "plan_tuOWN0Sc0uMB4s8E",
  "object": "plan",
  "product_id": "prod_wJ6DyX5Bgg2LqAqt",
  "name": "Basic",
  "amount": 100,
  "currency": "INR",
  "frequency": 2,
  "interval": "month(s)",
  "notes": null,
  "created_at": 1539001274
}

ATTRIBUTES

id string
Unique identifier of plan object.
object string, value is "plan"
Represents the object type which in this case is plan.
product_id string
Unique identifier of a product, whose pricing is determined by this plan.
name string
Name of the Plan. Ex: Basic, Standard etc
amount positive integer
Amount to be paid in each billing cycle. A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00). Minimum amount is 100 paise.
currency string
Three-letter ISO currency code. Currently only INR is supported.
frequency positive integer
Frequency of billing interval.
interval string
Interval at which the Subscription would be billed. This can be days(s), week(s), month(s) or year(s). Default billing cycle is month(s). Billing cycle is supported for minimum 7 days or 1 week and maximum 1 year. For example, if frequency is 2 and interval is week(s), the subscription is billed in every 2 weeks.
notes json object
Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the plan object in a structured format.
created_at timestamp
Plan creation timestamp. Measured in seconds since the Unix epoch.

Create a plan

Definition

POST https://payabbhi.com/api/v1/plans
<?php
$client->plan->create();
client.plan.create()
Plan created_plan = Plan.create()
client.Plan.Create();
payabbhi.plans.create(
  (error, plan) => {
  ...
});
Payabbhi::Plan.create

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/plans \
  -d product_id=prod_wJ6DyX5Bgg2LqAqt \
  -d amount=100 \
  -d currency=INR \
  -d frequency=2 \
  -d interval="month(s)"
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->plan->create(array("product_id" => "prod_wJ6DyX5Bgg2LqAqt",
                            "amount" => 100,
                            "currency" => "INR", "frequency" => 2, "interval" => "month(s)"));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.plan.create(data={'product_id': 'prod_wJ6DyX5Bgg2LqAqt',
                         'amount': 100,
                         'currency': 'INR',
                         'frequency': 2,
                         'interval': 'month(s)'
                        })
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Plan created_plan = Plan.create(
              new HashMap<String, Object>() {
                {
                  put("product_id", "prod_wJ6DyX5Bgg2LqAqt");
                  put("amount", 100);
                  put("currency", "INR");
                  put("frequency", 2);
                  put("interval", "month(s)");
                }
              });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var plan = client.Plan.Create(new Dictionary<string, object>() {
  {"product_id", "prod_wJ6DyX5Bgg2LqAqt"},
  {"amount", 100},
  {"currency", "INR"},
  {"frequency", 2},
  {"interval", "month(s)"},
});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.plans.create({
      product_id: 'prod_wJ6DyX5Bgg2LqAqt',
      amount: 100,
      currency: 'INR',
      frequency: 2,
      interval: 'month(s)'
    }, (error, plan) => {
      // plan contains created Plan details in JSON format.
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
plan = Payabbhi::Plan.create product_id: 'prod_wJ6DyX5Bgg2LqAqt',
                             currency: 'INR',
                             amount: 100,
                             frequency: 2,
                             interval: 'month(s)'

JSON Response

com.payabbhi.model.Plan JSON :
{
  "id": "plan_P7wNUwTdGC2u2n2I",
  "object": "plan",
  "product_id": "prod_wJ6DyX5Bgg2LqAqt",
  "name": "",
  "amount": 100,
  "currency": "INR",
  "frequency": 2,
  "interval": "month(s)",
  "notes": null,
  "created_at": 1539158721
}

Creates a new plan.

ARGUMENTS

product_id
The identifier of the Product against which plan was created.
amount
A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00). Minimum amount is 100 paise.
currency
Three-letter ISO currency code. Currently only INR is supported.
frequency
Frequency of billing interval.
interval
Interval at which the Subscription would be billed. This can be day(s), week(s), month(s) or year(s).
name
Name of the Plan. Ex: Basic, Standard etc.
notes
Notes is a key-value store used for storing additional data relating to the object in structured format.

Returns

Returns the plan object if the plan is created successfully. Else it returns an error response.

List all plans

Definition

GET https://payabbhi.com/api/v1/plans
<?php
$client->plan->all();
client.plan.all()
PayabbhiCollection<Plan> plans = Plan.all();
client.Plan.All();
payabbhi.plans.all(
  (error, plans) => {
    ...
});
Payabbhi::Plan.all

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/plans?count=2
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->plan->all(array('count'=>2));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.plan.all(data={'count': 2})
import com.payabbhi.Payabbhi;
Payabbhi.accessId =  "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Plan> planCollection = Plan.all(
        new HashMap<String, Object>() {
          {
            put("count", 2);
          }
        });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var plans = client.Plan.All(new Dictionary<string, object>() {
                {"count", 2}});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.plans.all({ count: 2 },
  (error, plans) => {
    // plans is list of Plan Objects
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
plans = Payabbhi::Plan.all count: 2

JSON Response

com.payabbhi.model.PayabbhiCollection<Plan> JSON :
{
  "total_count": 2,
  "object": "list",
  "data": [
    {
      "id": "plan_P7wNUwTdGC2u2n2I",
      "object": "plan",
      "product_id": "prod_wJ6DyX5Bgg2LqAqt",
      "name": "",
      "amount": 100,
      "currency": "INR",
      "frequency": 2,
      "interval": "month(s)",
      "notes": null,
      "created_at": 1539158721
    },
    {
      "id": "plan_wUHIpy3ZOC7DzOvw",
      "object": "plan",
      "product_id": "prod_wJ6DyX5Bgg2LqAqt",
      "name": "",
      "amount": 100,
      "currency": "INR",
      "frequency": 2,
      "interval": "month(s)",
      "notes": null,
      "created_at": 1539001289
    }
  ]
}

Returns a list of plans created previously. The plans are listed in reverse chronological plan, with the most recent plan appearing first.

ARGUMENTS

count default is 10
A limit on the number of plan objects to be returned. This can range between 1 and 100.
skip default is 0
Represents number of plan objects to be skipped
from
A filter criterion based on the created_at field of the plan object. Value can be a timestamp. Returns Plans created on or after this timestamp.
to
A filter criterion based on the created_at field of the plan object. Value can be a timestamp. Returns Plans created on or before this timestamp.
product_id
A filter on the plan list based on the product_id field.

Returns

An object with total_count attribute containing the total count of plans matching the given request, object attribute containing list and a data attribute containing an array of plan objects.

Each element in the array of data attribute is a separate plan object. If no plans exist, the resulting array will be empty.

You can optionally set the filter criteria to only retrieve Plans that match the criteria.

Retrieve a plan

Definition

GET https://payabbhi.com/api/v1/plans/{plan_id}
<?php
$client->plan->retrieve({plan_id});
client.plan.retrieve({plan_id})
Plan plan = Plan.retrieve({plan_id})
client.Plan.Retrieve({plan_id});
payabbhi.plans.retrieve({planId},
  (error, plan) => {
    ...
});
Payabbhi::Plan.retrieve({plan_id})

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/plans/plan_tuOWN0Sc0uMB4s8E
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->plan->retrieve('plan_tuOWN0Sc0uMB4s8E');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.plan.retrieve('plan_tuOWN0Sc0uMB4s8E')
import com.payabbhi.Payabbhi;
Payabbhi.accessId =  "access_id";
Payabbhi.secretKey = "secret_key";
Plan plan = Plan.retrieve("plan_tuOWN0Sc0uMB4s8E");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var plan = client.Plan.Retrieve("plan_tuOWN0Sc0uMB4s8E");
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.plans.retrieve('plan_tuOWN0Sc0uMB4s8E',
  (error, plan) => {
    // plan is the Plan object retrieved
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
plan = Payabbhi::Plan.retrieve('plan_tuOWN0Sc0uMB4s8E')

JSON Response

com.payabbhi.model.Plan JSON :
{
  "id": "plan_tuOWN0Sc0uMB4s8E",
  "object": "plan",
  "product_id": "prod_wJ6DyX5Bgg2LqAqt",
  "name": "Basic",
  "amount": 100,
  "currency": "INR",
  "frequency": 2,
  "interval": "month(s)",
  "notes": null,
  "created_at": 1539001274
}

Returns a Plan object matching the plan_id. Else it returns an error response.

ARGUMENTS

plan_id
The identifier of the plan to be retrieved.

Returns

Returns a plan object, given a valid plan identifier was provided, and returns an error otherwise.

Subscriptions

The Subscription Object

JSON Response

com.payabbhi.model.Subscription JSON :
{
  "id": "sub_luQ4QIXzaEIN0g5D",
  "object": "subscription",
  "plan_id": "plan_tuOWN0Sc0uMB4s8E",
  "customer_id": "cust_2WmsQoSRZMWWkcZg",
  "billing_method": "recurring",
  "quantity": 1,
  "customer_notification_by": "merchant",
  "billing_cycle_count": 5,
  "paid_count": 0,
  "cancel_at_period_end": false,
  "due_at": 0,
  "trial_end_at": 0,
  "trial_duration": 0,
  "status": "cancelled",
  "mandate": {
      "id": "mdt_pJu25vSxB6Q9aqx7",
      "object": "mandate",
      "method": "bank_account",
      "instrument": "bank-account",
      "bank": "Yes Bank",
      "error_description": "",
      "url": "https://payabbhi.com/hosted/v1/subscriptions/authorize/live/sub_luQ4QIXzaEIN0g5D",
      "status": "authorized",
      "subscription_id": "sub_luQ4QIXzaEIN0g5D",
      "customer_id": "cust_2WmsQoSRZMWWkcZg",
      "created_at": 1539008001
  },
  "current_start_at": 1539007999,
  "current_end_at": 1544278399,
  "ended_at": 0,
  "cancelled_at": 1539008085,
  "created_at": 1539008001,
  "notes": null
}

ATTRIBUTES

id string
Unique identifier of subscription object.
object string, value is "subscription"
Represents the object type which in this case is subscription.
plan_id string
The unique identifier of the Plan against which this subscription is to be created.
customer_id string
The unique identifier of the Customer who has subscribed to the Plan.
billing_method string
Billing mode of the Subscription. The value can be either recurring or manual. The default value is recurring.
quantity positive integer
The quantity of the plan to which the customer is subscribed. For example, if the plan is 100 INR/user/week and your customer has 10 users, quantity should be passed as 10. The customer is charged 1000 INR weekly. The default value of quantity is set as 1.
customer_notification_by string
Indicates who is responsible for sending notifications to the customers for important subscription life cycle events. The value can be either merchant or platform. The default value is merchant.
billing_cycle_count positive integer
Total no. of billing cycles, that the customer should pay for the subscription. For example, if the customer is buying an annual subscription and billed monthly, the billing_cycle_count should be 12.
paid_count positive integer
No. of billing cycles for which the Customer has already paid successfully.
cancel_at_period_end boolean
Flag which determines if the subscription cancellation to be scheduled till the end of the current billing cycle. If the subscription has been cancelled with the at_billing_cycle_end flag set to true, cancel_at_period_end on the subscription will be set to true.
due_at timestamp
Timestamp at which the invoices generated by this subscription should be paid by a customer. This is applicable only when billing_method is manual.
trial_end_at timestamp
Timestamp at which the trial for the subscription should end. Measured in seconds since the Unix epoch.
trial_duration positive integer
Duration of the trial period in days.
status string
The status of the subscription is one of active, in_trial, expired, past_due, on_hold, cancelled or completed.
current_start_at timestamp
Start Timestamp of the current billing cycle. Measured in seconds since the Unix epoch.
current_end_at timestamp
End Timestamp of the current billing cycle. Measured in seconds since the Unix epoch.
ended_at timestamp
Timestamp at which the subscription was ended. Measured in seconds since the Unix epoch.
cancelled_at timestamp
Timestamp at which the subscription was cancelled. Measured in seconds since the Unix epoch.
notes json object
Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the subscription object in a structured format.
created_at timestamp
Subscription creation timestamp. Measured in seconds since the Unix epoch.

Create a subscription

Definition

POST https://payabbhi.com/api/v1/subscriptions
<?php
$client->subscription->create();
client.subscription.create()
Subscription subscription = Subscription.create();
client.Subscription.Create();
payabbhi.subscriptions.create(
  (error, subscription) => {
  ...
});
Payabbhi::Subscription.create

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/subscriptions \
  -d plan_id=plan_tuOWN0Sc0uMB4s8E \
  -d customer_id=cust_2WmsQoSRZMWWkcZg \
  -d billing_cycle_count=5
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->subscription->create(array("plan_id" => "plan_tuOWN0Sc0uMB4s8E",
                                    "customer_id" => "cust_2WmsQoSRZMWWkcZg", "billing_cycle_count" => 5));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.subscription.create(data={'plan_id': 'plan_tuOWN0Sc0uMB4s8E',
                                 'customer_id': 'cust_2WmsQoSRZMWWkcZg',
                                 'billing_cycle_count': 5
                                })
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Subscription subscription =
    Subscription.create(
        new HashMap<String, Object>() {
          {
            put("plan_id", "plan_tuOWN0Sc0uMB4s8E");
            put("billing_cycle_count", 5);
            put("customer_id", "cust_2WmsQoSRZMWWkcZg");
          }
        });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var subscription = client.Subscription.Create(new Dictionary<string, object>() {
  {"plan_id", "plan_tuOWN0Sc0uMB4s8E"},
  {"customer_id", "cust_2WmsQoSRZMWWkcZg"},
  {"billing_cycle_count", 5},
});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.subscriptions.create({
      plan_id: 'plan_tuOWN0Sc0uMB4s8E',
      customer_id: 'cust_2WmsQoSRZMWWkcZg',
      billing_cycle_count: 5
    }, (error, subscription) => {
      // subscription contains created subscription details in JSON format.
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
subscription = Payabbhi::Subscription.create customer_id: 'cust_2WmsQoSRZMWWkcZg',
                                             plan_id: 'plan_tuOWN0Sc0uMB4s8E',
                                             billing_cycle_count: 5

JSON Response

com.payabbhi.model.Subscription JSON :
{
  "id": "sub_xLH108FJwUlX47SI",
  "object": "subscription",
  "plan_id": "plan_tuOWN0Sc0uMB4s8E",
  "customer_id": "cust_2WmsQoSRZMWWkcZg",
  "billing_method": "recurring",
  "quantity": 1,
  "customer_notification_by": "merchant",
  "billing_cycle_count": 5,
  "paid_count": 0,
  "cancel_at_period_end": false,
  "due_at": 0,
  "trial_end_at": 0,
  "trial_duration": 0,
  "status": "active",
  "mandate": {
      "id": "mdt_pJu25vSxB6Q9aqx7",
      "object": "mandate",
      "method": "",
      "instrument": "",
      "bank": "",
      "error_description": "",
      "url": "https://payabbhi.com/hosted/v1/subscriptions/authorize/live/sub_xLH108FJwUlX47SI",
      "status": "created",
      "subscription_id": "sub_xLH108FJwUlX47SI",
      "customer_id": "cust_2WmsQoSRZMWWkcZg",
      "created_at": 1539171807
  },
  "current_start_at": 1539171804,
  "current_end_at": 1544442204,
  "ended_at": 0,
  "cancelled_at": 0,
  "created_at": 1539171807,
  "notes": null
}

Creates a new subscription.

ARGUMENTS

plan_id
The unique identifier of the Plan against which this subscription is to be created.
customer_id
The unique identifier of the Customer who is subscribing to the plan.
billing_cycle_count
Total no. of billing cycles. This represents how long the subscription will run.
billing_method
Billing mode of the Subscription. The value can be either recurring or manual. The default value is recurring.
quantity
The quantity of the plan to which the customer is subscribed. For example, if the plan is 100 INR/user/week and your customer has 10 users, quantity should be passed as 10. The customer is charged 1000 INR weekly. The default value of quantity is set as 1.
customer_notification_by
Indicates who is responsible for sending notifications to the customers for important subscription life cycle events. The value can be either merchant or platform. The default value is merchant.
trial_duration
Duration of the trial period in days.
due_by_days
No. of days by which the invoices associated with the subscription should be paid starting from the Invoice Issue date. This is applicable only when billing_method is manual.
notes
Notes is a key-value store used for storing additional data relating to the subscription object in structured format.
upfront_items
List of item objects to be included as upfront charges or set up fees of the subscription.

Returns

Returns the subscription object if the subscription is created successfully. Else it returns an error response.

Cancel a subscription

Definition

POST https://payabbhi.com/api/v1/subscriptions/{subscription_id}/cancel
<?php
$client->subscription->cancel({subscription_id});
client.subscription.cancel({subscription_id})
Subscription subscription = Subscription.cancel({subscription_id});
client.Subscription.Retrieve({subscription_id}).Cancel();
payabbhi.subscriptions.cancel({subscriptionId},
  (error, subscription) => {
    ...
});
Payabbhi::Subscription.cancel({subscription_id})

Example Request:

$ curl -u access_id:secret_key -X POST \
  https://payabbhi.com/api/v1/subscriptions/sub_luQ4QIXzaEIN0g5D/cancel
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->subscription->cancel('sub_luQ4QIXzaEIN0g5D');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.subscription.cancel('sub_luQ4QIXzaEIN0g5D')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Subscription subscription = Subscription.cancel("sub_luQ4QIXzaEIN0g5D");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var subscription = client.Subscription.Retrieve("sub_luQ4QIXzaEIN0g5D").Cancel();
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.subscriptions.cancel('sub_luQ4QIXzaEIN0g5D', {
      at_billing_cycle_end: false
    }, (error, subscription) => {
      // subscription contains cancelled subscription details in JSON format.
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
subscription = Payabbhi::Subscription.cancel('sub_luQ4QIXzaEIN0g5D')

JSON Response

com.payabbhi.model.Subscription JSON :
{
  "id": "sub_luQ4QIXzaEIN0g5D",
  "object": "subscription",
  "plan_id": "plan_tuOWN0Sc0uMB4s8E",
  "customer_id": "cust_2WmsQoSRZMWWkcZg",
  "billing_method": "recurring",
  "quantity": 1,
  "customer_notification_by": "merchant",
  "billing_cycle_count": 5,
  "paid_count": 0,
  "cancel_at_period_end": false,
  "due_at": 0,
  "trial_end_at": 0,
  "trial_duration": 0,
  "status": "cancelled",
  "mandate": {
      "id": "mdt_pJu25vSxB6Q9aqx7",
      "object": "mandate",
      "method": "bank_account",
      "instrument": "bank-account",
      "bank": "Yes Bank",
      "error_description": "",
      "url": "https://payabbhi.com/hosted/v1/subscriptions/authorize/live/sub_luQ4QIXzaEIN0g5D",
      "status": "authorized",
      "subscription_id": "sub_luQ4QIXzaEIN0g5D",
      "customer_id": "cust_2WmsQoSRZMWWkcZg",
      "created_at": 1539008001
  },
  "current_start_at": 1539007999,
  "current_end_at": 1544278399,
  "ended_at": 0,
  "cancelled_at": 1539008085,
  "created_at": 1539008001,
  "notes": null
}

ARGUMENTS

subscription_id
The identifier of the subscription which needs to be cancelled.
at_billing_cycle_end
The flag which determines if the Subscription to be cancelled immediately or at the end of the current billing cycle. The default is set to false.

Returns

Returns the subscription object if the subscription is cancelled successfully. Else it returns an error response.

List all subscriptions

Definition

GET https://payabbhi.com/api/v1/subscriptions
<?php
$client->subscription->all();
client.subscription.all()
PayabbhiCollection<Subscription> subscriptions = Subscription.all();
client.Subscription.All();
payabbhi.subscriptions.all(
  (error, subscriptions) => {
    ...
});
Payabbhi::Subscription.all

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/subscriptions?count=2
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->subscription->all(array('count'=>2));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.subscription.all(data={'count': 2})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Subscription> subscriptions = Subscription.all(
        new HashMap<String, Object>() {
            {
              put("count", 2);
            }
        });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var subscriptions = client.Subscription.All(new Dictionary<string, object>() {
                {"count", 2}});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.subscriptions.all({ count: 2 },
  (error, subscriptions) => {
    // subscriptions is list of Subscription Objects
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
subscriptions = Payabbhi::Subscription.all count: 2

JSON Response

com.payabbhi.model.Subscription JSON :
{
  "total_count": 2,
  "object": "list",
  "data": [
    {
      "id": "sub_xLH108FJwUlX47SI",
      "object": "subscription",
      "plan_id": "plan_tuOWN0Sc0uMB4s8E",
      "customer_id": "cust_2WmsQoSRZMWWkcZg",
      "billing_method": "recurring",
      "quantity": 1,
      "customer_notification_by": "merchant",
      "billing_cycle_count": 5,
      "paid_count": 0,
      "cancel_at_period_end": false,
      "due_at": 0,
      "trial_end_at": 0,
      "trial_duration": 0,
      "status": "active",
      "mandate": {
          "id": "mdt_pJu25vSxB6Q9aqx7",
          "object": "mandate",
          "method": "bank_account",
          "instrument": "bank-account",
          "bank": "Yes Bank",
          "error_description": "",
          "url": "https://payabbhi.com/hosted/v1/subscriptions/authorize/live/sub_xLH108FJwUlX47SI",
          "status": "authorized",
          "subscription_id": "sub_xLH108FJwUlX47SI",
          "customer_id": "cust_2WmsQoSRZMWWkcZg",
          "created_at": 1539171807
      },  
      "current_start_at": 1539171804,
      "current_end_at": 1544442204,
      "ended_at": 0,
      "cancelled_at": 0,
      "created_at": 1539171807,
      "notes": null
    },
    {
      "id": "sub_luQ4QIXzaEIN0g5D",
      "object": "subscription",
      "plan_id": "plan_tuOWN0Sc0uMB4s8E",
      "customer_id": "cust_2WmsQoSRZMWWkcZg",
      "billing_method": "manual",
      "quantity": 1,
      "customer_notification_by": "merchant",
      "billing_cycle_count": 5,
      "paid_count": 0,
      "cancel_at_period_end": false,
      "due_at": 0,
      "trial_end_at": 0,
      "trial_duration": 0,
      "status": "cancelled",
      "mandate": null,
      "current_start_at": 1539007999,
      "current_end_at": 1544278399,
      "ended_at": 0,
      "cancelled_at": 1539008085,
      "created_at": 1539008001,
      "notes": null
    }
  ]
}

Returns a list of subscriptions created previously. The subscriptions are listed in reverse chronological order, with the most recent subscription appearing first.

ARGUMENTS

count default is 10
A limit on the number of subscription objects to be returned. This can range between 1 and 100.
skip default is 0
Represents number of subscription objects to be skipped
from
A filter criterion based on the created_at field of the subscription object. Value can be a timestamp. Returns Subscriptions created on or after this timestamp.
to
A filter criterion based on the created_at field of the subscription object. Value can be a timestamp. Returns Subscriptions created on or before this timestamp.
plan_id
A filter on the subscription list based on the plan_id field.
status
The status of the subscription is one of active, in_trial, expired, past_due, on_hold, cancelled or completed.
billing_method
Billing method can be either recurring or manual.
customer_id
A filter on the subscription list based on the customer_id field.

Returns

An object with total_count attribute containing the total count of subscriptions matching the given request, object attribute containing list and a data attribute containing an array of subscription objects.

Each element in the array of data attribute is a separate subscription object. If no subscriptions exist, the resulting array will be empty.

You can optionally set the filter criteria to only retrieve Subscriptions that match the criteria.

Retrieve a subscription

Definition

GET https://payabbhi.com/api/v1/subscriptions/{subscription_id}
<?php
$client->subscription->retrieve({subscription_id});
client.subscription.retrieve({subscription_id})
Subscription subscription = Subscription.retrieve({subscription_id});
client.Subscription.Retrieve({subscription_id});
payabbhi.subscriptions.retrieve({subscriptionId},
  (error, subscription) => {
    ...
});
Payabbhi::Subscription.retrieve({subscription_id})

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/subscriptions/sub_luQ4QIXzaEIN0g5D
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->subscription->retrieve('sub_luQ4QIXzaEIN0g5D');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.subscription.retrieve('sub_luQ4QIXzaEIN0g5D')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Subscription subscription = Subscription.retrieve("sub_luQ4QIXzaEIN0g5D");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var subscription = client.Subscription.Retrieve("sub_luQ4QIXzaEIN0g5D");
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.subscriptions.retrieve('sub_luQ4QIXzaEIN0g5D',
  (error, subscription) => {
    // subscription is the Subscription object retrieved
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
subscription = Payabbhi::Subscription.retrieve('sub_luQ4QIXzaEIN0g5D')

JSON Response

com.payabbhi.model.Subscription JSON :
{
  "id": "sub_luQ4QIXzaEIN0g5D",
  "object": "subscription",
  "plan_id": "plan_tuOWN0Sc0uMB4s8E",
  "customer_id": "cust_2WmsQoSRZMWWkcZg",
  "billing_method": "recurring",
  "quantity": 1,
  "customer_notification_by": "merchant",
  "billing_cycle_count": 5,
  "paid_count": 0,
  "cancel_at_period_end": false,
  "due_at": 0,
  "trial_end_at": 0,
  "trial_duration": 0,
  "status": "cancelled",
  "mandate": {
      "id": "mdt_pJu25vSxB6Q9aqx7",
      "object": "mandate",
      "method": "bank_account",
      "instrument": "bank-account",
      "bank": "Yes Bank",
      "error_description": "",
      "url": "https://payabbhi.com/hosted/v1/subscriptions/authorize/live/sub_luQ4QIXzaEIN0g5D",
      "status": "authorized",
      "subscription_id": "sub_luQ4QIXzaEIN0g5D",
      "customer_id": "cust_2WmsQoSRZMWWkcZg",
      "created_at": 1539008001
  },
  "current_start_at": 1539007999,
  "current_end_at": 1544278399,
  "ended_at": 0,
  "cancelled_at": 1539008085,
  "created_at": 1539008001,
  "notes": null
}

Returns a Subscription object matching the subscription_id. Else it returns an error response.

ARGUMENTS

subscription_id
The identifier of the subscription to be retrieved.

Returns

Returns a subscription object, given a valid subscription identifier was provided, and returns an error otherwise.

Invoice Items

The Invoice Item Object

JSON Response

com.payabbhi.model.InvoiceItem JSON :
{
  "id": "item_zvenYE0Tk8qTUaER",
  "object": "invoiceitem",
  "name": "Line Item",
  "description": "",
  "amount": 200,
  "currency": "INR",
  "customer_id": "cust_2WmsQoSRZMWWkcZg",
  "quantity": 10,
  "created_at": 1539008001,
  "notes": null,
  "deleted_at": 1539119111,
  "unit": "",
  "hsn_code": "hsn_code",
  "sac_code": "",
  "tax_rate": 500,
  "cess": 200,
  "tax_inclusive": false,
  "discount": 20,
  "tax_amount": 138,
  "net_amount": 2118,
  "taxable_amount": 1980,
  "gross_amount": 1980
}

ATTRIBUTES

id string
Unique identifier of invoice item object.
object string, value is "invoiceitem"
Represents the object type which in this case is invoiceitem.
name string
Name of the Invoice Item, which should be displayed in the invoice.
amount positive integer
Rate of the Invoice Item. A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00). Minimum amount is 100 paise.
currency string
Three-letter ISO currency code. Currently only INR is supported.
description string
Description of the Invoice Item.
unit string
This describes the unit of the Invoice Item being charged. Ex : pieces.
quantity positive integerdefault value is 1
Quantity of units for the invoice item, for which the customer is being charged.
discount positive integer
Discount applied on the invoice item.
hsn_code string
HSN (Harmonized System of Nomenclature) is used to classify goods from all over the world in a systematic and logical manner. This is applicable for gst compliant item.
sac_code string
SAC (Services Accounting Code) is used to classify services uniformly for recognition, measurement and taxation. This is applicable for gst compliant item.
tax_rate positive integer
GST rate of Invoice Item. Tax break-up will be calculated automatically based on the rate. The tax_rate is one of 5, 12,18, 28 . The default value is 0.
cess positive integer
GST cess is an additional indirect tax that is being charged in addition to the normal GST rates.
tax_inclusive booleandefault value is true
Flag to indicate if the amount is tax inclusive or not. This is applicable only when the tax_rate is more than 0.
tax_amount positive integer
Total tax applicable for this invoice item.
net_amount integer
Net amount to be paid for this Invoice Item.
customer_id string
The unique identifier of the Customer who will be paying this Invoice Item.
deleted_at timestamp
Timestamp at which the invoice item was deleted. Measured in seconds since the Unix epoch.
notes json object
Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the invoiceitem object in a structured format.
created_at timestamp
Invoice Item creation timestamp. Measured in seconds since the Unix epoch.

Create an invoice item

Definition

POST https://payabbhi.com/api/v1/invoiceitems
<?php
$client->invoiceitem->create();
client.invoiceitem.create()
InvoiceItem invoiceitem = InvoiceItem.create();
client.InvoiceItem.Create();
payabbhi.invoiceitems.create(
  (error, invoiceitem) => {
  ...
});
Payabbhi::InvoiceItem.create

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/invoiceitems \
  -d customer_id=cust_2WmsQoSRZMWWkcZg \
  -d name="Line Item" \
  -d unit="unit" \
  -d amount=200 \
  -d quantity=10 \
  -d currency=INR \
  -d discount=20 \
  -d hsn_code="hsn_code" \
  -d cess=200 \
  -d tax_rate=500 \
  -d tax_inclusive=false
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->invoiceitem->create(array("customer_id" => "cust_2WmsQoSRZMWWkcZg",
                                "name" => "Line Item",
                                "amount" => 200, "currency" => "INR" ,
                                "unit" => "unit", "quantity" => 10,
                                "discount" => 20, "hsn_code" => "hsn_code",
                                "cess"  => 200, "tax_rate" => 500,
                                "tax_inclusive" => false
                          ));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.invoiceitem.create(data={'customer_id': 'cust_2WmsQoSRZMWWkcZg',
                                'name': 'Line Item',
                                'currency': 'INR',
                                'amount': 200
                               })
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
InvoiceItem invoiceitem =
    InvoiceItem.create(
        new HashMap<String, Object>() {
          {
            put("name", "Line Item");
            put("amount", 200);
            put("currency", "INR");
            put("customer_id", "cust_2WmsQoSRZMWWkcZg");
            put("unit", "unit");
            put("quantity", 10);
            put("discount", 20);
            put("hsn_code", "hsn_code");
            put("cess", 200);
            put("tax_rate", 500);
            put("tax_inclusive", false);
          }
        });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var invoiceItem = client.InvoiceItem.Create(new Dictionary<string, object>() {
  {"name", "Line Item"},
  {"customer_id", "cust_2WmsQoSRZMWWkcZg"},
  {"amount", 200},
  {"currency", "INR"},
  {"unit", "unit"},
  {"quantity", 10},
  {"discount", 20},
  {"hsn_code", "hsn_code"},
  {"cess", 200},
  {"tax_rate", 500},
  {"tax_inclusive", false},
});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.invoiceitems.create({
      customer_id: 'cust_2WmsQoSRZMWWkcZg',
      name: 'Line Item',
      currency: 'INR',
      amount: 200,
      unit: "unit",
      quantity: 10,
      discount: 20,
      hsn_code: "hsn_code",
      cess: 200,
      tax_rate: 500,
      tax_inclusive: false
    }, (error, invoiceitem) => {
      // invoiceitem contains created invoiceitem details in JSON format.
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
invoiceitem = Payabbhi::InvoiceItem.create customer_id: 'cust_2WmsQoSRZMWWkcZg',
                                           name: 'Line Item',
                                           currency: 'INR',
                                           amount: 200,
                                           unit: "unit",
                                           quantity: 10,
                                           discount: 20,
                                           hsn_code: "hsn_code",
                                           cess: 200,
                                           tax_rate: 500,
                                           tax_inclusive: false

JSON Response

com.payabbhi.model.InvoiceItem JSON :
{
  "id": "item_OQ4jsxy3aMwYE9T7",
  "object": "invoiceitem",
  "name": "Line Item",
  "description": "",
  "amount": 200,
  "currency": "INR",
  "customer_id": "cust_2WmsQoSRZMWWkcZg",
  "quantity": 10,
  "created_at": 1554359921,
  "notes": null,
  "deleted_at": 0,
  "unit": "",
  "hsn_code": "hsn_code",
  "sac_code": "",
  "tax_rate": 500,
  "cess": 200,
  "tax_inclusive": false,
  "discount": 20,
  "tax_amount": 138,
  "net_amount": 2118,
  "taxable_amount": 1980,
  "gross_amount": 1980

}

Creates a new invoice item.

ARGUMENTS

customer_id
The unique identifier of the Customer who will pay this invoice.
name
Name of the Invoice Item, which should be displayed in the invoice.
amount
Rate of the Invoice Item. A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00). Minimum amount is 100 paise.
currency
Three-letter ISO currency code. Currently only INR is supported.
description
Description of the Invoice Item.
unit
This describes the unit of the Invoice Item being charged. Ex : pieces.
quantity default value is 1
Quantity of units for the invoice item, for which the customer is being charged.
discount
Discount applied on the invoice item.
hsn_code
HSN (Harmonized System of Nomenclature) is used to classify goods from all over the world in a systematic and logical manner. This is applicable for gst compliant item.
sac_code
SAC (Services Accounting Code) is used to classify services uniformly for recognition, measurement and taxation. This is applicable for gst compliant item.
tax_rate
GST rate of Invoice Item. Tax break-up will be calculated automatically based on the rate. The tax_rate is one of 5, 12,18, 28 . The default value is 0.
cess
GST cess is an additional indirect tax that is being charged in addition to the normal GST rates.
tax_inclusive default value is true
Flag to indicate if the amount is tax inclusive or not. This is applicable only when the tax_rate is more than 0.
notes
Notes is a key-value store used for storing additional data relating to the invoice item object in structured format.
invoice_id
The unique identifier of the Invoice to which this invoice item is to be added. This is applicable only when the item is associated with a draft invoice.
subscription_id
The unique identifier of the Subscription to which this invoice item is to be added as an addon. This invoice item will appear in the invoice of the subscriptions' next billing cycle.

Returns

Returns the invoice item object if the invoice item is created successfully. Else it returns an error response.

Delete an invoice item

Definition

DELETE https://payabbhi.com/api/v1/invoiceitems/{invoiceitem_id}
<?php
$client->invoiceitem->delete({invoiceitem_id});
client.invoiceitem.delete({invoiceitem_id})
InvoiceItem invoiceitem = InvoiceItem.delete({invoiceitem_id});
client.InvoiceItem.Retrieve({invoiceitem_id}).Delete();
payabbhi.invoiceitems.delete({invoiceitemId},
  (error, invoiceitem) => {
    ...
});
Payabbhi::InvoiceItem.delete({invoiceitem_id})

Example Request:

$ curl -u access_id:secret_key -X DELETE \
  https://payabbhi.com/api/v1/invoiceitems/item_2MAlPM205eXk65Fx
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->invoiceitem->delete('item_2MAlPM205eXk65Fx');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.invoiceitem.delete('item_2MAlPM205eXk65Fx')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
InvoiceItem invoiceitem = InvoiceItem.delete("item_2MAlPM205eXk65Fx");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var invoiceItem = client.InvoiceItem.Retrieve("item_2MAlPM205eXk65Fx").Delete();
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.invoiceitems.delete('item_2MAlPM205eXk65Fx',
  (error, invoiceitem) => {
    // invoiceitem contains deleted invoiceitem details in JSON format.
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
invoiceitem = Payabbhi::InvoiceItem.delete('item_2MAlPM205eXk65Fx')

JSON Response

com.payabbhi.model.InvoiceItem JSON :
{
  "id": "item_2MAlPM205eXk65Fx",
  "object": "invoiceitem",
  "name": "N3",
  "description": "D3",
  "amount": 200,
  "currency": "INR",
  "customer_id": "cust_2WmsQoSRZMWWkcZg",
  "quantity": 12,
  "created_at": 1539074485,
  "notes": null,
  "deleted_at": 1539119111,
  "unit": "",
  "hsn_code": "hsn_code",
  "sac_code": "",
  "tax_rate": 500,
  "cess": 200,
  "tax_inclusive": false,
  "discount": 20,
  "tax_amount": 138,
  "net_amount": 2118,
  "taxable_amount": 1980,
  "gross_amount": 1980
}

ARGUMENTS

invoiceitem_id
The unique identifier of the Invoice Item which will be deleted.

Returns

Returns the invoice item object if the invoice item is deleted successfully. Else it returns an error response.

List all invoice items

Definition

GET https://payabbhi.com/api/v1/invoiceitems
<?php
$client->invoiceitem->all();
client.invoiceitem.all()
PayabbhiCollection<InvoiceItem> invoiceitems = InvoiceItem.all();
client.InvoiceItem.All();
payabbhi.invoiceitems.all(
  (error, invoiceitems) => {
    ...
});
Payabbhi::InvoiceItem.all

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/invoiceitems?count=2
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->invoiceitem->all(array('count'=>2));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.invoiceitem.all(data={'count': 2})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<InvoiceItem> invoiceitems = InvoiceItem.all(
        new HashMap<String, Object>() {
          {
            put("count", 2);
          }
        });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var invoiceItems = client.InvoiceItem.All(new Dictionary<string, object>() {
                {"count", 2}});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.invoiceitems.all({ count: 2 },
  (error, invoiceitems) => {
    // invoiceitems is list of Invoiceitem Objects
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
invoiceitems = Payabbhi::InvoiceItem.all count: 2

JSON Response

com.payabbhi.model.InvoiceItem JSON :
{
  "total_count": 2,
  "object": "list",
  "data": [
    {
      "id": "item_jYGaYf14SeZ13DkJ",
      "object": "invoiceitem",
      "name": "Line Item",
      "description": "",
      "amount": 200,
      "currency": "INR",
      "customer_id": "cust_2WmsQoSRZMWWkcZg",
      "quantity": 10,
      "created_at": 1539174368,
      "notes": null,
      "deleted_at": 0,
      "unit": "",
      "hsn_code": "hsn_code",
      "sac_code": "",
      "tax_rate": 500,
      "cess": 200,
      "tax_inclusive": false,
      "discount": 20,
      "tax_amount": 138,
      "net_amount": 2118,
      "taxable_amount": 1980,
      "gross_amount": 1980
    },
    {
      "id": "item_I9Gh0wJHJ2tvorbT",
      "object": "invoiceitem",
      "name": "Line Item",
      "description": "",
      "amount": 200,
      "currency": "INR",
      "customer_id": "cust_2WmsQoSRZMWWkcZg",
      "quantity": 10,
      "created_at": 1539171807,
      "notes": null,
      "deleted_at": 1549171807,
      "unit": "",
      "hsn_code": "hsn_code",
      "sac_code": "",
      "tax_rate": 500,
      "cess": 200,
      "tax_inclusive": false,
      "discount": 20,
      "tax_amount": 138,
      "net_amount": 2118,
      "taxable_amount": 1980,
      "gross_amount": 1980
    }
  ]
}

Returns a list of invoice items created previously. The invoice items are listed in reverse chronological order, with the most recent invoice item appearing first.

ARGUMENTS

count default is 10
A limit on the number of invoice item objects to be returned. This can range between 1 and 100.
skip default is 0
Represents number of invoice item objects to be skipped
from
A filter criterion based on the created_at field of the invoice item object. Value can be a timestamp. Returns Invoice items created on or after this timestamp.
to
A filter criterion based on the created_at field of the invoice item object. Value can be a timestamp. Returns invoice items created on or before this timestamp.

Returns

An object with total_count attribute containing the total count of invoice items matching the given request, object attribute containing list and a data attribute containing an array of invoice item objects.

Each element in the array of data attribute is a separate invoice item object. If no invoice items exist, the resulting array will be empty.

You can optionally set the filter criteria to only retrieve invoice items that match the criteria.

Retrieve an invoice item

Definition

GET https://payabbhi.com/api/v1/invoiceitems/{invoiceitem_id}
<?php
$client->invoiceitem->retrieve({invoiceitem_id});
client.invoiceitem.retrieve({invoiceitem_id})
InvoiceItem invoiceitem = InvoiceItem.retrieve({invoiceitem_id});
client.InvoiceItem.Retrieve({invoiceitem_id})
payabbhi.invoiceitems.retrieve({invoiceitemId},
  (error, invoiceitem) => {
    ...
});
Payabbhi::InvoiceItem.retrieve({invoiceitem_id})

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/invoiceitems/item_zvenYE0Tk8qTUaER
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->invoiceitem->retrieve('item_zvenYE0Tk8qTUaER');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.invoiceitem.retrieve('item_zvenYE0Tk8qTUaER')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
InvoiceItem invoiceitem = InvoiceItem.retrieve("item_zvenYE0Tk8qTUaER");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var invoiceItem = client.InvoiceItem.Retrieve("item_zvenYE0Tk8qTUaER");
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.invoiceitems.retrieve('item_zvenYE0Tk8qTUaER',
  (error, invoiceitem) => {
    // invoiceitem is the Invoiceitem object retrieved
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
invoiceitem = Payabbhi::InvoiceItem.retrieve('item_zvenYE0Tk8qTUaER')

JSON Response

com.payabbhi.model.InvoiceItem JSON :
{
  "id": "item_zvenYE0Tk8qTUaER",
  "object": "invoiceitem",
  "name": "Line Item",
  "description": "",
  "amount": 200,
  "currency": "INR",
  "customer_id": "cust_2WmsQoSRZMWWkcZg",
  "quantity": 10,
  "created_at": 1539008001,
  "notes": null,
  "deleted_at": 0,
  "unit": "",
  "hsn_code": "hsn_code",
  "sac_code": "",
  "tax_rate": 500,
  "cess": 200,
  "tax_inclusive": false,
  "discount": 20,
  "tax_amount": 138,
  "net_amount": 2118,
  "taxable_amount": 1980,
  "gross_amount": 1980
}

Returns a Invoice Item object matching the invoiceitem_id. Else it returns an error response.

ARGUMENTS

invoiceitem_id
The identifier of the invoice item to be retrieved.

Returns

Returns a invoice item object, given a valid invoice item identifier was provided, and returns an error otherwise.

List all invoices for an invoice item

Definition

GET https://payabbhi.com/api/v1/invoiceitems/{invoiceitem_id}/invoices
<?php
$client->invoiceitem->invoices({invoiceitem_id});
client.invoiceitem.invoices({invoiceitem_id})
PayabbhiCollection<Invoice> invoices = InvoiceItem.invoices({invoice_item_id});
client.InvoiceItem.Retrieve({invoiceitem_id}).Invoices()
payabbhi.invoiceitems.invoices({invoiceitemId},
  (error, invoices) => {
    ...
});
Payabbhi::InvoiceItem.invoices({invoiceitem_id})

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/invoiceitems/item_zvenYE0Tk8qTUaER/invoices
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->invoiceitem->invoices('item_zvenYE0Tk8qTUaER');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.invoiceitem.invoices("item_zvenYE0Tk8qTUaER")
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Invoice> invoices = InvoiceItem.invoices("item_zvenYE0Tk8qTUaER");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var invoices = client.InvoiceItem.Retrieve("item_zvenYE0Tk8qTUaER").Invoices();
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.invoiceitems.invoices('item_zvenYE0Tk8qTUaER',
  (error, invoices) => {
    // invoices is the list of Invoices object with given invoiceitem
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
invoices = Payabbhi::InvoiceItem.invoices('item_zvenYE0Tk8qTUaER')

JSON Response


{
  "total_count": 2,
  "object": "list",
  "data": [
    {
      "id": "invt_v1uXGmhIUMylFQPS",
      "object": "invoice",
      "gross_amount": 180,
      "tax_amount": 12,
      "amount": 192,
      "billing_method": "recurring",
      "customer_id": "cust_2WmsQoSRZMWWkcZg",
      "currency": "INR",
      "created_at": 1539177115,
      "description": "Test Invoice",
      "due_date": 1549176945,
      "line_items": {
        "total_count": 2,
        "object": "list",
        "data": [
          {
            "id": "item_zvenYE0Tk8qTUaER",
            "object": "invoiceitem",
            "name": "Item1",
            "description": "",
            "amount": 500,
            "currency": "INR",
            "customer_id": "cust_VD9uYO8uc29b4hY8",
            "quantity": 1,
            "created_at": 1539179491,
            "notes": null,
            "deleted_at": 0,
            "unit": "",
            "hsn_code": "hsn_code",
            "sac_code": "",
            "tax_rate": 500,
            "cess": 200,
            "tax_inclusive": false,
            "discount": 20,
            "tax_amount": 12,
            "net_amount": 192,
            "taxable_amount": 180,
            "gross_amount": 180
          }
        ]
      },
      "notes": {
        "mode": "test"
      },
      "notify_by": "email",
      "payment_attempt": 0,
      "invoice_no": "123123123123",
      "status": "issued",
      "subscription_id": "",
      "url": "https://payabbhi.com/zrt2zlh5",
      "place_of_supply": "Delhi",
      "terms_conditions": "terms_conditions",
      "customer_notes": "customer_notes"
    },
    {
      "id": "invt_srxOZZk6dIgWTVls",
      "object": "invoice",
      "gross_amount": 180,
      "tax_amount": 12,
      "amount": 192,
      "billing_method": "manual",
      "customer_id": "cust_2WmsQoSRZMWWkcZg",
      "currency": "INR",
      "created_at": 1539171807,
      "description": "",
      "due_date": 1539171804,
      "line_items": {
        "total_count": 1,
        "object": "list",
        "data": [
          {
            "id": "item_zvenYE0Tk8qTUaER",
            "object": "invoiceitem",
            "name": "Item1",
            "description": "",
            "amount": 500,
            "currency": "INR",
            "customer_id": "cust_VD9uYO8uc29b4hY8",
            "quantity": 1,
            "created_at": 1539179491,
            "notes": null,
            "deleted_at": 0,
            "unit": "",
            "hsn_code": "hsn_code",
            "sac_code": "",
            "tax_rate": 500,
            "cess": 200,
            "tax_inclusive": false,
            "discount": 20,
            "tax_amount": 12,
            "net_amount": 192,
            "taxable_amount": 180,
            "gross_amount": 180
          }
        ]
      },
      "notes": null,
      "notify_by": "email",
      "payment_attempt": 0,
      "invoice_no": "INV_90976164",
      "status": "issued",
      "subscription_id": "sub_xLH108FJwUlX47SI",
      "url": "https://payabbhi.com/zta7qvp8",
      "place_of_supply": "Delhi",
      "terms_conditions": "terms_conditions",
      "customer_notes": "customer_notes"
    }
  ]
}

Returns a list of invoices created previously. The invoices are listed in reverse chronological order, with the most recent invoice appearing first.

ARGUMENTS

invoiceitem_id
The identifier of the invoice item whose invoices are to be retrieved.

Returns

An object with total_count attribute containing the total count of invoices corresponding to the given Invoice Item, object attribute containing list and a data attribute containing an array of invoice objects.

Each element in the array of data attribute is a separate invoice object. If no invoice exists for the Invoice Item, the resulting array will be empty.

Invoices

The Invoice Object

JSON Response

com.payabbhi.model.Invoice JSON :
{
  "id": "invt_UZqFoPLamaZqLFkZ",
  "object": "invoice",
  "gross_amount": 180,
  "tax_amount": 12,
  "amount": 192,
  "amount_paid": 0,
  "amount_due": 192,
  "partial_payment_mode": false,
  "billing_method": "manual",
  "customer_id": "cust_2WmsQoSRZMWWkcZg",
  "currency": "INR",
  "created_at": 1539074485,
  "description": "Hello World",
  "due_date": 1540060199,
  "line_items": {
    "total_count": 1,
    "object": "list",
    "data": [
      {
        "id": "item_FL3nHHB7i7Fpcj1J",
        "object": "invoiceitem",
        "name": "Item1",
        "description": "",
        "amount": 500,
        "currency": "INR",
        "customer_id": "cust_VD9uYO8uc29b4hY8",
        "quantity": 1,
        "created_at": 1539179491,
        "notes": null,
        "deleted_at": 0,
        "unit": "",
        "hsn_code": "hsn_code",
        "sac_code": "",
        "tax_rate": 500,
        "cess": 200,
        "tax_inclusive": false,
        "discount": 20,
        "tax_amount": 12,
        "net_amount": 192,
        "taxable_amount": 180,
        "gross_amount": 180
      }
    ]
  },
  "notes": null,
  "notify_by": "email",
  "payment_attempt": 0,
  "invoice_no": "3123123123",
  "status": "issued",
  "subscription_id": "",
  "customer_notification_by":"platform",
  "url": "https://payabbhi.com/zpuoxajg",
  "place_of_supply": "Delhi",
  "terms_conditions": "terms_conditions",
  "customer_notes": "customer_notes"
}

ATTRIBUTES

id string
Unique identifier of invoice object.
object string, value is "invoice"
Represents the object type which in this case is invoice.
currency string
Three-letter ISO currency code. Currently only INR is supported.
billing_method string
The billing method of the invoice. The value can be either recurring or manual. The default value is manual.
description string
Description of the Invoice.
status string
Status of the invoice. The invoice status is one of issued, payment_attempted, partially_paid, paid, void or past_due.
due_date timestamp
Latest Timestamp by which the invoice should be paid by the customer. Measured in seconds since the Unix epoch. This will be null for invoices where billing_method is recurring
line_items list
List of line items that should be included as part of the invoice. Invoice Items are sorted in the reverse chronological order.
notify_by string
Describes how the customer would be notified about the invoice. The value is one of email, phone, both. The default value is email.
customer_notification_by string
Indicates who is responsible for sending notifications to the customers for important invoice life cycle events. The value can be either merchant or platform. The default value is platform.
payment_attempt positive integer or zero
Number of payment attempts against this invoice.
invoice_no string
The invoice_no at Merchant end which corresponds to this invoice. This appears in the Invoice and referred in all customer communication. It is a maximum of 16 characters.
url string
Shortened url generated for this invoice for customers to view and pay.
notes json object
Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the invoice object in a structured format.
place_of_supply string
Place of supply of goods under GST determines whether the payment will be counted as intra-state or inter-state. SGST, CGST & IGST will be levied accordingly.
gross_amount positive integer
Total gross amount
tax_amount positive integer
Total tax applicable for this invoice.
amount positive integer
Final amount due for the invoice. A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00). Minimum amount is 100 paise.
amount_paid positive integer
Amount paid against the invoice. A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00).
amount_due positive integer
Final amount due for the invoice. A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00). Minimum amount is 100 paise.
partial_payment_mode booleandefault value is false
Flag to indicate if partial payment is allowed against invoice. This is applicable only for invoice whose billing_method is manual.
customer_notes string
Customer Notes, which will appear in invoice and receipt.
terms_conditions string
Terms and Conditions applicable for the invoice.
subscription_id string
Unique identifier of the subscription for which this invoice is generated. This will be null for invoices where billing_method is manual.
customer_id string
Unique identifier of the customer who will pay this invoice.
created_at timestamp
Invoice creation timestamp. Measured in seconds since the Unix epoch.
issued_at timestamp
Timestamp when the invoice was issued to the customer
voided_at timestamp
Timestamp when the invoice was marked as void

Create an Invoice

Definition

POST https://payabbhi.com/api/v1/invoices
<?php
$client->invoice->create();
client.invoice.create()
Invoice invoice = Invoice.create();
client.Invoice.Create();
payabbhi.invoices.create(
  (error, invoice) => {
  ...
});
Payabbhi::Invoice.create

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/invoices \
  -d customer_id=cust_2WmsQoSRZMWWkcZg \
  -d invoice_no=123123123123 \
  -d place_of_supply="Delhi" \
  -d due_date=1549176945 \
  -d currency=INR \
  -d description=TestInvoice \
  -d notes[mode]=test \
  -d line_items[0][id]=item_jYGaYf14SeZ13DkJ \
  -d terms_conditions="Terms Conditions" \
  -d customer_notes="Customer Notes" \
  -d customer_notification_by="merchant"
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->invoice->create(array("customer_id" => "cust_2WmsQoSRZMWWkcZg",
                                "invoice_no" => "123123123123",
                                "place_of_supply" => "Delhi",
                                "due_date" => 1549176945,
                                "currency" => "INR",
                                "description" => "TestInvoice",
                                "notes" => array(
                                  "mode" => "test"
                                ),
                                "line_items" => array(
                                  array(
                                    "id" => "item_jYGaYf14SeZ13DkJ"
                                  )
                                ),
                                "terms_conditions" =>"Terms Conditions",
                                "customer_notes" => "Customer Notes",
                                "customer_notification_by" => "merchant"
                              ));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.invoice.create(data={'customer_id': 'cust_2WmsQoSRZMWWkcZg',
                            'invoice_no': '123123123123',
                            'due_date': 1549176945,
                            'currency':'INR',
                            'description': 'TestInvoice',
                            'notes': {'mode': 'test'},
                            'line_items': [{'id': 'item_jYGaYf14SeZ13DkJ'}],
                            'customer_notification_by': "merchant"
                           })
import com.payabbhi.Payabbhi;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Map<String, Object> options = new HashMap<>();
List<Object> items = new ArrayList<>();
Map<String, Object> item1 = new HashMap<>();
options.put("customer_id", "cust_2WmsQoSRZMWWkcZg");
options.put("place_of_supply", "Delhi");
options.put("due_date", 1549176945);
options.put("currency", "INR");
options.put("invoice_no", "123123123123");
item1.put("id", "item_jYGaYf14SeZ13DkJ");
items.add(item1);
options.put("line_items", items);
options.put("customer_notes", "customer_notes");
options.put("terms_conditions", "terms_conditions");
options.put("customer_notification_by", "merchant");
Invoice invoice = Invoice.create(options);
using Payabbhi;
var client = new Client("accessId", "secretKey");
Dictionary<string, string> invItem = new Dictionary<string, string>() {
  {"id", "item_jYGaYf14SeZ13DkJ" }
};
Dictionary<string, string>[] invItemArr = { invItem };
var invoice = client.Invoice.Create(new Dictionary<string, object>(){
  {"invoice_no", "123123123123"},
  {"customer_id", "cust_2WmsQoSRZMWWkcZg"},
  {"place_of_supply", "Delhi"},
  {"due_date", 1549176945},
  {"currency", "INR"},
  {"line_items", invItemArr},
  {"customer_notes","customer_notes"},
  {"terms_conditions","terms_conditions"},
  {"customer_notification_by","merchant"},
});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.invoices.create({
    customer_id: 'cust_2WmsQoSRZMWWkcZg',
    place_of_supply: 'Delhi',
    invoice_no: '123123123123',
    currency: 'INR',
    due_date: '1549176945',
    description: 'Test Invoice',
    notes: {
      mode: 'test'
    },
    line_items: [{id: 'item_jYGaYf14SeZ13DkJ'}],
    customer_notes: 'customer_notes',
    terms_conditions: 'terms_conditions',
    customer_notification_by: 'merchant'
  }, (error, invoice) => {
    // invoice contains created invoice details in JSON format.
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
invoice = Payabbhi::Invoice.create customer_id: 'cust_2WmsQoSRZMWWkcZg',
                                   place_of_supply: 'Delhi',
                                   due_date: 1549176945,
                                   currency: 'INR',
                                   invoice_no: '123123123123',
                                   line_items: [{ id: 'item_jYGaYf14SeZ13DkJ' }],
                                   customer_notes: 'customer_notes',
                                   terms_conditions: 'terms_conditions',
                                   customer_notification_by: 'merchant',

JSON Response

com.payabbhi.model.Invoice JSON :
{
  "id": "invt_v1uXGmhIUMylFQPS",
  "object": "invoice",
  "gross_amount": 180,
  "tax_amount": 12,
  "amount": 192,
  "amount_paid": 0,
  "amount_due": 192,
  "partial_payment_mode": false,
  "billing_method": "manual",
  "customer_id": "cust_2WmsQoSRZMWWkcZg",
  "currency": "INR",
  "created_at": 1539177115,
  "description": "Test Invoice",
  "due_date": 1549176945,
  "line_items": {
    "total_count": 1,
    "object": "list",
    "data": [
      {
        "id": "item_Jz6dd6uLbu05Y5kk",
        "object": "invoiceitem",
        "name": "Item1",
        "description": "",
        "amount": 200,
        "currency": "INR",
        "customer_id": "cust_VD9uYO8uc29b4hY8",
        "quantity": 1,
        "created_at": 1539179491,
        "notes": null,
        "deleted_at": 0,
        "unit": "",
        "hsn_code": "hsn_code",
        "sac_code": "",
        "tax_rate": 500,
        "cess": 200,
        "tax_inclusive": false,
        "discount": 20,
        "tax_amount": 12,
        "net_amount": 192,
        "taxable_amount": 180,
        "gross_amount": 180
      }
    ]
  },
  "notes": {
    "mode": "test"
  },
  "notify_by": "email",
  "payment_attempt": 0,
  "invoice_no": "123123123123",
  "status": "issued",
  "subscription_id": "",
  "url": "https://payabbhi.com/zrt2zlh5",
  "place_of_supply": "Delhi",
  "terms_conditions": "terms_conditions",
  "customer_notes": "customer_notes",
  "customer_notification_by":"merchant"
}

Creates a new invoice.

ARGUMENTS

customer_id
The unique identifier of the customer who will pay this invoice.
currency
Three-letter ISO currency code. Currently only INR is supported.
line_items
List of line items that should be included as part of the invoice.
due_date
Latest Timestamp by which the invoice should be paid by the customer. Measured in seconds since the Unix epoch. This will be null for invoices where billing_method is recurring
invoice_no
The invoice_no at Merchant end which corresponds to this invoice. This appears in the Invoice and referred in all customer communication. It is a maximum of 16 characters.
billing_method
The billing method of the invoice. The value can be either recurring or manual. The default value is manual.
partial_payment_mode default value is false
Flag to indicate if partial payment is allowed against invoice. This is applicable only for invoice whose billing_method is manual.
description
Description of the Invoice.
notify_by
Describes how the customer would be notified about the invoice. The value is one of email, phone, both. The default value is email.
customer_notification_by
Indicates who is responsible for sending notifications to the customers for important invoice life cycle events. The value can be either merchant or platform. The default value is platform.
notes
Notes is a key-value store used for storing additional data relating to the invoice item object in structured format.
place_of_supply
Place of the Supply of goods.
customer_notes
Customer Notes, which will appear in invoice and receipt.
terms_conditions
Terms and Conditions applicable for the invoice.

Returns

Returns the invoice object if the invoice is created successfully. Else it returns an error response.

Void an Invoice

Definition

POST https://payabbhi.com/api/v1/invoices/{invoice_id}/void
<?php
$client->invoice->void({invoice_id});
client.invoice.void({invoice_id})
Invoice invoice = Invoice.markVoid({invoice_id});
client.Invoice.Retrieve({invoice_id}).Void();
payabbhi.invoices.void({invoiceId},
  (error, invoice) => {
  ...
});
Payabbhi::Invoice.void({invoice_id})

Example Request:

$ curl -u access_id:secret_key -X POST \
  https://payabbhi.com/api/v1/invoices/invt_ZBymDifGQqgHPISh/void
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->invoice->void("invt_ZBymDifGQqgHPISh");
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.invoice.void('invt_ZBymDifGQqgHPISh')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Invoice invoice = Invoice.markVoid("invt_ZBymDifGQqgHPISh");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var invoice = client.Invoice.Retrieve("invt_ZBymDifGQqgHPISh").Void();
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.invoices.void('invt_ZBymDifGQqgHPISh',
  (error, invoice) => {
    // invoice contains void invoice details in JSON format.
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
invoice = Payabbhi::Invoice.void('invt_ZBymDifGQqgHPISh')

JSON Response

com.payabbhi.model.Invoice JSON :
{
  "id": "invt_ZBymDifGQqgHPISh",
  "object": "invoice",
  "gross_amount": 180,
  "tax_amount": 12,
  "amount": 192,
  "amount_paid": 0,
  "amount_due": 192,
  "partial_payment_mode": false,
  "billing_method": "recurring",
  "customer_id": "cust_VD9uYO8uc29b4hY8",
  "currency": "INR",
  "created_at": 1539179543,
  "description": "TestInvoice",
  "due_date": 1549176945,
  "line_items": {
    "total_count": 1,
    "object": "list",
    "data": [
      {
        "id": "item_Jz6dd6uLbu05Y5kk",
        "object": "invoiceitem",
        "name": "Item1",
        "description": "",
        "amount": 500,
        "currency": "INR",
        "customer_id": "cust_VD9uYO8uc29b4hY8",
        "quantity": 1,
        "created_at": 1539179491,
        "notes": null,
        "deleted_at": 0,
        "unit": "",
        "hsn_code": "hsn_code",
        "sac_code": "",
        "tax_rate": 500,
        "cess": 200,
        "tax_inclusive": false,
        "discount": 20,
        "tax_amount": 12,
        "net_amount": 192,
        "taxable_amount": 180,
        "gross_amount": 180
      }
    ]
  },
  "notes": {
    "mode": "test"
  },
  "notify_by": "email",
  "payment_attempt": 0,
  "invoice_no": "123123123123",
  "status": "void",
  "subscription_id": "",
  "url": "https://payabbhi.com/zro4qjer",
  "place_of_supply": "Delhi",
  "terms_conditions": "terms_conditions",
  "customer_notes": "customer_notes",
  "customer_notification_by":"platform"
}

ARGUMENTS

invoice_id
The unique identifier of the invoice which needs to be voided.

Returns

Returns the invoice object if the invoice is voided successfully. Else it returns an error response.

List all invoices

Definition

GET https://payabbhi.com/api/v1/invoices
<?php
$client->invoice->all();
client.invoice.all()
PayabbhiCollection<Invoice> invoices = Invoice.all();
client.Invoice.All();
payabbhi.invoices.all(
  (error, invoices) => {
    ...
});
Payabbhi::Invoice.all

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/invoices?count=2
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->invoice->all(array('count'=>2));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.invoice.all(data={'count': 2})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Invoice> invoices = Invoice.all(
        new HashMap<String, Object>() {
          {
            put("count", 2);
          }
        });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var invoices = client.Invoice.All(new Dictionary<string, object>() {
                {"count", 2}});
const payabbhi = require('payabbhi')('access_id','secret_key');

payabbhi.invoices.all({ count: 2 },
  (error, invoices) => {
  // invoices is list of Invoice Objects
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
invoices = Payabbhi::Invoice.all count: 2

JSON Response

com.payabbhi.model.Invoice JSON :
{
  "total_count": 2,
  "object": "list",
  "data": [
    {
      "id": "invt_v1uXGmhIUMylFQPS",
      "object": "invoice",
      "gross_amount": 180,
      "tax_amount": 12,
      "amount": 192,
      "amount_paid": 0,
      "amount_due": 192,
      "partial_payment_mode": false,
      "billing_method": "recurring",
      "customer_id": "cust_2WmsQoSRZMWWkcZg",
      "currency": "INR",
      "created_at": 1539177115,
      "description": "Test Invoice",
      "due_date": 1549176945,
      "line_items": {
        "total_count": 1,
        "object": "list",
        "data": [
          {
            "id": "item_jYGaYf14SeZ13DkJ",
            "object": "invoiceitem",
            "name": "Item1",
            "description": "",
            "amount": 500,
            "currency": "INR",
            "customer_id": "cust_VD9uYO8uc29b4hY8",
            "quantity": 1,
            "created_at": 1539179491,
            "notes": null,
            "deleted_at": 0,
            "unit": "",
            "hsn_code": "hsn_code",
            "sac_code": "",
            "tax_rate": 500,
            "cess": 200,
            "tax_inclusive": false,
            "discount": 20,
            "tax_amount": 12,
            "net_amount": 192,
            "taxable_amount": 180,
            "gross_amount": 180
          }
        ]
      },
      "notes": {
        "mode": "test"
      },
      "notify_by": "email",
      "payment_attempt": 0,
      "invoice_no": "123123123123",
      "status": "issued",
      "subscription_id": "",
      "url": "https://payabbhi.com/zrt2zlh5",
      "place_of_supply": "Delhi",
      "terms_conditions": "terms_conditions",
      "customer_notes": "customer_notes",
      "customer_notification_by":"platform"
    },
    {
      "id": "invt_srxOZZk6dIgWTVls",
      "object": "invoice",
      "gross_amount": 180,
      "tax_amount": 12,
      "amount": 192,
      "amount_paid": 0,
      "amount_due": 192,
      "partial_payment_mode": false,
      "billing_method": "manual",
      "customer_id": "cust_2WmsQoSRZMWWkcZg",
      "currency": "INR",
      "created_at": 1539171807,
      "description": "",
      "due_date": 1539171804,
      "line_items": {
        "total_count": 1,
        "object": "list",
        "data": [
          {
            "id": "item_I9Gh0wJHJ2tvorbT",
            "object": "invoiceitem",
            "name": "Line Item",
            "description": "",
            "amount": 100,
            "currency": "INR",
            "customer_id": "cust_2WmsQoSRZMWWkcZg",
            "quantity": 1,
            "created_at": 1539171807,
            "notes": null,
            "deleted_at": 0,
            "unit": "",
            "hsn_code": "hsn_code",
            "sac_code": "",
            "tax_rate": 500,
            "cess": 200,
            "tax_inclusive": false,
            "discount": 20,
            "tax_amount": 12,
            "net_amount": 192,
            "taxable_amount": 180,
            "gross_amount": 180
          }
        ]
      },
      "notes": null,
      "notify_by": "email",
      "payment_attempt": 0,
      "invoice_no": "INV_90976164",
      "status": "issued",
      "subscription_id": "sub_xLH108FJwUlX47SI",
      "url": "https://payabbhi.com/zta7qvp8",
      "place_of_supply": "Delhi",
      "terms_conditions": "terms_conditions",
      "customer_notes": "customer_notes",
      "customer_notification_by":"platform"
    }
  ]
}

Returns a list of invoices created previously. The invoices are listed in reverse chronological order, with the most recent invoice appearing first.

ARGUMENTS

count default is 10
A limit on the number of invoice objects to be returned. This can range between 1 and 100.
skip default is 0
Represents number of invoice objects to be skipped
from
A filter criterion based on the created_at field of the invoice object. Value can be a timestamp. Returns Invoices created on or after this timestamp.
to
A filter criterion based on the created_at field of the invoice object. Value can be a timestamp. Returns invoices created on or before this timestamp.
billing_method
A filter on the invoice list based on the billing_method field. The value can be either recurring or manual.
due_date_from
A filter criterion based on the due_date field of the invoice object. Value can be a timestamp. Returns Invoices having due date on or after this timestamp.
due_date_to
A filter criterion based on the due_date field of the invoice object. Value can be a timestamp. Returns Invoices due date on or before this timestamp.
email
A filter on the invoice list based on the customer's email field.
subscription_id
A filter on the invoice list based on the subscription_id field.

Returns

An object with total_count attribute containing the total count of invoices matching the given request, object attribute containing list and a data attribute containing an array of invoice objects.

Each element in the array of data attribute is a separate invoice object. If no invoices exist, the resulting array will be empty.

You can optionally set the filter criteria to only retrieve invoices that match the criteria.

Retrieve an invoice

Definition

GET https://payabbhi.com/api/v1/invoices/{invoice_id}
<?php
$client->invoice->retrieve({invoice_id});
client.invoice.retrieve({invoice_id})
Invoice invoice = Invoice.retrieve({invoice_id});
client.Invoice.Retrieve({invoice_id});
payabbhi.invoices.retrieve({invoiceId},
  (error, invoice) => {
    ...
});
Payabbhi::Invoice.retrieve({invoice_id})

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/invoices/invt_srxOZZk6dIgWTVls
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->invoice->retrieve('invt_srxOZZk6dIgWTVls');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.invoice.retrieve('invt_srxOZZk6dIgWTVls')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Invoice invoice = Invoice.retrieve("invt_srxOZZk6dIgWTVls");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var invoice = client.Invoice.Retrieve("invt_srxOZZk6dIgWTVls");
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.invoices.retrieve('invt_srxOZZk6dIgWTVls',
  (error, invoice) => {
    // invoice is the Invoice object retrieved
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
invoice = Payabbhi::Invoice.retrieve('invt_srxOZZk6dIgWTVls')

JSON Response

com.payabbhi.model.Invoice JSON :
{
  "id": "invt_srxOZZk6dIgWTVls",
  "object": "invoice",
  "gross_amount": 180,
  "tax_amount": 12,
  "amount": 192,
  "amount_paid": 0,
  "amount_due": 192,
  "partial_payment_mode": false,
  "billing_method": "recurring",
  "customer_id": "cust_2WmsQoSRZMWWkcZg",
  "currency": "INR",
  "created_at": 1539171807,
  "description": "",
  "due_date": 1539171804,
  "line_items": {
    "total_count": 1,
    "object": "list",
    "data": [
      {
        "id": "item_I9Gh0wJHJ2tvorbT",
        "object": "invoiceitem",
        "name": "Item1",
        "description": "",
        "amount": 500,
        "currency": "INR",
        "customer_id": "cust_VD9uYO8uc29b4hY8",
        "quantity": 1,
        "created_at": 1539179491,
        "notes": null,
        "deleted_at": 0,
        "unit": "",
        "hsn_code": "hsn_code",
        "sac_code": "",
        "tax_rate": 500,
        "cess": 200,
        "tax_inclusive": false,
        "discount": 20,
        "tax_amount": 12,
        "net_amount": 192,
        "taxable_amount": 180,
        "gross_amount": 180
      }
    ]
  },
  "notes": null,
  "notify_by": "email",
  "payment_attempt": 0,
  "invoice_no": "INV_90976164",
  "status": "issued",
  "subscription_id": "sub_xLH108FJwUlX47SI",
  "url": "https://payabbhi.com/zta7qvp8",
  "place_of_supply": "Delhi",
  "terms_conditions": "terms_conditions",
  "customer_notes": "customer_notes",
  "customer_notification_by":"platform"
}

Returns a Invoice object matching the invoice_id. Else it returns an error response.

ARGUMENTS

invoice_id
The identifier of the invoice to be retrieved.

Returns

Returns a invoice object, given a valid invoice identifier was provided, and returns an error otherwise.

List all line items for an invoice

Definition

GET https://payabbhi.com/api/v1/invoices/{invoice_id}/line_items
<?php
$client->invoice->line_items({invoice_id});
client.invoice.line_items({invoice_id})
PayabbhiCollection<InvoiceItem> lineitems = Invoice.lineItems({invoice_id});
client.Invoice.Retrieve({invoice_id}).LineItems();
payabbhi.invoices.line_items({invoiceId},
  (error, items) => {
    ...
});
Payabbhi::Invoice.line_items({invoice_id})

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/invoices/invt_UZqFoPLamaZqLFkZ/line_items
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->invoice->line_items('invt_UZqFoPLamaZqLFkZ');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.invoice.line_items('invt_UZqFoPLamaZqLFkZ')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<InvoiceItem> lineitems = Invoice.lineItems("invt_UZqFoPLamaZqLFkZ");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var lineItems = client.Invoice.Retrieve("invt_UZqFoPLamaZqLFkZ").LineItems();
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.invoices.line_items('invt_UZqFoPLamaZqLFkZ',
  (error, items) => {
    // items is list of Invoiceitem Objects of the invoice
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
line_items = Payabbhi::Invoice.line_items('invt_UZqFoPLamaZqLFkZ')

JSON Response:

com.payabbhi.model.Invoice JSON :
{
  "total_count": 1,
  "object": "list",
  "data": [
    {
      "id": "item_FL3nHHB7i7Fpcj1J",
      "object": "invoiceitem",
      "name": "N2",
      "description": "D2",
      "amount": 200,
      "currency": "INR",
      "customer_id": "cust_2WmsQoSRZMWWkcZg",
      "quantity": 12,
      "created_at": 1539074485,
      "notes": null,
      "deleted_at": 0,
      "unit": "",
      "hsn_code": "hsn_code",
      "sac_code": "",
      "tax_rate": 500,
      "cess": 200,
      "tax_inclusive": false,
      "discount": 20,
      "tax_amount": 138,
      "net_amount": 2118,
      "taxable_amount": 1980,
      "gross_amount": 1980
    }
  ]
}

Returns a list of all invoice items for a given invoice that have previously been created. The invoice items are listed in reverse chronological order, with the most recent invoice item appearing first.

ARGUMENTS

invoice_id
The identifier of the invoice whose invoice items are to be retrieved.

Returns

An object with total_count attribute containing the total count of invoice items corresponding to the given Invoice, object attribute containing list and a data attribute containing an array of invoice item objects.

Each element in the array of data attribute is a separate invoice item object. If no invoice items exist for the Invoice, the resulting array will be empty.

List all payments for an invoice

Definition

GET https://payabbhi.com/api/v1/invoices/{invoice_id}/payments
<?php
$client->invoice->payments({invoice_id});
client.invoice.payments(invoice_id)
PayabbhiCollection<Payment> payments = Invoice.payments({invoice_id});
client.Invoice.Retrieve({invoice_id}).Payments();
payabbhi.invoices.payments({invoiceId},
  (error, payments) => {
    ...
});
payments = Payabbhi::Invoice.payments({invoice_id})

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/invoices/invt_srxOZZk6dIgWTVls/payments
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->invoice->payments('invt_srxOZZk6dIgWTVls');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.invoice.payments('invt_srxOZZk6dIgWTVls')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Payment> payments = Invoice.payments("invt_srxOZZk6dIgWTVls");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var payments = client.Invoice.Retrieve("invt_srxOZZk6dIgWTVls").Payments();
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.invoices.payments('invt_srxOZZk6dIgWTVls',
  (error, payments) => {
    // payments is list of Payment Objects of the invoice
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
payments = Payabbhi::Invoice.payments('invt_srxOZZk6dIgWTVls')

JSON Response:

com.payabbhi.model.Invoice JSON :
{
  "total_count": 1,
  "object": "list",
  "data": [
    {
      "id": "pay_mUy6UYsRvIxH9Qi2",
      "object": "payment",
      "amount": 1000,
      "currency": "INR",
      "status": "captured",
      "order_id": "",
      "invoice_id": "invt_srxOZZk6dIgWTVls",
      "international": false,
      "method": "card",
      "description": "new payment done",
      "card": "visa-debit",
      "bank": "",
      "wallet": "",
      "vpa": "",
      "customer_id": "cust_2BCT1Tvgg1gNjVPu",
      "email": "test@example.com",
      "contact": "9999999999",
      "notes": null,
      "fee": 5,
      "service_tax": 0,
      "payout_amount": 995,
      "payout_type": "Cr",
      "settled": true,
      "settlement_id": "stl_abjBUMNyLnzGbFOC",
      "refunded_amount": 600,
      "refund_status": "partial",
      "refunds": {
        "total_count": 3,
        "object": "list",
        "data": [
          {
            "id": "rfnd_02iOL6yHtrTTVYSw",
            "object": "refund",
            "amount": 200,
            "currency": "INR",
            "payment_id": "pay_mUy6UYsRvIxH9Qi2",
            "notes": {
              "item_count": "2",
              "sales_channel": "website"
            },
            "created_at": 1495554728
          },
          {
            "id": "rfnd_iqPqyu7Ds5UaC434",
            "object": "refund",
            "amount": 200,
            "currency": "INR",
            "payment_id": "pay_mUy6UYsRvIxH9Qi2",
            "notes": null,
            "created_at": 1495547054
          },
          {
            "id": "rfnd_PWrr22qRNIjAkQ9U",
            "object": "refund",
            "amount": 200,
            "currency": "INR",
            "payment_id": "pay_mUy6UYsRvIxH9Qi2",
            "notes": null,
            "created_at": 1495546589
          }
        ]
      },
      "error_code": "",
      "error_description": "",
      "created_at": 1495546415,
      "virtual_account_id": "",
      "payment_page_id": "",
      "bank_response": {},
      "commercial_card": false
    }
  ]
}

Returns a list of all payments for a given invoice that have previously been created. The payments are listed in reverse chronological order, with the most recent payment appearing first.

ARGUMENTS

invoice_id
The identifier of the invoice whose payments are to be retrieved.

Returns

An object with total_count attribute containing the total count of payments corresponding to the given Invoice, object attribute containing list and a data attribute containing an array of payment objects.

Each element in the array of data attribute is a separate payment object. If no payments exist for the Invoice, the resulting array will be empty.

Payment Links

JSON Response

{
  "id": "invc_NRFJkTGyZYo03cPD",
  "object": "payment_link",
  "amount": 100,
  "amount_paid": 0,
  "amount_due": 100,
  "partial_payment_mode": false,
  "customer_id": "cust_2WmsQoSRZMWWkcZg",
  "name": "Bruce",
  "email": "a@b.com",
  "contact_no": "9999999999",
  "currency": "INR",
  "description": "Test Payment Link",
  "due_date": 0,
  "notes": null,
  "notify_by": "none",
  "customer_notification_by": "merchant",
  "payment_attempt": 0,
  "receipt_no": "Test_R123",
  "status": "issued",
  "url": "https://payabbhi.com/zpuoxajg",
  "created_at": 1556097575
}

ATTRIBUTES

id string
Unique identifier of payment link object.
object string, value is "payment_link"
Represents the object type which in this case is payment_link.
amount positive integer
Amount to be paid for this payment link. A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00). Minimum amount is 100 paise.
amount_paid positive integer
Amount paid against the payment link. A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00).
amount_due positive integer
Final amount due for the payment link. A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00). Minimum amount is 100 paise.
partial_payment_mode booleandefault value is false
Flag to indicate if partial payment is allowed against payment link.
customer_id string
Unique identifier of the customer who will pay via this payment link.
name string
Name of the customer who will pay via this payment link.
email string
Email ID of the customer who will pay via this payment link.
contact_no string
Contact Number of the customer who will pay via this payment link.
currency string
Three-letter ISO currency code. Currently only INR is supported.
description string
Description of the Payment link.
due_date timestamp
Latest Timestamp by which the payment should be paid by the customer. Measured in seconds since the Unix epoch.
notify_by string
Describes how the customer would be notified about the payment link. The value is one of email, phone, both, none. The default value is email.
customer_notification_by string
Indicates who is responsible for sharing the payment link and sending notifications to the customers for important life cycle events. The value can be either merchant or platform. The default value is platform.
payment_attempt positive integer or zero
Number of payment attempts against this payment link.
receipt_no string
The receipt_id or reference_no. etc at Merchant end which corresponds to this payment link. This should be maximum of 16 characters.
status string
Status of the payment link. The payment link status is one of issued, payment_attempted, partially_paid, paid, cancelled or past_due.
url string
Url generated for this payment link for customers to view and pay.
notes json object
Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the payment link object in a structured format.
created_at timestamp
Payment link creation timestamp. Measured in seconds since the Unix epoch.

Definition

POST https://payabbhi.com/api/v1/payment_links
<?php
$client->paymentlink->create();
client.payment_link.create()
Payment_Link paymentLink = Payment_Link.create();
client.PaymentLink.Create();
payabbhi.payment_links.create(
  (error,payment_link) => {
    ...
});

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/payment_links \
  -d customer_id=cust_2WmsQoSRZMWWkcZg \
  -d receipt_no=123123123123 \
  -d amount=100 \
  -d currency=INR \
  -d description="Test Payment Link" \
  -d notes[mode]=test \
  -d customer_notification_by=merchant
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->paymentlink->create(array('name' => 'Bruce',
                     'amount' => 100,
                     'currency' => 'INR',
                     'email' => 'a@b.com',
                     'contact_no' => '9999999999',
                     'receipt_no' => 'Test_R123'
                     ));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.payment_link.create(data={'name': 'Bruce',
                                 'amount': 100,
                                 'currency': 'INR',
                                 'email': 'a@b.com',
                                 'contact_no': '9999999999',
                                 'receipt_no': 'Test_R123'})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Payment_Link paymentLink =
    Payment_Link.create(
        new HashMap<String, Object>() {
          {
            put("name", "Bruce");
            put("amount", 100);
            put("currency", "INR");
            put("email", "a@b.com");
            put("contact_no", "9999999999");
          }
        });
using Payabbhi;
var  client = new Client("accessId", "secretKey");
var paymentLink = client.PaymentLink.Create(
  new Dictionary<string, object>(){
    {"name", "Payabbhi Customer"},
    {"currency", "INR"},
    {"amount", 100}});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.payment_links.create({
        name: "Bruce",
        email: "a@b.com",
        contact_no: "9999999999",
        amount: 10000,
        currency: "INR"
      }, (error, payment_link) => {
        // payment_link contains created payment link details in JSON format.
});

JSON Response

com.payabbhi.model.PaymentLink JSON :
{
  "id": "invc_NRFJkTGyZYo03cPD",
  "object": "payment_link",
  "amount": 100,
  "amount_paid": 0,
  "amount_due": 100,
  "partial_payment_mode": false,
  "customer_id": "cust_2WmsQoSRZMWWkcZg",
  "name": "Bruce",
  "email": "a@b.com",
  "contact_no": "9999999999",
  "currency": "INR",
  "description": "Test Payment Link",
  "due_date": 0,
  "notes": null,
  "notify_by": "none",
  "customer_notification_by": "merchant",
  "payment_attempt": 0,
  "receipt_no": "Test_R123",
  "status": "issued",
  "url": "https://payabbhi.com/zpuoxajg",
  "created_at": 1556097575
}

Creates a new payment link.

ARGUMENTS

customer_id
The unique identifier of the customer who will pay via this payment link. Either customer_id or at least one of name, email, contact_no is required.
name
Name of the customer who will pay via this payment link.
email
Email ID of the customer who will pay via this payment link.
contact_no
Contact Number of the customer who will pay via this payment link.
currency
Three-letter ISO currency code. Currently only INR is supported.
amount
Amount for the payment link. A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00).
partial_payment_mode default value is false
Flag to indicate if partial payment is allowed against payment link.
due_date
Latest Timestamp by which the payment should be paid by the customer. Measured in seconds since the Unix epoch.
receipt_no
The receipt_id or reference_no. etc at Merchant end which corresponds to this payment link. This should be maximum of 16 characters.
description
Description of the Payment link.
notify_by
Describes how the customer would be notified about the payment link. The value is one of email, phone, both, none. The default value is email.
customer_notification_by
Indicates who is responsible for sharing the payment link and sending notifications to the customers for important life cycle events. The value can be either merchant or platform. The default value is platform.
notes
Notes is a key-value store used for storing additional data relating to the payment link object in structured format.

Returns

Returns the payment link object if the payment link is created successfully. Else it returns an error response.

Definition

POST https://payabbhi.com/api/v1/payment_links/{payment_link_id}/cancel
<?php
$client->paymentlink->cancel({payment_link_id});
client.payment_link.cancel({payment_link_id})
Payment_Link paymentLink = Payment_Link.cancel({payment_link_id});
client.PaymentLink.Retrieve({payment_link_id}).Cancel();
payabbhi.payment_links.cancel({payment_linkId},
  (error, payment_link) => {
    ...
});

Example Request:

$ curl -u access_id:secret_key -X POST \
  https://payabbhi.com/api/v1/payment_links/invc_NRFJkTGyZYo03cPD/cancel
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->paymentlink->cancel("invc_NRFJkTGyZYo03cPD");
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.payment_link.cancel('invc_NRFJkTGyZYo03cPD')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Payment_Link paymentLink =
    Payment_Link.cancel("invc_NRFJkTGyZYo03cPD");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var paymentLink = client.PaymentLink.Retrieve("invc_NRFJkTGyZYo03cPD").Cancel();
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.payment_links.cancel('invc_NRFJkTGyZYo03cPD',
  (error, payment_link) => {
    // payment_link is Payment Link Object to be cancelled.
});

JSON Response

com.payabbhi.model.PaymentLink JSON :
{
  "id": "invc_NRFJkTGyZYo03cPD",
  "object": "payment_link",
  "amount": 100,
  "amount_paid": 0,
  "amount_due": 100,
  "partial_payment_mode": false,
  "customer_id": "cust_2WmsQoSRZMWWkcZg",
  "name": "Bruce",
  "email": "a@b.com",
  "contact_no": "9999999999",
  "currency": "INR",
  "description": "Test Payment Link",
  "due_date": 0,
  "notes": null,
  "notify_by": "none",
  "customer_notification_by": "merchant",
  "payment_attempt": 0,
  "receipt_no": "Test_R123",
  "status": "cancelled",
  "url": "https://payabbhi.com/zpuoxajg",
  "created_at": 1556097575
}

ARGUMENTS

payment_link_id
The unique identifier of the payment link which needs to be cancelled.

Returns

Returns the payment link object if the payment link is cancelled successfully. Else it returns an error response.

Definition

GET https://payabbhi.com/api/v1/payment_links
<?php
$client->paymentlink->all();
client.payment_link.all()
PayabbhiCollection<Payment_Link> paymentLinks = Payment_Link.all();
client.PaymentLink.All();
payabbhi.payment_links.all(
  (error, payment_links) => {
    ...
});

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/payment_links?count=2
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->paymentlink->all(array('count'=>2));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.payment_link.all(data={'count': 2})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Payment_Link> paymentLinks = Payment_Link.all(
        new HashMap<String, Object>() {
          {
            put("count", 2);
          }
        });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var paymentLinks = client.PaymentLink.All(
  new Dictionary<string, object>() {
    {"count", 2} });
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.payment_links.all({ count: 2 },
  (error, payment_links) => {
  // payment_links is list of PaymentLink Object
});

JSON Response

com.payabbhi.model.PaymentLink JSON :
{
  "total_count": 2,
  "object": "list",
  "data": [
    {
      "id": "invc_NRFJkTGyZYo03cPD",
      "object": "payment_link",
      "amount": 100,
      "amount_paid": 0,
      "amount_due": 100,
      "partial_payment_mode": false,
      "customer_id": "cust_2WmsQoSRZMWWkcZg",
      "name": "Bruce",
      "email": "a@b.com",
      "contact_no": "9999999999",
      "currency": "INR",
      "description": "Test Payment Link",
      "due_date": 0,
      "notes": null,
      "notify_by": "none",
      "customer_notification_by": "merchant",
      "payment_attempt": 0,
      "receipt_no": "Test_R123",
      "status": "issued",
      "url": "https://payabbhi.com/zpuoxajg",
      "created_at": 1556097575
    },
    {
      "id": "invc_SZ7CU0ryV9u56Kgj",
      "object": "payment_link",
      "amount": 1100,
      "amount_paid": 0,
      "amount_due": 1100,
      "partial_payment_mode": false,
      "customer_id": "cust_JHpnVj0s05bNOzvf",
      "name": "Wayne",
      "email": "b@c.com",
      "contact_no": "9000000000",
      "currency": "INR",
      "description": "Test Payment Link 2",
      "due_date": 0,
      "notes": null,
      "notify_by": "none",
      "customer_notification_by": "merchant",
      "payment_attempt": 0,
      "receipt_no": "Test_R122",
      "status": "issued",
      "url": "https://payabbhi.in/z5qhbg9d",
      "created_at": 1556003832
    }
  ]
}

Returns a list of payment links created previously. The payment links are listed in reverse chronological order, with the most recent payment link appearing first.

ARGUMENTS

count default is 10
A limit on the number of payment link objects to be returned. This can range between 1 and 100.
skip default is 0
Represents number of payment link objects to be skipped
from
A filter criterion based on the created_at field of the payment link object. Value can be a timestamp. Returns Payment links created on or after this timestamp.
to
A filter criterion based on the created_at field of the payment link object. Value can be a timestamp. Returns Payment links created on or before this timestamp.
due_date_from
A filter criterion based on the due_date field of the payment link object. Value can be a timestamp. Returns Payment links having due date on or after this timestamp.
due_date_to
A filter criterion based on the due_date field of the payment link object. Value can be a timestamp. Returns Payment links due date on or before this timestamp.
email
A filter on the payment link list based on the customer's email field.
contact_no
A filter on the payment link list based on the customer's contact_no field.
receipt_no
A filter on the payment link list based on the receipt_no field of the payment link object.

Returns

An object with total_count attribute containing the total count of payment links matching the given request, object attribute containing list and a data attribute containing an array of payment link objects.

Each element in the array of data attribute is a separate payment link object. If no payment links exist, the resulting array will be empty.

You can optionally set the filter criteria to only retrieve payment links that match the criteria.

Definition

GET https://payabbhi.com/api/v1/payment_links/{payment_link_id}
<?php
$client->paymentlink->retrieve({payment_link_id});
client.payment_link.retrieve({payment_link_id})
Payment_Link paymentLink = Payment_Link.retrieve({payment_link_id});
client.PaymentLink.Retrieve({payment_link_id});
payabbhi.payment_links.retrieve({payment_linkId},
  (error, payment_link) => {
    ...
});

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/payment_links/invc_NRFJkTGyZYo03cPD
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->paymentlink->retrieve('invc_NRFJkTGyZYo03cPD');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.payment_link.retrieve('invc_NRFJkTGyZYo03cPD')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Payment_Link paymentLink = Payment_Link.retrieve("invc_NRFJkTGyZYo03cPD");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var paymentLink = client.PaymentLink.Retrieve("invc_NRFJkTGyZYo03cPD");
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.payment_links.retrieve('invc_NRFJkTGyZYo03cPD',
  (error, payment_link) => {
    // payment_link is the Payment Link object retrieved
});

JSON Response

com.payabbhi.model.PaymentLink JSON :
{
  "id": "invc_NRFJkTGyZYo03cPD",
  "object": "payment_link",
  "amount": 100,
  "amount_paid": 0,
  "amount_due": 100,
  "partial_payment_mode": false,
  "customer_id": "cust_2WmsQoSRZMWWkcZg",
  "name": "Bruce",
  "email": "a@b.com",
  "contact_no": "9999999999",
  "currency": "INR",
  "description": "Test Payment Link",
  "due_date": 0,
  "notes": null,
  "notify_by": "none",
  "customer_notification_by": "merchant",
  "payment_attempt": 0,
  "receipt_no": "Test_R123",
  "status": "issued",
  "url": "https://payabbhi.com/zpuoxajg",
  "created_at": 1556097575
}

Returns a Payment link object matching the payment_link_id. Else it returns an error response.

ARGUMENTS

payment_link_id
The identifier of the payment link to be retrieved.

Returns

Returns a payment link object, given a valid payment link identifier was provided, and returns an error otherwise.

Definition

GET https://payabbhi.com/api/v1/payment_links/{payment_link_id}/payments
<?php
$client->paymentlink->payments({payment_link_id});
client.payment_link.payments({payment_link_id})
PayabbhiCollection<Payment> payments = Payment_Link.payments({payment_link_id});
client.PaymentLink.Retrieve({payment_link_id}).Payments();
payabbhi.payment_links.payments({payment_linkId},
  (error, payments) => {
    ...
});

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/payment_links/invc_NRFJkTGyZYo03cPD/payments
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->paymentlink->payments("invc_NRFJkTGyZYo03cPD");
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.payment_link.payments('invc_NRFJkTGyZYo03cPD')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Payment> payments = Payment_Link.payments("invc_NRFJkTGyZYo03cPD",
  new HashMap<String, Object>() {
    {
      put("count", 2);
    }
  });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var payments = client.PaymentLink.Retrieve("invc_NRFJkTGyZYo03cPD").Payments();
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.payment_links.payments('invc_NRFJkTGyZYo03cPD',
  (error, payments) => {
  // payments is the list of Payment object
});

JSON Response:

com.payabbhi.model.PaymentLink JSON :
{
  "total_count": 1,
  "object": "list",
  "data": [
    {
      "id": "pay_mUy6UYsRvIxH9Qi2",
      "object": "payment",
      "amount": 100,
      "currency": "INR",
      "status": "captured",
      "order_id": "",
      "invoice_id": "invc_NRFJkTGyZYo03cPD",
      "international": false,
      "method": "card",
      "description": "new payment done",
      "card": "visa-debit",
      "bank": "",
      "wallet": "",
      "vpa": "",
      "customer_id": "cust_24y1Tvgg1gNjVPu",
      "email": "a@b.com",
      "contact": "9999999999",
      "notes": null,
      "fee": 5,
      "service_tax": 0,
      "payout_amount": 995,
      "payout_type": "Cr",
      "settled": true,
      "settlement_id": "stl_abjBUMNyLnzGbFOC",
      "refunded_amount": 0,
      "refund_status": "",
      "refunds": {
        "total_count": 0,
        "object": "list",
        "data": []
      },
      "error_code": "",
      "error_description": "",
      "created_at": 1495546415,
      "virtual_account_id": "",
      "payment_page_id": "",
      "bank_response": {},
      "commercial_card": false
    }
  ]
}

Returns a list of all payments for a given payment link that have previously been created. The payments are listed in reverse chronological order, with the most recent payment appearing first.

ARGUMENTS

payment_link_id
The identifier of the payment link whose payments are to be retrieved.

Returns

An object with total_count attribute containing the total count of payments corresponding to the given Payment link, object attribute containing list and a data attribute containing an array of payment objects.

Each element in the array of data attribute is a separate payment object. If no payments exist for the Payment link, the resulting array will be empty.

Virtual Accounts

The Virtual Account Object

JSON Response

com.payabbhi.model.VirtualAccount JSON :
{
    "id": "va_FMkEnEGEmHhMKZzL",
    "object": "virtual_account",
    "status": "active",
    "paid_amount": 200000,
    "customer_id": "cust_2BCT1Tvgg1gNjVPu",
    "email": "test@example.com",
    "contact_no": "9999999999",
    "order_id": "order_bksvkhdnvnfvmkfmdv",
    "invoice_id": "",
    "description": "virtual payment",
    "collection_methods": [
        {
            "id": "bank_TLMgzPTuTQ8zM4LQ",
            "object": "bank_account",
            "name": "Bruce",
            "account_no": "AP09AR000000000000",
            "ifsc": "YESB0CMSNOC",
            "created_at": 1560433809
        }
    ],
    "notification_method": "both",
    "customer_notification_by": "platform",
    "notes": {
        "channel": "virtual_account"
    },
    "created_at": 1560433809
}

ATTRIBUTES

id string
Unique identifier of virtual account object.
object string, value is "virtual_account"
Represents the object type which in this case is virtual_account.
status string
The virtual account status is one of active or closed.
paid_amount positive integer
A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00). Value of the amount paid to this virtual account.
customer_id string
Unique identifier of the customer who will pay to this virtual account.
email string
Email ID of the customer who will pay to this virtual account.
contact_no string
Contact Number of the customer who will pay to this virtual account.
order_id string
Unique identifier of an Order object created using Payabbhi API.
invoice_id string
Unique identifier of an Invoice object created using Payabbhi API.
description string
Description of the virtual account.
collection_methods list
attributes in collection_methods should be described.
notification_method string
Describes how the customer would be notified about the virtual account. The value is one of email, sms, both, none. The default value is email.
customer_notification_by string
Indicates who is responsible for sharing the virtual account details and sending notifications to the customers for important life cycle events. The value can be either merchant or platform. The default value is platform.
notes json object
Set of key/value pairs that you can attach to a virtual account object. It can be useful for storing additional information about the virtual account object in a structured format.
created_at timestamp
Virtual account creation timestamp. Measured in seconds since the Unix epoch.

The Bank Account Object

JSON Response

com.payabbhi.model.VirtualAccount JSON :
{
    "id": "bank_fANeUeWFt0AmUkYD",
    "object": "bank_account",
    "type": "NEFT",
    "name": "Carla Thompson",
    "address": "",
    "account_no": "9867234567123459800002355",
    "account_type": "Savings",
    "ifsc": "HDFC0000043",
    "note_to_beneficiary": "payment for test",
    "created_at": 1560409074
}

ATTRIBUTES

id string
Unique identifier of bank account object.
object string, value is "bank_account"
Represents the object type which in this case is bank_account.
type string
Type of bank transfer made. Can be one of IMPS, NEFT or RTGS
name string
Beneficiary's name when the bank_acount object is part of the collection_method in a virtual account. Remitter's name when bank_acount object is mapped to the payer_bank_account in payment.
address string
Address of the bank account. This attribute will not be in the bank_account object if that is a part of the collection_method in the virtual account.
account_no string
Beneficiary's bank account number when the bank_acount object is part of the collection_method in a virtual account. Remitter's bank account number when bank_acount object is mapped to the payer_bank_account in payment.
account_type string
Account Type of the remitting account. This attribute will not be in the bank_account object if that is a part of the collection_method in the virtual account.
ifsc string
Beneficiary's ifsc when the bank_acount object is part of the collection_method in the virtual account. Remitter's ifsc when bank_acount object is mapped to the payer_bank_account in payment.
note_to_beneficiary string
Note given by the remitter while making the remittance to the virtual account.
created_at timestamp
Bank account object creation timestamp. Measured in seconds since the Unix epoch.

Create a Virtual Account

Definition

POST https://payabbhi.com/api/v1/virtual_accounts
<?php
$client->virtualaccount->create();
client.virtual_account.create()
Virtual_Account virtualAccount = Virtual_Account.create();
client.VirtualAccount.Create();
payabbhi.virtual_accounts.create(
  (error, virtual_account) => {
  ...
});

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/virtual_accounts \
  --header 'Content-Type: application/json' --request POST \
  -d '{
    "email": "test@example.com",
    "contact_no": "9999999999",
    "description": "virtual_payment",
    "collection_methods": {
        "upi": {"amount": 1000},
        "bank_account": ""
    },
    "notification_method": "both",
    "customer_notification_by": "platform",
    "notes": {
        "channel": "virtual_account"
    }
}'
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->virtualaccount->create(
                      array('collection_methods' => array("bank_account" => "",
                          "upi" => array("amount" => 1000)),
                     'email' => 'test@example.com',
                     'contact_no' => '9999999999',
                     'description' => 'virtual_payment'));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.virtual_account.create(data={'collection_methods': {"upi":{"amount":100}, "bank_account": ""},
                                 'email': 'test@example.com',
                                 'contact_no': '9999999999',
                                 'description': 'virtual_payment'})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";

Map<String, Object> collectionMethods = new HashMap<>();
Map<String, Object> upiData = new HashMap<>();
upiData.put("amount", 1000);
collectionMethods.put("upi", upiData);
collectionMethods.put("bank_account", "");
Map<String, Object> payload = new HashMap<>();
payload.put("email", "test@example.com");
payload.put("contact_no", "9999999999");
payload.put("description", "virtual_payment");
payload.put("collection_methods", collectionMethods);

Virtual_Account virtualAccount = Virtual_Account.create(payload);
using Payabbhi;
var client = new Client("accessId", "secretKey");
var virtualAccount = client.VirtualAccount.Create(
  new Dictionary<string, object> {
    {"collection_methods", new Dictionary<string, object>{
      {"bank_account", ""},
      { "upi", new Dictionary<string, object>{
        { "amount", 1000} }}}},
    {"email", "test@example.com"},
    {"contact_no", "9999999999"},
    {"notification_method", "both"},
    {"customer_notification_by", "platform"},
    {"notes", new Dictionary<string, object>{
      {"channel", "virtual_account"}}}
  });
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.virtual_accounts.create({
        email: "test@example.com",
        contact_no: "9999999999",
        description: "virtual_payment",
        collection_methods: {
          upi: { amount:100 },
          bank_account: ""
        }
      },
  (error, virtual_account) => {
    // virtual_account is the Virtual Account object retrieved
});

JSON Response

com.payabbhi.model.VirtualAccount JSON :
  {
    "id": "va_uZDaZ5EADmFuYyTx",
    "object": "virtual_account",
    "status": "active",
    "paid_amount": 0,
    "customer_id": "cust_Es9T3VCKexWzFiNi",
    "email": "test@example.com",
    "contact_no": "9999999999",
    "order_id": "",
    "invoice_id": "",
    "description": "virtual_payment",
    "collection_methods": [
      {
        "id": "bank_1k7pU58XdEDm7Oro",
        "object": "bank_account",
        "name": "Bruce",
        "account_no": "AP09AR000000000000",
        "ifsc": "YESB1234567",
        "created_at": 1576070903
      },
      {
        "id": "upi_STXQAa08O49d91qA",
        "object": "upi",
        "vpa": "",
        "qr_code_url": "https://payabbhi.com/hosted/v1/qrcode/test/va_uZDaZ5EADmFuYyTx",
        "created_at": 1576070903
      }
    ],
    "notification_method": "both",
    "customer_notification_by": "platform",
    "notes": {
      "channel": "virtual_account"
    },
    "created_at": 1576070903
  }

Creates a new virtual account.

ARGUMENTS

customer_id string
Unique identifier of the customer who will pay to this virtual account.
email string
Email ID of the customer who will pay to this virtual account.
contact_no string
Contact Number of the customer who will pay to this virtual account.
order_id string
Unique identifier of an Order object created using Payabbhi API.
invoice_id string
Unique identifier of an Invoice object created using Payabbhi API.
description string
Description of the virtual account.
collection_methods json object
A set of collection methods that should be used to collect payments for the virtual account. The values can be bank_account, upi or both.
notification_method string
Describes how the customer would be notified about the virtual account. The value is one of email, sms, both, none. The default value is email.
customer_notification_by string
Indicates who is responsible for sharing the virtual account details and sending notifications to the customers for important life cycle events. The value can be either merchant or platform. The default value is platform.
notes json object
Set of key/value pairs that you can attach to a virtual account object. It can be useful for storing additional information about the virtual account object in a structured format.

Returns

Returns the virtual account object if the virtual account is created successfully. Else it returns an error response.

List all Virtual Accounts

Definition

GET https://payabbhi.com/api/v1/virtual_accounts
<?php
$client->virtualaccount->all();
client.virtual_account.all()
PayabbhiCollection<Virtual_Account> virtualAccounts = Virtual_Account.all();
client.VirtualAccount.All();
payabbhi.virtual_accounts.all(
  (error, virtual_accounts) => {
    ...
});

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/virtual_accounts?count=2
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->virtualaccount->all(array('count'=>2));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.virtual_account.all(data={'count': 2})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Virtual_Account> virtualAccounts = Virtual_Account.all(
        new HashMap<String, Object>() {
          {
            put("count", 2);
          }
        });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var virtualAccounts = client.VirtualAccount.All(
              new Dictionary<string, object>() {
                {"count", 2} } );
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.virtual_accounts.all({ count: 2 },
  (error, virtual_accounts) => {
  // virtual_accounts is list of VirtualAccount Objects
});

JSON Response

com.payabbhi.model.VirtualAccount JSON :
{
    "total_count": 45,
    "object": "list",
    "data": [
        {
            "id": "va_uZDaZ5EADmFuYyTx",
            "object": "virtual_account",
            "status": "active",
            "paid_amount": 0,
            "customer_id": "cust_Es9T3VCKexWzFiNi",
            "email": "test@example.com",
            "contact_no": "9999999999",
            "order_id": "",
            "invoice_id": "",
            "description": "virtual_payment",
            "collection_methods": [
            {
                "id": "bank_1k7pU58XdEDm7Oro",
                "object": "bank_account",
                "name": "Bruce",
                "account_no": "AP09AR000000000000",
                "ifsc": "YESB1234567",
                "created_at": 1576070903
            },
            {
                "id": "upi_STXQAa08O49d91qA",
                "object": "upi",
                "vpa": "",
                "qr_code_url": "https://payabbhi.com/hosted/v1/qrcode/test/va_uZDaZ5EADmFuYyTx",
                "created_at": 1576070903
            }
            ],
            "notification_method": "both",
            "customer_notification_by": "platform",
            "notes": {
            "channel": "virtual_account"
            },
            "created_at": 1576070903
        },
        {
            "id": "va_f1bN6FztYtJR1uLR",
            "object": "virtual_account",
            "status": "active",
            "paid_amount": 0,
            "customer_id": "cust_2BCT1Tvgg1gNjVPu",
            "email": "b@c.com",
            "contact_no": "8888888888",
            "order_id": "order_bksvkhdnvnfvmkfmdv",
            "invoice_id": "invc_bkjcbdbcclqsmcdsvf",
            "description": "virtual payment",
            "collection_methods": [
                {
                    "id": "bank_Iz5sGHZaDcwXejCD",
                    "object": "bank_account",
                    "name": "Carla",
                    "account_no": "AP09AR000000000016",
                    "ifsc": "YESB0CMSNOC",
                    "created_at": 1560339872
                }
            ],
            "notification_method": "both",
            "customer_notification_by": "platform",
            "notes": {
                "channel": "virtual_account"
            },
            "created_at": 1560339872
        }
    ]
}

Returns a list of virtual accounts created previously. The virtual accounts are listed in reverse chronological order, with the most recent virtual account appearing first.

ARGUMENTS

count default is 10
A limit on the number of virtual account objects to be returned. This can range between 1 and 100.
skip default is 0
Represents number of virtual account objects to be skipped
from
A filter criterion based on the created_at field of the virtual account object. Value can be a timestamp. Returns Virtual accounts created on or after this timestamp.
to
A filter criterion based on the created_at field of the virtual account object. Value can be a timestamp. Returns Virtual accounts created on or before this timestamp.

Returns

An object with total_count attribute containing the total count of virtual accounts matching the given request, object attribute containing list and a data attribute containing an array of virtual account objects.

Each element in the array of data attribute is a separate virtual account object. If no virtual accounts exist, the resulting array will be empty.

You can optionally set the filter criteria to only retrieve virtual accounts that match the criteria.

Retrieve a Virtual account

Definition

GET https://payabbhi.com/api/v1/virtual_accounts/{virtual_account_id}
<?php
$client->virtualaccount->retrieve({virtual_account_id});
client.virtual_account.retrieve({virtual_account_id})
Virtual_Account virtualAccount = Virtual_Account.retrieve({virtual_account_id});
client.VirtualAccount.Retrieve({virtual_account_id});
payabbhi.virtual_accounts.retrieve({virtual_account_id},
  (error, virtual_account) => {
    ...
});

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/virtual_accounts/va_FMkEnEGEmHhMKZzL
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->virtualaccount->retrieve('va_FMkEnEGEmHhMKZzL');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.virtual_account.retrieve('va_FMkEnEGEmHhMKZzL')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Virtual_Account virtualAccount = Virtual_Account.retrieve("va_FMkEnEGEmHhMKZzL");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var virtualAccount = client.VirtualAccount.Retrieve("va_FMkEnEGEmHhMKZzL");
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.virtual_accounts.retrieve('va_FMkEnEGEmHhMKZzL',
  (error, virtual_account) => {
    // virtual_account is the Virtual Account object retrieved
});

JSON Response

com.payabbhi.model.VirtualAccount JSON :
{
    "id": "va_FMkEnEGEmHhMKZzL",
    "object": "virtual_account",
    "status": "active",
    "paid_amount": 0,
    "customer_id": "cust_2BCT1Tvgg1gNjVPu",
    "email": "test@example.com",
    "contact_no": "9999999999",
    "order_id": "",
    "invoice_id": "",
    "description": "virtual payment",
    "collection_methods": [
        {
            "id": "bank_TLMgzPTuTQ8zM4LQ",
            "object": "bank_account",
            "name": "Bruce",
            "account_no": "AP09AR000000000000",
            "ifsc": "YESB0CMSNOC",
            "created_at": 1560433809
        }
    ],
    "notification_method": "both",
    "customer_notification_by": "platform",
    "notes": {
        "channel": "virtual_account"
    },
    "created_at": 1560433809
  }

Returns a Virtual account object matching the virtual_account_id. Else it returns an error response.

ARGUMENTS

virtual_account_id
The identifier of the virtual account to be retrieved.

Returns

Returns a virtual account object, given a valid virtual account identifier was provided, and returns an error otherwise.

Close a virtual account

Definition

PATCH https://payabbhi.com/api/v1/virtual_accounts/{virtual_account_id}
<?php
$client->virtualaccount->close({virtual_account_id});
client.virtual_account.close({virtual_account_id})
Virtual_Account virtualAccount = Virtual_Account.close({virtual_account_id});
client.VirtualAccount.Retrieve({virtual_account_id}).Close();
payabbhi.virtual_accounts.close({virtual_accountId},
(error, virtual_account) => {
  ...
});

Example Request:

$ curl -u access_id:secret_key -X PATCH \
  https://payabbhi.com/api/v1/virtual_accounts/va_FMkEnEGEmHhMKZzL
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->virtualaccount->close('va_FMkEnEGEmHhMKZzL');
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Virtual_Account virtualAccount = Virtual_Account.close("va_FMkEnEGEmHhMKZzL");
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.virtual_account.close('va_FMkEnEGEmHhMKZzL')
using Payabbhi;
var client = new Client("accessId", "secretKey");
var virtualAccount = client.VirtualAccount.Retrieve("va_FMkEnEGEmHhMKZzL").Close();
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.virtual_accounts.close('va_FMkEnEGEmHhMKZzL',
  (error, virtual_account) => {
  // virtual_account is Virtual Account Object to be closed.
});

JSON Response

com.payabbhi.model.VirtualAccount JSON :
{
    "id": "va_FMkEnEGEmHhMKZzL",
    "object": "virtual_account",
    "status": "closed",
    "paid_amount": 200000,
    "customer_id": "cust_2BCT1Tvgg1gNjVPu",
    "email": "test@example.com",
    "contact_no": "9999999999",
    "order_id": "",
    "invoice_id": "",
    "description": "virtual payment",
    "collection_methods": [
        {
            "id": "bank_TLMgzPTuTQ8zM4LQ",
            "object": "bank_account",
            "name": "Bruce",
            "account_no": "AP09AR000000000000",
            "ifsc": "YESB0CMSNOC",
            "created_at": 1560433809
        }
    ],
    "notification_method": "both",
    "customer_notification_by": "platform",
    "notes": {
        "channel": "virtual_account"
    },
    "created_at": 1560433809
  }

ARGUMENTS

virtual_account_id
The unique identifier of the Virtual Account which will be closed.

Returns

Returns the virtual account object if the virtual account is closed successfully. Else it returns an error response.

List all Payments for a Virtual account

Definition

GET https://payabbhi.com/api/v1/virtual_accounts/{virtual_account_id}/payments
<?php
$client->virtualaccount->payments({virtual_account_id});
client.virtual_account.payments(virtual_account_id)
PayabbhiCollection<Payment> payments = Virtual_Account.payments({virtual_account_id});
client.VirtualAccount.Retrieve({virtual_account_id}).Payments();
payabbhi.virtual_accounts.payments({virtual_account_id},
(error, payments) => {
  ...
});

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/virtual_accounts/va_PakYenlyIIPjGwoU/payments
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->virtualaccount->payments('va_PakYenlyIIPjGwoU');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.virtual_account.payments('va_PakYenlyIIPjGwoU')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Payment> payments = Virtual_Account.payments("va_PakYenlyIIPjGwoU",
  new HashMap<String, Object>() {
    {
      put("count", 2);
    }
  });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var payments = client.VirtualAccount.Retrieve("va_PakYenlyIIPjGwoU").Payments();
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.virtual_accounts.payments('va_PakYenlyIIPjGwoU',
  (error, payments) => {
  // payments is the list of Payment object
});

JSON Response:

com.payabbhi.model.VirtualAccount JSON :
{
    "total_count": 2,
    "object": "list",
    "data": [
        {
            "id": "pay_4I4NDogajGtV9bVo",
            "object": "payment",
            "amount": 50000,
            "currency": "INR",
            "status": "captured",
            "order_id": "",
            "invoice_id": "",
            "international": false,
            "method": "bank_account",
            "description": "virtual payment",
            "card": "",
            "bank": "",
            "wallet": "",
            "vpa": "",
            "emi": null,
            "customer_id": "cust_2BCT1Tvgg1gNjVPu",
            "email": "test@example.com",
            "contact": "9999999999",
            "notes": {
                "note_to_beneficiary": "payment for test",
                "vac_channel": "virtual_account"
            },
            "fee": 200,
            "service_tax": 0,
            "payout_amount": 49800,
            "payout_type": "Cr",
            "settlement_id": "stl_abjBUMNyLnzGbdqU",
            "refunded_amount": 0,
            "refund_status": "",
            "refunds": {
                "total_count": 0,
                "object": "list",
                "data": []
            },
            "error_code": "",
            "error_description": "",
            "created_at": 1560409074,
            "virtual_account_id": "va_PakYenlyIIPjGwoU",
            "payment_page_id" : "",
            "virtual_account_id": "",
            "payment_page_id": "",
            "bank_response": {},
            "commercial_card": false
        },
        {
            "id": "pay_ylmgV0BCWkO9C4Sa",
            "object": "payment",
            "amount": 50000,
            "currency": "INR",
            "status": "captured",
            "order_id": "",
            "invoice_id": "",
            "international": false,
            "method": "bank_account",
            "description": "virtual payment",
            "card": "",
            "bank": "",
            "wallet": "",
            "vpa": "",
            "emi": null,
            "customer_id": "cust_2BCT1Tvgg1gNjVPu",
            "email": "test@example.com",
            "contact": "9999999999",
            "notes": {
                "note_to_beneficiary": "payment for test",
                "vac_channel": "virtual_account"
            },
            "fee": 200,
            "service_tax": 0,
            "payout_amount": 49800,
            "payout_type": "Cr",
            "settlement_id": "stl_abjBUMNyLnzGbFOC",
            "refunded_amount": 0,
            "refund_status": "",
            "refunds": {
                "total_count": 0,
                "object": "list",
                "data": []
            },
            "error_code": "",
            "error_description": "",
            "created_at": 1560408860,
            "virtual_account_id": "va_PakYenlyIIPjGwoU",
            "payment_page_id" : "",
            "bank_response": {},
            "commercial_card": false
        }
    ]
}

Returns a list of all payments for a given virtual account that have previously been created. The payments are listed in reverse chronological order, with the most recent payment appearing first.

ARGUMENTS

virtual_account_id
The identifier of the virtual account whose payments are to be retrieved.

Returns

An object with total_count attribute containing the total count of payments corresponding to the given Virtual account, object attribute containing list and a data attribute containing an array of payment objects.

Each element in the array of data attribute is a separate payment object. If no payments exist for the Virtual account, the resulting array will be empty.

Retrieve Virtual account details for a payment

Definition

GET https://payabbhi.com/api/v1/payments/{payment_id}/virtual_account
<?php
$client->payment->retrieve({$paymentID})->virtual_account();
client.payment.virtual_account({payment_id});
Payment response = Payment.virtual_account({paymentID});
client.Payment.Virtual_Account({payment_id});
payabbhi.payments.virtual_account({paymentId},
  (error, payment) => {
    ...
});

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/payments/pay_4I4NDogajGtV9bVo/virtual_account
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->payment->retrieve('pay_4I4NDogajGtV9bVo')->virtual_account();
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.payment.virtual_account('pay_4I4NDogajGtV9bVo')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Payment response = Payment.virtual_account("pay_4I4NDogajGtV9bVo");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var response = client.Payment.Virtual_Account("pay_4I4NDogajGtV9bVo");
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.payments.virtual_account('pay_4I4NDogajGtV9bVo' ,
(error, payment) => {
  // payment is the Payment Object  
});

JSON Response:

com.payabbhi.model.Payment JSON :
{
    "id": "pay_4I4NDogajGtV9bVo",
    "object": "payment",
    "amount": 50000,
    "currency": "INR",
    "status": "captured",
    "order_id": "",
    "invoice_id": "",
    "international": false,
    "method": "bank_account",
    "description": "virtual payment",
    "card": "",
    "bank": "",
    "wallet": "",
    "vpa": "",
    "email": "test@example.com",
    "contact_no": "9999999999",
    "notes": {
        "note_to_beneficiary": "payment for test",
        "vac_channel": "virtual_account"
    },
    "fee": 200,
    "service_tax": 0,
    "payout_amount": 49800,
    "payout_type": "Cr",
    "settlement_id": "stl_abjBUMNyLnzGbFOC",
    "refunded_amount": 0,
    "refund_status": "",
    "refunds": {
        "total_count": 0,
        "object": "list",
        "data": []
    },
    "payer_bank_account": {
        "id": "bank_fANeUeWFt0AmUkYD",
        "object": "bank_account",
        "type": "NEFT",
        "name": "Carla Thompson",
        "address": "",
        "account_no": "9867234567123459800002355",
        "account_type": "Savings",
        "ifsc": "HDFC0000043",
        "note_to_beneficiary": "payment for test",
        "created_at": 1560409074
    },
    "virtual_account": {
        "id": "va_PakYenlyIIPjGwoU",
        "object": "virtual_account",
        "status": "active",
        "paid_amount": 100000,
        "customer_id": "cust_2BCT1Tvgg1gNjVPu",
        "email": "test@example.com",
        "contact_no": "9999999999",
        "order_id": "",
        "invoice_id": "",
        "description": "virtual payment",
        "collection_methods": [
            {
                "id": "bank_JuiL7ZVhewQPyFg2",
                "object": "bank_account",
                "name": "Bruce",
                "account_no": "AP09ARfqrbt62LEpT9YEGyk62zUO2YrEmg",
                "ifsc": "YESB0CMSNOC",
                "created_at": 1560408743
            }
        ],
        "notification_method": "both",
        "customer_notification_by": "platform",
        "notes": {
            "channel": "virtual_account"
        },
        "created_at": 1560408743
    },
    "error_code": "",
    "error_description": "",
    "created_at": 1560409074,
    "virtual_account_id": "",
    "payment_page_id": "",
    "bank_response": {}
}

Returns the payer details and virtual account details for a given payment that have previously been created.

ARGUMENTS

payment_id
The identifier of the payment whose virtual account details are to be retrieved.

Returns

Returns a payment object, given a valid payment identifier was provided, and returns an error otherwise.

Beneficiary Account

The Beneficiary Object

JSON Response

com.payabbhi.model.Beneficiary JSON :
{
    "id": "bene_e623672798ee493b",
    "object": "beneficiary_account",
    "name": "ben_test",
    "contact_no": "1234567890",
    "email_id": "benf1170@abc.com",
    "business_name": "benf_business",
    "business_entity_type": "Individual",
    "beneficiary_name": "SSG",
    "ifsc": "ABCD0001890",
    "bank_account_number": "50100000219",
    "account_type": "Savings",
    "status": "registered",
    "notes": {
        "count": "2",
        "web": "website"
    },
    "created_at": 1562333156
}

ATTRIBUTES

id string
Unique identifier of beneficiary object.
object string, value is "beneficiary_account"
Represents the object type which in this case is beneficiary_account.
name string
Name of the beneficiary account owner.
contact_no string
Contact number of the beneficiary account owner.
email_id string
Email ID of the beneficiary account owner.
business_name string
Legal name of Beneficiary's business to appear in any official communication.
business_entity_type string
Type of Beneficiary's Business Entity
beneficiary_name string
Name of the Beneficiary of the Bank Account.
ifsc positive integer
IFSC code of the bank branch of beneficiary bank account.
bank_account_number string
Bank Account Number of the Beneficiary Account Owner.
account_type json object
Type of Bank Account. The value can be one of Current, Savings or Others.
status string
The Beneficiary Account status is one of created or registered.
notes json object
Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the beneficiary object in a structured format.
created_at timestamp
beneficiary creation timestamp. Measured in seconds since the Unix epoch.

Create a beneficiary

Definition

POST https://payabbhi.com/api/v1/beneficiaryaccounts
<?php
$client->beneficiaryaccount->create();
client.beneficiaryaccount.create()
BeneficiaryAccount beneficiaryAccount = BeneficiaryAccount.create();
client.BeneficiaryAccount.Create();
payabbhi.beneficiaryaccounts.create(
  (error, beneficiary_account) => {
  ...
});

Example Request:

$  curl -u access_id:secret_key \
   https://payabbhi.com/api/v1/beneficiaryaccounts \
   -d name="Bruce Wayne" \
   -d beneficiary_name=ben_test \
   -d ifsc=IFSC0001890 \
   -d bank_account_number=50100000219 \
   -d account_type=Savings \
   -d contact_no=1234567890 \
   -d email=benf1170@abc.com \
   -d business_name=benf_business \
   -d business_entity_type=Individual \
   -d notes[item_count]=2 \
   -d notes[sales_channel]=website
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->beneficiaryaccount->create(array("name" => "Bruce Wayne",
                                "beneficiary_name" => "ben_test",
                                "ifsc" => "IFSC0001890",
                                "bank_account_number" => "50100000219",
                                "account_type" => "Savings"));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.beneficiaryaccount.create(data={'name': 'Bruce Wayne',
                                       'beneficiary_name': 'ben_test',
                                       'ifsc': 'IFSC0001890',
                                       'bank_account_number': '50100000219',
                                       'account_type': 'Savings'})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
BeneficiaryAccount beneficiaryAccount =
    BeneficiaryAccount.create(
        new HashMap<String, Object>() {
          {
            put("name","Bruce Wayne");
            put("beneficiary_name", "ben_test");
            put("ifsc", "IFSC0001890");
            put("bank_account_number", "50100000219");
            put("account_type", "Savings");
          }
        });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var beneficiaryAccount = client.BeneficiaryAccount.Create(
  new Dictionary<string, object>(){
    {"name", "Bruce Wayne"},
    {"beneficiary_name", "ben_test"},
    {"ifsc", "IFSC0001890"},
    {"bank_account_number", "50100000219"},
    {"account_type", "Savings"}});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.beneficiaryaccounts.create({
      name: "Bruce Wayne",
      beneficiary_name: "ben_test",
      ifsc: "IFSC0001890",
      bank_account_number: 50100000219,
      account_type: "Savings",
    }, (error, beneficiary_account) => {
      // beneficiary_account contains created beneficiary Account details in JSON format.
});

JSON Response


{
    "id": "bene_e623672798ee493b",
    "object": "beneficiary_account",
    "name": "Bruce Wayne",
    "contact_no": "1234567890",
    "email_id": "benf1170@abc.com",
    "business_name": "benf_business",
    "business_entity_type": "Individual",
    "beneficiary_name": "ben_test",
    "ifsc": "IFSC0001890",
    "bank_account_number": "50100000219",
    "account_type": "Savings",
    "status": "registered",
    "notes": {
        "count": "2",
        "web": "website"
    },
    "created_at": 1562333156
}

Creates a new beneficiary account.

ARGUMENTS

name
Name of the beneficiary account owner.
beneficiary_name
Name of the beneficiary of the bank account.
ifsc
IFSC code of the bank branch of the bank account.
bank_account_number
Bank Account Number of the beneficiary account owner.
account_type
Type of Bank Account. The value can be one of Current, Savings or Others.
contact_no
Contact number of the beneficiary account owner.
email
Email ID of the beneficiary account owner.
business_name
Legal name of Beneficiary's business to appear in any official communication.
business_entity_type
Type of Beneficiary's Business Entity.
notes
Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the beneficiary account object in a structured format.

Returns

Returns the beneficiary account object if the beneficiary account is created successfully. Else it returns an error response.

List all beneficiary accounts

Definition

GET https://payabbhi.com/api/v1/beneficiaryaccounts
<?php
$client->beneficiaryaccount->all();
client.beneficiaryaccount.all()
PayabbhiCollection<BeneficiaryAccount> beneficiaryAccounts = BeneficiaryAccount.all();
client.BeneficiaryAccount.All()
payabbhi.beneficiaryaccounts.all(
  (error, beneficiary_accounts) => {
    ...
});

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/beneficiaryaccounts?count=3
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->beneficiaryaccount->all(array('count'=>3));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.beneficiaryaccount.all(data={'count': 2})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<BeneficiaryAccount> beneficiaryAccounts = BeneficiaryAccount.all(
        new HashMap<String, Object>() {
          {
            put("count", 3);
          }
        });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var beneficiaryAccounts = client.BeneficiaryAccount.All(
              new Dictionary<string, object>() {
                {"count", 2} } );

const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.beneficiaryaccounts.all({ count: 2 },
  (error, beneficiary_accounts) => {
  // beneficiary_accounts is list of BeneficiaryAccount Object
});

JSON Response

com.payabbhi.model.beneficiary account JSON :
{
    "total_count": 45,
    "object": "list",
    "data": [
        {
            "id": "bene_d03f199815ef4ce9",
            "object": "beneficiary_account",
            "name": "ui_test02",
            "contact_no": "9999999999",
            "email_id": "test@gmail.com",
            "business_name": "ui_test02",
            "business_entity_type": "Individual",
            "beneficiary_name": "ui_test02",
            "ifsc": "ABCD0001890",
            "bank_account_number": "50100030219",
            "account_type": "Savings",
            "status": "created",
            "notes": null,
            "created_at": 1562322992
        },
        {
            "id": "bene_d7d8b37d264c4264",
            "object": "beneficiary_account",
            "name": "ui_test",
            "contact_no": "9888888888",
            "email_id": "ui_test@abc.com",
            "business_name": "UI-Test",
            "business_entity_type": "Individual",
            "beneficiary_name": "ui_test",
            "ifsc": "ABCD0001890",
            "bank_account_number": "50100000219",
            "account_type": "Savings",
            "status": "registered",
            "notes": {
                "api": "no",
                "ui": "yes"
            },
            "created_at": 1562322515
        },
        {
            "id": "bene_e8c8fb2ac5034d57",
            "object": "beneficiary_account",
            "name": "ben_test",
            "contact_no": "1234567890",
            "email_id": "benf109@abc.com",
            "business_name": "benf_business",
            "business_entity_type": "B2B",
            "beneficiary_name": "SSG",
            "ifsc": "ABCD0001890",
            "bank_account_number": "50100005219",
            "account_type": "Savings",
            "status": "registered",
            "notes": {
                "count": "2",
                "web": "yes"
            },
            "created_at": 1562313764
        }
    ]
}

Returns a list of beneficiary accounts created previously. The beneficiary accounts are listed in reverse chronological order, with the most recent beneficiary account appearing first.

ARGUMENTS

count default is 10
A limit on the number of beneficiary account objects to be returned. This can range between 1 and 100.
skip default is 0
Represents number of beneficiary account objects to be skipped
from
A filter criterion based on the created_at field of the beneficiary account object. Value can be a timestamp. Returns beneficiary accounts created on or after this timestamp.
to
A filter criterion based on the created_at field of the beneficiary account object. Value can be a timestamp. Returns beneficiary accounts created on or before this timestamp.

Returns

An object with total_count attribute containing the total count of beneficiary accounts matching the given request, object attribute containing list and a data attribute containing an array of beneficiary account objects.

Each element in the array of data attribute is a separate beneficiary account object. If no beneficiary accounts exist, the resulting array will be empty.

You can optionally set the filter criteria to only retrieve beneficiary accounts that match the criteria.

Retrieve a beneficiary

Definition

GET https://payabbhi.com/api/v1/beneficiaryaccounts/{id}
<?php
$client->beneficiaryaccount->retrieve({beneficiaryaccount_id});
client.beneficiaryaccount.retrieve({beneficiaryaccount_id})
BeneficiaryAccount beneficiaryAccount = BeneficiaryAccount.retrieve({beneficiary_id});
client.BeneficiaryAccount.Retrieve({beneficiary_id});
payabbhi.beneficiaryaccounts.retrieve({beneficiaryId},
  (error, beneficiary_account) => {
    ...
});

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/beneficiaryaccounts/bene_d7d8b37d264c4264
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->beneficiaryaccount->retrieve('bene_d7d8b37d264c4264');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.beneficiaryaccount.retrieve('bene_d7d8b37d264c4264')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
BeneficiaryAccount beneficiaryAccount = BeneficiaryAccount.retrieve("bene_d7d8b37d264c4264");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var beneficiaryAccount = client.BeneficiaryAccount.Retrieve("bene_d7d8b37d264c4264");
const payabbhi = require('payabbhi')('access_id','secret_key');

payabbhi.beneficiaryaccounts.retrieve('bene_e623672798ee493',
  (error, beneficiary_account) => {
    // beneficiary_account is the Beneficiary Account object retrieved
});

JSON Response

com.payabbhi.model.Beneficiary JSON :
{
    "id": "bene_d7d8b37d264c4264",
    "object": "beneficiary_account",
    "name": "ui_test",
    "contact_no": "9888888888",
    "email_id": "ui_test@abc.com",
    "business_name": "UI-Test",
    "business_entity_type": "Individual",
    "beneficiary_name": "ui_test",
    "ifsc": "ABCD0001890",
    "bank_account_number": "50100000219",
    "account_type": "Savings",
    "status": "registered",
    "notes": {
        "api": "no",
        "ui": "yes"
    },
    "created_at": 1562322515
}

Returns a Beneficiary object matching the beneficiary_id. Else it returns an error response.

ARGUMENTS

beneficiary_id
The identifier of the beneficiary to be retrieved.

Returns

Returns a beneficiary object, given a valid beneficiary identifier was provided, and returns an error otherwise.

Transfers

The Transfer Object

JSON Response

com.payabbhi.model.Transfer JSON :
{
    "id": "trans_mjf5M8vnn3wDC46K",
    "object": "transfer",
    "description": "Tranfer 1",
    "source_id": "pay_ddymU1YCAVtw9D0S",
    "beneficiary_id": "bene_Za30i2k3p6blq3i1",
    "amount": 20,
    "currency": "INR",
    "fee": 0,
    "gst": 0,    
    "amount_reversed": "",
    "settlement_id": "",
    "settled": "",
    "notes": null,
    "created_at": 1562233308
}

ATTRIBUTES

id string
Unique identifier of transfer object.
object string, value is "transfer"
Represents the object type which in this case is transfer.
description string
Description of the Transfer.
source_id string
Unique identifier of the source Payment that was used to fund this transfer. Please refer to Payment API for more details.
beneficiary_id string
Unique identifier of the beneficiary, whose bank account would be credited for this Transfer.
amount positive integer
Amount to be transferred. A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00).
currency string
Three-letter ISO currency code. Currently only INR is supported.
fee positive integer
Fee charged by us including gst for facilitating this transfer. A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00).
gst positive integer
GST charged. A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00).
amount_reversed positive integer
The amount reversed for this transfer. A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00).
settlement_id string
Unique identifier of a Settlement object against which the transfer was settled.
settled boolean
If true, then the transfer has been settled.
notes json object
Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the transfer object in a structured format.
created_at timestamp
Transfer creation timestamp. Measured in seconds since the Unix epoch.

Create a direct transfer

Definition

POST https://payabbhi.com/api/v1/transfers
<?php
$client->transfer->create();
client.transfer.create()
PayabbhiCollection<Transfer> transfers = Transfer.create();
client.Transfer.Create();
payabbhi.transfers.create(
  (error, transfer) => {
  ...
});

Example Request:

$  curl -u access_id:secret_key \
   https://payabbhi.com/api/v1/transfers \
   -d source_id="pay_zlAsx5g7yH88xcFE" \
   -d transfers[0][amount]=20 \
   -d transfers[0][currency]="INR" \
   -d transfers[0][description]="Transfer 1" \
   -d transfers[0][beneficiary_id]="bene_d7d8b37d264c4264" \
   -d transfers[0][notes][home]=kolkata \
   -d transfers[1][amount]=30 \
   -d transfers[1][currency]="INR" \
   -d transfers[1][description]="Transfer 2" \
   -d transfers[1][beneficiary_id]="bene_d7d8b37d264c4264"\
   -d transfers[1][notes][sales_channel]=website
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$params = array(
                'transfers' => array(
                                    array(
                                          'amount'       => 20,
                                          'currency'     => 'INR',
                                          'description'  => 'Tranfer 1',
                                          'beneficiary_id' => 'bene_d7d8b37d264c4264'
                                        ),
                                    array(
                                          'amount'       => 30,
                                          'currency'     => 'INR',
                                          'description'  => 'Transfer 2',
                                          'beneficiary_id' => 'bene_d7d8b37d264c4264')));
$client->transfer->create($params);
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.transfer.create(data={'transfers':[
                                          { 'amount':20,
                                            'currency':'INR',
                                            'beneficiary_id':'bene_d7d8b37d264c4264',
                                            'description': 'Transfer 1'
                                          },
                                          { 'amount':30,
                                            'currency':'INR',
                                            'beneficiary_id':'bene_d7d8b37d264c4264',
                                            'description': 'Transfer 2'
                                          }
                                          ]})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";

Map<String, Object> transfer1 = new HashMap<>();
transfer1.put("beneficiary_id", "bene_d7d8b37d264c4264");
transfer1.put("amount", 20);
transfer1.put("currency", "INR");
transfer1.put("description", "Transfer 1");

Map<String, Object> transfer2 = new HashMap<>();
transfer2.put("beneficiary_id", "bene_d7d8b37d264c4264");
transfer2.put("amount", 30);
transfer2.put("currency", "INR");
transfer2.put("description", "Transfer 2");

List<Object> tranfersPayload = new ArrayList<>();
tranfersPayload.add(transfer1);
tranfersPayload.add(transfer2);

Map<String, Object> options = new HashMap<>();
options.put("transfers", tranfersPayload);
PayabbhiCollection<Transfer> transfers = Transfer.create(options);
using Payabbhi;
var client = new Client("accessId", "secretKey");
Dictionary<string, object> transfer1 = new Dictionary<string, object>() {
  {"amount", 20 },
  {"currency", "INR" },
  {"description", "Tranfer 1" },
  {"beneficiary_id", "bene_d7d8b37d264c4264" }
};
Dictionary<string, object> transfer2 = new Dictionary<string, object>()
{
  {"amount", 30 },
  {"currency", "INR" },
  {"description", "Tranfer 2" },
  {"beneficiary_id", "bene_d7d8b37d264c4264" }
};
Dictionary<string, object>[] transferArr = { transfer1, transfer2 };
var directTransfer = client.Transfer.Create(new Dictionary<string, object>() {
	{"transfers", transferArr }
});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.transfers.create(
      {
        transfers: [
          {
            amount: 20,
            currency: 'INR',
            description: 'Tranfer 1',
            beneficiary_id: 'bene_d7d8b37d264c4264'
          },
          {
            amount: 30,
            currency: 'INR',
            description: 'Tranfer 2',
            beneficiary_id: 'bene_d7d8b37d264c4264'
          }
        ]
      }, (error, transfer) => {
      // transfer contains created transfer details in JSON format.
});

JSON Response


{
    "total_count": 2,
    "object": "list",
    "data": [
        {
            "id": "trans_Hq3YBZLbhmtW3QY3",
            "object": "transfer",
            "description": "Tranfer 1",
            "source_id": "",
            "beneficiary_id": "bene_d7d8b37d264c4264",
            "amount": 20,
            "currency": "INR",
            "fee": 0,
            "gst": 0,
            "amount_reversed": "",
            "settlement_id": "",
            "settled": "",
            "notes": {
                "home": "kolkata"
            },
            "created_at": 1562590626
        },
        {
            "id": "trans_4wEDwGJN6d5FOcXl",
            "object": "transfer",
            "description": "Tranfer 2",
            "source_id": "",
            "beneficiary_id": "bene_d7d8b37d264c4264",
            "amount": 30,
            "currency": "INR",
            "fee": 0,
            "gst": 0,         
            "amount_reversed": "",
            "settlement_id": "",
            "settled": "",
            "notes": {
                "home": "kolkata"
            },
            "created_at": 1562590626
        }
    ]
}

Creates a new transfer.

ARGUMENTS

source_id
Unique identifier of the source Payment that was used to fund this transfer. Please refer to Payment API for more details.
amount
Amount to be transferred. A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00).
currency
Three-letter ISO currency code. Currently only INR is supported.
beneficiary_id
Unique identifier of the beneficiary, whose bank account would be credited for this Transfer.
description
Description of the Transfer.
notes
Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the transfer object in a structured format.

Returns

Returns the transfer object if the transfer is created successfully. Else it returns an error response.

Create a transfer

Definition

POST https://payabbhi.com/api/v1/payments/{source_id}/transfers
<?php
$payment = $client->payment->retrieve({payment_id});
$payment->transfer();
client.payment.retrieve({source_id}).transfer()
PayabbhiCollection<Transfer> transfers = Payment.transfer({source_id});
client.Payment.Retrieve({payment_id}).Transfer();
payabbhi.payments.transfer({source_id}
  (error, transfer) => {
  ...
});
Payabbhi::Transfer.create({source_id})

Example Request:

$  curl -u access_id:secret_key \
   https://payabbhi.com/api/v1/payments/pay_zlAsx5g7yH88xcFE/transfers \
   -d transfers[0][amount]=20 \
   -d transfers[0][currency]="INR" \
   -d transfers[0][description]="Tranfer 1" \
   -d transfers[0][beneficiary_id]="bene_d7d8b37d264c4264" \
   -d transfers[1][amount]=30 \
   -d transfers[1][currency]="INR" \
   -d transfers[1][description]="Tranfer 2" \
   -d transfers[1][beneficiary_id]="bene_d7d8b37d264c4264"
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$payment = $client->payment->retrieve('pay_zlAsx5g7yH88xcFE');
$params = array(
                'transfers' => array(
                                    array(
                                          'amount'       => 20,
                                          'currency'     => 'INR',
                                          'description'  => 'Tranfer 1',
                                          'beneficiary_id' => 'bene_d7d8b37d264c4264'
                                        ),
                                    array(
                                          'amount'       => 30,
                                          'currency'     => 'INR',
                                          'description'  => 'Transfer 2',
                                          'beneficiary_id' => 'bene_d7d8b37d264c4264')));
$payment->transfer($params);
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.payment.retrieve('pay_zlAsx5g7yH88xcFE').transfer(data={'transfers':[{'amount':20,
                                             'currency':'INR',
                                             'description': 'Transfer 1',
                                             'beneficiary_id':'bene_d7d8b37d264c4264'
                                            },
                                            {
                                             'amount':30,
                                             'currency':'INR',
                                             'description': 'Transfer 2',
                                             'beneficiary_id':'bene_d7d8b37d264c4264'
                                            }]})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";

Map<String, Object> transfer1 = new HashMap<>();
transfer1.put("beneficiary_id", "bene_d7d8b37d264c4264");
transfer1.put("amount", 20);
transfer1.put("currency", "INR");
transfer1.put("description", "Transfer 1");

Map<String, Object> transfer2 = new HashMap<>();
transfer2.put("beneficiary_id", "bene_d7d8b37d264c4264");
transfer2.put("amount", 30);
transfer2.put("currency", "INR");
transfer2.put("description", "Transfer 2");

List<Object> tranfersPayload = new ArrayList<>();
tranfersPayload.add(transfer1);
tranfersPayload.add(transfer2);

Map<String, Object> options = new HashMap<>();
options.put("transfers", tranfersPayload);
PayabbhiCollection<Transfer> transfers = Payment.transfer("pay_zlAsx5g7yH88xcFE", options);
using Payabbhi;
var client = new Client("accessId", "secretKey");
var payment = client.Payment.Retrieve("pay_zlAsx5g7yH88xcFE");
Dictionary<string, object> transfer1 = new Dictionary<string, object>() {
  {"amount", 20 },
  {"currency", "INR" },
  {"description", "Tranfer 1" },
  {"beneficiary_id", "bene_d7d8b37d264c4264" }
};
Dictionary<string, object> transfer2 = new Dictionary<string, object>()
{
  {"amount", 30 },
  {"currency", "INR" },
  {"description", "Tranfer 2" },
  {"beneficiary_id", "bene_d7d8b37d264c4264" }
};
Dictionary<string, object>[] transferArr = { transfer1, transfer2 };
var transfers = payment.Transfer(new Dictionary<string, object>() {
	{"transfers", transferArr }
});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.payments.transfer('pay_zlAsx5g7yH88xcFE',
      {
        transfers: [
          {
            amount: 20,
            currency: 'INR',
            description: 'Tranfer 1',
            beneficiary_id: 'bene_d7d8b37d264c4264'
          },
          {
            amount: 30,
            currency: 'INR',
            description: 'Tranfer 2',
            beneficiary_id: 'bene_d7d8b37d264c4264'
          }
        ]
      }, (error, transfer) => {
      // transfer contains created transfer details in JSON format.
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
transfer = Payabbhi::Transfer.create('pay_zlAsx5g7yH88xcFE',
                                      transfers: [
                                        {
                                          amount: 20,
                                          currency: 'INR',
                                          description: 'Tranfer 1',
                                          beneficiary_id: 'bene_d7d8b37d264c4264'
                                        },
                                        {
                                          amount: 30,
                                          currency: 'INR',
                                          description: 'Tranfer 2',
                                          beneficiary_id: 'bene_d7d8b37d264c4264'
                                        }
                                      ])

JSON Response

com.payabbhi.model.Transfer JSON :
{
  "total_count": 2,
  "object": "list",
  "data": [
    {
      "id": "trans_b5ggPH8LUbfe0Qfg",
      "object": "transfer",
      "description": "Tranfer 1",
      "source_id": "pay_zlAsx5g7yH88xcFE",
      "beneficiary_id": "bene_d7d8b37d264c4264",
      "amount": 20,
      "currency": "INR",
      "fee": 0,
      "gst": 0,
      "amount_reversed": "",
      "settlement_id": "",
      "settled": "",
      "notes":"",
      "created_at": 1562325980
    },
    {
      "id": "trans_cEYhAA3Qn8PCLmRN",
      "object": "transfer",
      "description": "Tranfer 2",
      "source_id": "pay_zlAsx5g7yH88xcFE",
      "beneficiary_id": "bene_d7d8b37d264c4264",
      "amount": 30,
      "currency": "INR",
      "amount_reversed": "",
      "settlement_id": "",
      "settled": "",  
      "notes":"",    
      "created_at": 1562325980
    }
  ]
}

Creates a new transfer.

ARGUMENTS

source_id
Unique identifier of the source Payment that was used to fund this transfer. Please refer to Payment API for more details.
amount
Amount to be transferred. A positive integer in the smallest currency unit (e.g., 5000 paisa denotes Rs 50.00).
currency
Three-letter ISO currency code. Currently only INR is supported.
beneficiary_id
Unique identifier of the beneficiary, whose bank account would be credited for this Transfer.
description
Description of the Transfer.
notes
Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the transfer object in a structured format.

Returns

Returns the transfer object if the transfer is created successfully. Else it returns an error response.

List all transfers

Definition

GET https://payabbhi.com/api/v1/transfers
<?php
$client->transfer->all();
client.transfer.all()
PayabbhiCollection<Transfer> transfers = Transfer.all();
client.Transfer.All();
payabbhi.transfers.all(
  (error, transfers) => {
    ...
});
Payabbhi::Transfer.all

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/transfers?count=3
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->transfer->all(array('count'=>2));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.transfer.all(data={'count': 2})
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Transfer> transfers = Transfer.all(
        new HashMap<String, Object>() {
            {
              put("count", 2);
            }
        });
using Payabbhi;
var client = new Client("accessId", "secretKey");
var transfers = client.Transfer.All(new Dictionary<string, object>() {
                {"count", 2}});
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.transfers.all({ count: 2 },
  (error, transfers) => {
    // transfers is list of Transfer Objects
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
transfer = Payabbhi::Transfer.all count: 2

JSON Response

com.payabbhi.model.Transfer JSON :
{
    "total_count": 41,
    "object": "list",
    "data": [
        {
            "id": "trans_TYowpEDy5VJzSFSE",
            "object": "transfer",
            "description": "Tranfer 2",
            "source_id": "pay_pu33Jx6315arp2I1",
            "beneficiary_id": "bene_Za30i2k3p6blq3i1",
            "amount": 30,
            "currency": "INR",
            "fee": 0,
            "gst": 0,
            "amount_reversed": "",
            "settlement_id": "",
            "settled": "",
            "notes": {
                "home": "kolkata"
            },
            "created_at": 1562329818
        },
        {
            "id": "trans_DdI90d0dB2LClwF5",
            "object": "transfer",
            "description": "Tranfer 1",
            "source_id": "pay_pu33Jx6315arp2I1",
            "beneficiary_id": "bene_Za30i2k3p6blq3i1",
            "amount": 20,
            "currency": "INR",
            "fee": 0,
            "gst": 0,            
            "amount_reversed": "",
            "settlement_id": "",
            "settled": "",
            "notes": {
                "home": "kolkata"
            },
            "created_at": 1562329818
        },
        {
            "id": "trans_MvmgY6Ng5MxZMvjo",
            "object": "transfer",
            "description": "Tranfer 2",
            "source_id": "pay_pu33Jx6315arp2I1",
            "beneficiary_id": "bene_Za30i2k3p6blq3i1",
            "amount": 30,
            "currency": "INR",
            "fee": 0,
            "gst": 0,            
            "amount_reversed": "",
            "settlement_id": "",
            "settled": "",
            "notes": {
                "home": "kolkata"
            },
            "created_at": 1562329792
        }
    ]
}

Returns a list of transfers created previously. The transfers are listed in reverse chronological order, with the most recent transfer appearing first.

ARGUMENTS

count default is 10
A limit on the number of transfer objects to be returned. This can range between 1 and 100.
skip default is 0
Represents number of transfer objects to be skipped
from
A filter criterion based on the created_at field of the transfer object. Value can be a timestamp. Returns Transfers created on or after this timestamp.
to
A filter criterion based on the created_at field of the transfer object. Value can be a timestamp. Returns Transfers created on or before this timestamp.

Returns

An object with total_count attribute containing the total count of transfers matching the given request, object attribute containing list and a data attribute containing an array of transfer objects.

Each element in the array of data attribute is a separate transfer object. If no transfers exist, the resulting array will be empty.

You can optionally set the filter criteria to only retrieve transfers that match the criteria.

Retrieve a transfer

Definition

GET https://payabbhi.com/api/v1/transfers/{transfer_id}
<?php
$client->transfer->retrieve({transfer_id})
client.transfer.retrieve({transfer_id})
Transfer transfer = Transfer.retrieve({transfer_id});
client.Transfer.Retrieve({transfer_id});
payabbhi.transfers.retrieve({transferId},
  (error, transfer) => {
    ...
});
Payabbhi::Transfer.retrieve({transfer_id})

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/transfers/trans_mjf5M8vnn3wDC46K
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->transfer->retrieve('trans_mjf5M8vnn3wDC46K');
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.transfer.retrieve('trans_mjf5M8vnn3wDC46K')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
Transfer transfer = Transfer.retrieve("trans_mjf5M8vnn3wDC46K");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var transfer = client.Transfer.Retrieve("trans_mjf5M8vnn3wDC46K");
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.transfers.retrieve('trans_mjf5M8vnn3wDC46K',
  (error, transfer) => {
    // transfer is the Transfer object retrieved
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
transfer = Payabbhi::Transfer.retrieve('trans_mjf5M8vnn3wDC46K')

JSON Response

com.payabbhi.model.Transfer JSON :
{
    "id": "trans_mjf5M8vnn3wDC46K",
    "object": "transfer",
    "description": "Tranfer 1",
    "source_id": "pay_ddymU1YCAVtw9D0S",
    "beneficiary_id": "bene_Za30i2k3p6blq3i1",
    "amount": 20,
    "currency": "INR",
    "fee": 0,
    "gst": 0,    
    "amount_reversed": "",
    "settlement_id": "",
    "settled": "",
    "notes": null,
    "created_at": 1562233308
}

Returns a Transfer object matching the transfer_id. Else it returns an error response.

ARGUMENTS

transfer_id
The identifier of the transfer to be retrieved.

Returns

Returns a transfer object, given a valid transfer identifier was provided, and returns an error otherwise.

List all transfers for a payment

Definition

GET https://payabbhi.com/api/v1/payments/{payment_id}/transfers
<?php
$client->payment->retrieve({payment_id})->transfers();
client.payment.transfers({payment_id})
PayabbhiCollection<Transfer> transfers = Payment.transfers({payment_id});
client.Payment.Retrieve({payment_id}).Transfers();
payabbhi.payments.transfers({paymentId},
  (error, transfers) => {
    ...
});
Payabbhi::Payment.transfers({payment_id})

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/payments/pay_ddymU1YCAVtw9D0S/transfers
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->payment->retrieve('pay_ddymU1YCAVtw9D0S')->transfers();
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.payment.transfers('pay_ddymU1YCAVtw9D0S')
import com.payabbhi.Payabbhi;
Payabbhi.accessId = "access_id";
Payabbhi.secretKey = "secret_key";
PayabbhiCollection<Transfer> transfers = Payment.transfers("pay_ddymU1YCAVtw9D0S");
using Payabbhi;
var client = new Client("accessId", "secretKey");
var transfers = client.Payment.Retrieve("pay_ddymU1YCAVtw9D0S").Transfers();
const payabbhi = require('payabbhi')('access_id','secret_key');
payabbhi.payments.transfers('pay_ddymU1YCAVtw9D0S',
  (error, transfers) => {
    // transfers is list of Transfer Objects of the payments
});
require 'payabbhi'
Payabbhi.access_id = 'access_id'
Payabbhi.secret_key = 'secret_key'
transfers = Payabbhi::Payment.transfers('pay_ddymU1YCAVtw9D0S')

JSON Response:

com.payabbhi.model.Transfer JSON :
{
    "total_count": 4,
    "object": "list",
    "data": [
        {
            "id": "trans_eoy8Fvbh30udJxPr",
            "object": "transfer",
            "description": "Tranfer 2",
            "source_id": "pay_ddymU1YCAVtw9D0S",
            "beneficiary_id": "bene_Za30i2k3p6blq3i1",
            "amount": 30,
            "currency": "INR",
            "fee": 0,
            "gst": 0,            
            "amount_reversed": "",
            "settlement_id": "",
            "settled": "",
            "notes": null,
            "created_at": 1562233308
        },
        {
            "id": "trans_mjf5M8vnn3wDC46K",
            "object": "transfer",
            "description": "Tranfer 1",
            "source_id": "pay_ddymU1YCAVtw9D0S",
            "beneficiary_id": "bene_Za30i2k3p6blq3i1",
            "amount": 20,
            "currency": "INR",
            "fee": 0,
            "gst": 0,            
            "amount_reversed": "",
            "settlement_id": "",
            "settled": "",
            "notes": null,
            "created_at": 1562233308
        },
        {
            "id": "trans_wg8Gf6NcS1yy2Lrg",
            "object": "transfer",
            "description": "Tranfer 2",
            "source_id": "pay_ddymU1YCAVtw9D0S",
            "beneficiary_id": "bene_Za30i2k3p6blq3i1",
            "amount": 30,
            "currency": "INR",
            "fee": 0,
            "gst": 0,            
            "amount_reversed": "",
            "settlement_id": "",
            "settled": "",
            "notes": null,
            "created_at": 1562231562
        },
        {
            "id": "trans_Q1KN7JGArQyEtbQP",
            "object": "transfer",
            "description": "Tranfer 1",
            "source_id": "pay_ddymU1YCAVtw9D0S",
            "beneficiary_id": "bene_Za30i2k3p6blq3i1",
            "amount": 20,
            "currency": "INR",
            "fee": 0,
            "gst": 0,            
            "amount_reversed": "",
            "settlement_id": "",
            "settled": "",
            "notes": null,
            "created_at": 1562231562
        }
    ]
}

Returns a list of all transfers for a given payment that have previously been created. The transfers are listed in reverse chronological order, with the most recent transfer appearing first.

ARGUMENTS

payment_id
The identifier of the payment whose transfers are to be retrieved.

Returns

An object with total_count attribute containing the total count of transfers corresponding to the given Payment, object attribute containing list and a data attribute containing an array of transfer objects.

Each element in the array of data attribute is a separate transfer object. If no transfers exist for the Payment, the resulting array will be empty.