NAV
cURL PHP Python Java .NET Node

Introduction

Payabbhi provides language bindings in PHP, Python,
Java, .Net, NodeJS 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 marshaling 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');

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;
}

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": 10,
  "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.
});

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
});

JSON Response:

com.payabbhi.model.PayabbhiCollection<Order> JSON :
{
  "total_count": 10,
  "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) => {
  ...
});

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.
});

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) => {
    ...
});

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
});

JSON Response:

com.payabbhi.model.PayabbhiCollection<Order> JSON :
{
  "total_count": 5,
  "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) => {
    ...
});

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
});

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) => {
    ...
});

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
});

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",
      "international": false,
      "method": "card",
      "description": "new payment done",
      "card": "visa-debit",
      "bank": "",
      "wallet": "",
      "vpa": "",
      "email": "test@example.com",
      "contact": "9999999999",
      "notes": null,
      "fee": 5,
      "service_tax": 0,
      "payout_amount": 995,
      "payout_type": "Cr",
      "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
    }
  ]
}

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",
  "international": false,
  "method": "card",
  "description": "For online purchase of 3 Items",
  "card": "visa-debit",
  "bank": "",
  "wallet": "",
  "vpa": "",
  "email": "test@example.com",
  "contact": "9999999999",
  "notes": null,
  "fee": 5,
  "service_tax": 0,
  "payout_amount": 995,
  "payout_type": "",
  "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
}

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 failed.
order_id string
Unique identifier of an Order 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 or upi.
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 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.
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.
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.

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) => {
    ...
});

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
});

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",
      "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": "",
      "refunded_amount": 0,
      "refund_status": "",
      "refunds": {
        "total_count": 0,
        "object": "list",
        "data": []
      },
      "error_code": "",
      "error_description": "",
      "created_at": 1495547101
    },
    {
      "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": 5,
      "service_tax": 0,
      "payout_amount": 995,
      "payout_type": "",
      "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
    }
  ]
}

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) => {
    ...
});

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
});

JSON Response

com.payabbhi.model.Payment JSON :
{
  "id": "pay_mUy6UYsRvIxH9Qi2",
  "object": "payment",
  "amount": 1000,
  "currency": "INR",
  "status": "captured",
  "order_id": "order_D9kQbGJAmGwJ2XMK",
  "international": false,
  "method": "card",
  "description": "For online purchase of 3 items",
  "card": "visa-debit",
  "bank": "",
  "wallet": "",
  "vpa": "",
  "email": "test@example.com",
  "contact": "9999999999",
  "notes": null,
  "fee": 5,
  "service_tax": 0,
  "payout_amount": 995,
  "payout_type": "",
  "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
}

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) => {
    ...
});

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.
});

JSON Response

com.payabbhi.model.Payment JSON :
{
  "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": "",
  "refunded_amount": 0,
  "refund_status": "",
  "refunds": {
    "total_count": 0,
    "object": "list",
    "data": []
  },
  "error_code": "",
  "error_description": "",
  "created_at": 1495546415
}

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.retrieve({payment_id}).refunds()
PayabbhiCollection<Refund> refundCollection = Payment.refunds({payment_id})
client.Payment.Retrieve({payment_id}).GetRefunds();
payabbhi.payments.refunds(paymentId,
  (error, refunds) => {
    ...
});

Example Request

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/payments/pay_T4wP1qFEezNIHp1u/refunds?count=2
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->payment->refunds('pay_mUy6UYsRvIxH9Qi2', array('count'=>2));
import payabbhi
client = payabbhi.Client('access_id','secret_key')
client.payment.retrieve('pay_mUy6UYsRvIxH9Qi2').refunds(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
});

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) => {
    ...
});

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", 100);
            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',
  (error, refund) => {
  // refund is Refund object
});

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) => {
    ...
});

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
});

JSON Response

com.payabbhi.model.PayabbhiCollection<Refund> JSON :
{
  "total_count": 10,
  "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) => {
    ...
});

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
});

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

{
  "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": "",
      "refunded_amount": 0,
      "refund_status": "",
      "refunds": {
        "total_count": 0,
        "object": "list",
        "data": []
      },
      "error_code": "",
      "error_description": "",
      "created_at": 1495546415
    }
  }
}

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

Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/events?count=2

JSON Response:

{
  "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": "",
          "refunded_amount": 0,
          "refund_status": "",
          "refunds": {
            "total_count": 0,
            "object": "list",
            "data": []
          },
          "error_code": "",
          "error_description": "",
          "created_at": 1495546415
        }
      }
    }
  ]
}

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}

Example Request

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/events/evt_gCmIpp76zgZynfEO

JSON Response

{
  "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": "",
      "refunded_amount": 0,
      "refund_status": "",
      "refunds": {
        "total_count": 0,
        "object": "list",
        "data": []
      },
      "error_code": "",
      "error_description": "",
      "created_at": 1495546415
    }
  }
}

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 a order is paid.                                        

Products

The Product Object

JSON Response

{
    "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();




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')));




JSON Response

{
    "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
unit_label
Unit label describing the unit of the product being charged for metered billing - MB, text messages 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();




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));




JSON Response

{
    "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 order, 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});




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');




JSON Response

{
  "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

{
    "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.
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();




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)"));




JSON Response

{
    "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();




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));




JSON Response

{
    "total_count": 3,
    "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 order, 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});




Example Request

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/plans/plan_P7wNUwTdGC2u2n2I
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->plan->retrieve('plan_tuOWN0Sc0uMB4s8E');




JSON Response

{
    "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.

Customers

The Customer Object

JSON Response

{
    "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 of the customer
shipping_address json object
Shipping address of the customer
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();




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"));




JSON Response

{
  "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});




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"));




JSON Response

{
    "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 created successfully. Else it returns an error response.

List all customers

Definition

GET https://payabbhi.com/api/v1/customers
<?php
$client->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));




JSON Response

{
    "total_count": 3,
    "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": 1,
                "object": "list",
                "data": [
                    {
                        "id": "sub_luQ4QIXzaEIN0g5D",
                        "object": "subscription",
                        "plan_id": "plan_tuOWN0Sc0uMB4s8E",
                        "customer_id": "cust_2WmsQoSRZMWWkcZg",
                        "billing_method": "automatic",
                        "quantity": 1,
                        "customer_notification_by": "merchant",
                        "billing_cycle_count": 5,
                        "paid_count": 0,
                        "cancel_at_period_end": false,
                        "due_by_days": 0,
                        "trial_end_at": 1539007999,
                        "status": "cancelled",
                        "current_start_at": 1539007999,
                        "current_end_at": 1544278399,
                        "ended_at": 0,
                        "cancelled_at": 1539008085,
                        "created_at": 1539008001,
                        "notes": null
                    }
                ]
            },
            "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});




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');




JSON Response

{
    "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.

Subscriptions

The Subscription Object

JSON Response

{
    "id": "sub_luQ4QIXzaEIN0g5D",
    "object": "subscription",
    "plan_id": "plan_tuOWN0Sc0uMB4s8E",
    "customer_id": "cust_2WmsQoSRZMWWkcZg",
    "billing_method": "automatic",
    "quantity": 1,
    "customer_notification_by": "merchant",
    "billing_cycle_count": 5,
    "paid_count": 0,
    "cancel_at_period_end": false,
    "due_by_days": 0,
    "trial_end_at": 1539007999,
    "status": "cancelled",
    "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 automatic or manual
quantity positive integer
The quantity of the plan, which the customer is subscribing to. Ex : 5 users are subscribing to the plan.
customer_notification_by string
Indicates who is responsible for notification 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_by_days positive integer
Number of days by 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.
status string
The status of the subscription is either of created, in_trial, expired, active, pending, 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();




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));




JSON Response

{
    "id": "sub_xLH108FJwUlX47SI",
    "object": "subscription",
    "plan_id": "plan_tuOWN0Sc0uMB4s8E",
    "customer_id": "cust_2WmsQoSRZMWWkcZg",
    "billing_method": "automatic",
    "quantity": 1,
    "customer_notification_by": "merchant",
    "billing_cycle_count": 5,
    "paid_count": 0,
    "cancel_at_period_end": false,
    "due_by_days": 0,
    "trial_end_at": 1539171804,
    "status": "active",
    "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.
billing_cycle_count
Total no. of billing cycles. This represents how long the subscription will run.
customer_id
The unique identifier of the Customer who is subscribing to the plan.
customer_notification_by
Indicates who is responsible for notification to the customers for important subscription life cycle events.
trial_end_at
Timestamp at which the trial for the subscription should end. Measured in seconds since the Unix epoch.
quantity
The quantity of the plan, which the customer is subscribing to. Ex : 5 users are subscribing to the plan.
billing_method
Billing mode of the Subscription. the value can be either automatic or manual
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.

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});




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');




JSON Response

{
    "id": "sub_luQ4QIXzaEIN0g5D",
    "object": "subscription",
    "plan_id": "plan_tuOWN0Sc0uMB4s8E",
    "customer_id": "cust_2WmsQoSRZMWWkcZg",
    "billing_method": "automatic",
    "quantity": 1,
    "customer_notification_by": "merchant",
    "billing_cycle_count": 5,
    "paid_count": 0,
    "cancel_at_period_end": false,
    "due_by_days": 0,
    "trial_end_at": 1539007999,
    "status": "cancelled",
    "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.

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();




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));




JSON Response

{
    "total_count": 2,
    "object": "list",
    "data": [
        {
            "id": "sub_xLH108FJwUlX47SI",
            "object": "subscription",
            "plan_id": "plan_tuOWN0Sc0uMB4s8E",
            "customer_id": "cust_2WmsQoSRZMWWkcZg",
            "billing_method": "automatic",
            "quantity": 1,
            "customer_notification_by": "merchant",
            "billing_cycle_count": 5,
            "paid_count": 0,
            "cancel_at_period_end": false,
            "due_by_days": 0,
            "trial_end_at": 1539171804,
            "status": "active",
            "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": "automatic",
            "quantity": 1,
            "customer_notification_by": "merchant",
            "billing_cycle_count": 5,
            "paid_count": 0,
            "cancel_at_period_end": false,
            "due_by_days": 0,
            "trial_end_at": 1539007999,
            "status": "cancelled",
            "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
A filter on the subscription list based on the status field.
billing_method
A filter on the subscription list based on the billing_method field.
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});




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');




JSON Response

{
    "id": "sub_luQ4QIXzaEIN0g5D",
    "object": "subscription",
    "plan_id": "plan_tuOWN0Sc0uMB4s8E",
    "customer_id": "cust_2WmsQoSRZMWWkcZg",
    "billing_method": "automatic",
    "quantity": 1,
    "customer_notification_by": "merchant",
    "billing_cycle_count": 5,
    "paid_count": 0,
    "cancel_at_period_end": false,
    "due_by_days": 0,
    "trial_end_at": 1539007999,
    "status": "cancelled",
    "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

{
    "id": "item_zvenYE0Tk8qTUaER",
    "object": "invoiceitem",
    "name": "Line Item",
    "description": "",
    "amount": 100,
    "currency": "INR",
    "customer_id": "cust_2WmsQoSRZMWWkcZg",
    "invoice_id": "invt_LN3GM0Ea7hVcsgr6",
    "subscription_id": "sub_luQ4QIXzaEIN0g5D",
    "quantity": 1,
    "created_at": 1539008001,
    "notes": null
}

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.
description string
Description of the Invoice Item.
amount integer
Rate of the Invoice Item.
currency string
Three-letter ISO currency code. Currently only INR is supported.
customer_id string
The unique identifier of the Customer who will be paying this Invoice Item.
invoice_id string
The unique identifier of the Invoice to which this Invoice Item belongs to.
subscription_id json object
The unique identifier of the subscription that this Invoice Item has been created for, if any.
quantity positive integer
The quantity of the invoice item.
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();




Example Request

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/invoiceitems \
  -d customer_id=cust_2WmsQoSRZMWWkcZg \
  -d name="Line Item" \
  -d amount=200 \
  -d currency=INR
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->invoiceitem->create(array("customer_id" => "cust_2WmsQoSRZMWWkcZg",
                                "name" => "Line Item",
                                "amount" => 200, "currency" => "INR"));




JSON Response

{
    "id": "item_jYGaYf14SeZ13DkJ",
    "object": "invoiceitem",
    "name": "Line Item",
    "description": "",
    "amount": 200,
    "currency": "INR",
    "customer_id": "cust_2WmsQoSRZMWWkcZg",
    "invoice_id": "",
    "subscription_id": "",
    "quantity": 1,
    "created_at": 1539174367,
    "notes": null
}

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.
amount
A 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.
invoice_id
The unique identifier of the Invoice to which this invoice item to be added.
description
Description of the Invoice Item.
quantity default value is 1
The quantity of the Invoice Item.
notes
Notes is a key-value store used for storing additional data relating to the invoice item object in structured format.

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});




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');




JSON Response

{
    "id": "item_2MAlPM205eXk65Fx",
    "object": "invoiceitem",
    "name": "N3",
    "description": "D3",
    "amount": 300,
    "currency": "INR",
    "customer_id": "cust_2WmsQoSRZMWWkcZg",
    "invoice_id": "invt_UZqFoPLamaZqLFkZ",
    "subscription_id": "",
    "quantity": 12,
    "created_at": 1539074485,
    "notes": null
}

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();




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));




JSON Response

{
    "total_count": 5,
    "object": "list",
    "data": [
        {
            "id": "item_jYGaYf14SeZ13DkJ",
            "object": "invoiceitem",
            "name": "Line Item",
            "description": "",
            "amount": 200,
            "currency": "INR",
            "customer_id": "cust_2WmsQoSRZMWWkcZg",
            "invoice_id": "",
            "subscription_id": "",
            "quantity": 1,
            "created_at": 1539174368,
            "notes": null
        },
        {
            "id": "item_I9Gh0wJHJ2tvorbT",
            "object": "invoiceitem",
            "name": "Line Item",
            "description": "",
            "amount": 100,
            "currency": "INR",
            "customer_id": "cust_2WmsQoSRZMWWkcZg",
            "invoice_id": "invt_srxOZZk6dIgWTVls",
            "subscription_id": "sub_xLH108FJwUlX47SI",
            "quantity": 1,
            "created_at": 1539171807,
            "notes": null
        }
    ]
}

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});




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');




JSON Response

{
    "id": "item_zvenYE0Tk8qTUaER",
    "object": "invoiceitem",
    "name": "Line Item",
    "description": "",
    "amount": 100,
    "currency": "INR",
    "customer_id": "cust_2WmsQoSRZMWWkcZg",
    "invoice_id": "invt_LN3GM0Ea7hVcsgr6",
    "subscription_id": "sub_luQ4QIXzaEIN0g5D",
    "quantity": 1,
    "created_at": 1539008001,
    "notes": null
}

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.

Invoices

The Invoice Object

JSON Response

{
    "id": "invt_UZqFoPLamaZqLFkZ",
    "object": "invoice",
    "amount": 2400,
    "billing_method": "manual",
    "customer_id": "cust_2WmsQoSRZMWWkcZg",
    "currency": "INR",
    "created_at": 1539074485,
    "description": "Hello World",
    "due_date": 1540060199,
    "line_items": [
        {
            "id": "item_FL3nHHB7i7Fpcj1J",
            "object": "invoiceitem",
            "name": "N2",
            "description": "D2",
            "amount": 200,
            "currency": "INR",
            "customer_id": "cust_2WmsQoSRZMWWkcZg",
            "invoice_id": "invt_UZqFoPLamaZqLFkZ",
            "subscription_id": "",
            "quantity": 12,
            "created_at": 1539074485,
            "notes": null
        }
    ],
    "notes": null,
    "notify_by": "email",
    "payment_attempt": 0,
    "invoice_no": "3123123123",
    "status": "active",
    "subscription_id": "",
    "url": "https://payabbhi.com/zpuoxajg"
}

ATTRIBUTES

id string
Unique identifier of invoice object.
object string, value is "invoice"
Represents the object type which in this case is 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.
billing_method string
Billing mode of the Subscription. the value can be either automatic or manual
customer_id string
Unique identifier of the customer who will pay this invoice.
currency string
Three-letter ISO currency code. Currently only INR is supported.
description string
Description of the Invoice.
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 automatic
line_items list
A list of line_items that have been created for the invoice. Invoice Items are sorted in the reverse chronological order
notify_by string
Describes how the customer would be notified about the invoice.
payment_attempt positive integer or zero
Number of payment attempts against this invoice.
invoice_no string
The unique identifying number that appears for this Invoice and referred in all customer communication.
status string
Status of the invoice. The invoice status is one of active, paid, payment_attempted, cancelled or expired.
subscription_id string
Unique identifier of the subscription for which this invoice is generated.
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.
created_at timestamp
Invoice creation timestamp. Measured in seconds since the Unix epoch.

Create an Invoice

Definition

POST https://payabbhi.com/api/v1/invoices
<?php
$client->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 due_date=1549176945 \
  -d currency=INR \
  -d description=TestInvoice \
  -d notes[mode]=test \
  -d line_items[0][id]=item_jYGaYf14SeZ13DkJ \
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->invoice->create(array("customer_id" => "cust_2WmsQoSRZMWWkcZg",
                                "invoice_no" => "123123123123",
                                "due_date" => 1549176945,
                                "currency" => "INR",
                                "description" => "TestInvoice",
                                "notes" => array(
                                  "mode" => "test"
                                ),
                                "line_items" => array(
                                  array(
                                    "id" => "item_jYGaYf14SeZ13DkJ"
                                  )
                                )));




JSON Response

{
    "id": "invt_v1uXGmhIUMylFQPS",
    "object": "invoice",
    "amount": 200,
    "billing_method": "automatic",
    "customer_id": "cust_2WmsQoSRZMWWkcZg",
    "currency": "INR",
    "created_at": 1539177115,
    "description": "Test Invoice",
    "due_date": 1549176945,
    "line_items": [
        {
            "id": "item_jYGaYf14SeZ13DkJ",
            "object": "invoiceitem",
            "name": "Bruce Wayne",
            "description": "",
            "amount": 200,
            "currency": "INR",
            "customer_id": "cust_2WmsQoSRZMWWkcZg",
            "invoice_id": "invt_v1uXGmhIUMylFQPS",
            "subscription_id": "",
            "quantity": 1,
            "created_at": 1539174368,
            "notes": null
        }
    ],
    "notes": {
        "mode": "test"
    },
    "notify_by": "email",
    "payment_attempt": 0,
    "invoice_no": "123123123123",
    "status": "active",
    "subscription_id": "",
    "url": "https://payabbhi.com/zrt2zlh5"
}

Creates a new invoice.

ARGUMENTS

customer_id
The unique identifier of the customer who will pay this invoice.
due_date
Latest Timestamp by which the invoice should be paid by the customer. Measured in seconds since the Unix epoch.
currency
Three-letter ISO currency code. Currently only INR is supported.
invoice_no
Invoice no. at Merchant end which corresponds to this invoice.
line_items
List of invoice item objects to be included in the invoice.
billing_method
Billing method of the invoice.
description
Description of the Invoice.
notify_by
Describes how the customer would be notified about the invoice.
notes
Notes is a key-value store used for storing additional data relating to the invoice item object in structured format.
subscription_id
Unique identifier of the subscription for which this invoice will be generated.

Returns

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

Cancel an Invoice

Definition

POST https://payabbhi.com/api/v1/invoices/{invoice_id}/cancel
<?php
$client->invoice->cancel({invoice_id});




Example Request

$ curl -u access_id:secret_key -X POST \
  https://payabbhi.com/api/v1/invoices/invt_ZBymDifGQqgHPISh/cancel
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->invoice->cancel("invt_ZBymDifGQqgHPISh");




JSON Response

{
    "id": "invt_ZBymDifGQqgHPISh",
    "object": "invoice",
    "amount": 500,
    "billing_method": "automatic",
    "customer_id": "cust_VD9uYO8uc29b4hY8",
    "currency": "INR",
    "created_at": 1539179543,
    "description": "TestInvoice",
    "due_date": 1549176945,
    "line_items": [
        {
            "id": "item_Jz6dd6uLbu05Y5kk",
            "object": "invoiceitem",
            "name": "Item1",
            "description": "",
            "amount": 500,
            "currency": "INR",
            "customer_id": "cust_VD9uYO8uc29b4hY8",
            "invoice_id": "invt_ZBymDifGQqgHPISh",
            "subscription_id": "",
            "quantity": 1,
            "created_at": 1539179491,
            "notes": null
        }
    ],
    "notes": {
        "mode": "test"
    },
    "notify_by": "email",
    "payment_attempt": 0,
    "invoice_no": "123123123123",
    "status": "cancelled",
    "subscription_id": "",
    "url": "https://payabbhi.com/zro4qjer"
}

ARGUMENTS

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

Returns

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

List all invoices

Definition

GET https://payabbhi.com/api/v1/invoices
<?php
$client->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));




JSON Response

{
    "total_count": 5,
    "object": "list",
    "data": [
        {
            "id": "invt_v1uXGmhIUMylFQPS",
            "object": "invoice",
            "amount": 200,
            "billing_method": "automatic",
            "customer_id": "cust_2WmsQoSRZMWWkcZg",
            "currency": "INR",
            "created_at": 1539177115,
            "description": "Test Invoice",
            "due_date": 1549176945,
            "line_items": [
                {
                    "id": "item_jYGaYf14SeZ13DkJ",
                    "object": "invoiceitem",
                    "name": "Line Item",
                    "description": "",
                    "amount": 200,
                    "currency": "INR",
                    "customer_id": "cust_2WmsQoSRZMWWkcZg",
                    "invoice_id": "invt_v1uXGmhIUMylFQPS",
                    "subscription_id": "",
                    "quantity": 1,
                    "created_at": 1539174368,
                    "notes": null
                }
            ],
            "notes": {
                "mode": "test"
            },
            "notify_by": "email",
            "payment_attempt": 0,
            "invoice_no": "123123123123",
            "status": "active",
            "subscription_id": "",
            "url": "https://payabbhi.com/zrt2zlh5"
        },
        {
            "id": "invt_srxOZZk6dIgWTVls",
            "object": "invoice",
            "amount": 100,
            "billing_method": "automatic",
            "customer_id": "cust_2WmsQoSRZMWWkcZg",
            "currency": "INR",
            "created_at": 1539171807,
            "description": "",
            "due_date": 1539171804,
            "line_items": [
                {
                    "id": "item_I9Gh0wJHJ2tvorbT",
                    "object": "invoiceitem",
                    "name": "Line Item",
                    "description": "",
                    "amount": 100,
                    "currency": "INR",
                    "customer_id": "cust_2WmsQoSRZMWWkcZg",
                    "invoice_id": "invt_srxOZZk6dIgWTVls",
                    "subscription_id": "",
                    "quantity": 1,
                    "created_at": 1539171807,
                    "notes": null
                }
            ],
            "notes": null,
            "notify_by": "email",
            "payment_attempt": 0,
            "invoice_no": "INV_90976164",
            "status": "active",
            "subscription_id": "sub_xLH108FJwUlX47SI",
            "url": "https://payabbhi.com/zta7qvp8"
        }
    ]
}

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.
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.
customer_id
A filter on the invoice list based on the customer_id 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});




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');




JSON Response

{
    "id": "invt_srxOZZk6dIgWTVls",
    "object": "invoice",
    "amount": 100,
    "billing_method": "automatic",
    "customer_id": "cust_2WmsQoSRZMWWkcZg",
    "currency": "INR",
    "created_at": 1539171807,
    "description": "",
    "due_date": 1539171804,
    "line_items": [
        {
            "id": "item_I9Gh0wJHJ2tvorbT",
            "object": "invoiceitem",
            "name": "Line Item",
            "description": "",
            "amount": 100,
            "currency": "INR",
            "customer_id": "cust_2WmsQoSRZMWWkcZg",
            "invoice_id": "invt_srxOZZk6dIgWTVls",
            "subscription_id": "",
            "quantity": 1,
            "created_at": 1539171807,
            "notes": null
        }
    ],
    "notes": null,
    "notify_by": "email",
    "payment_attempt": 0,
    "invoice_no": "INV_90976164",
    "status": "active",
    "subscription_id": "sub_xLH108FJwUlX47SI",
    "url": "https://payabbhi.com/zta7qvp8"
}

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/{invoiceitem_id}/line_items
<?php
$client->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');




JSON Response:

{
    "total_count": 1,
    "object": "list",
    "data": [
        {
            "id": "item_FL3nHHB7i7Fpcj1J",
            "object": "invoiceitem",
            "name": "N2",
            "description": "D2",
            "amount": 200,
            "currency": "INR",
            "customer_id": "cust_2WmsQoSRZMWWkcZg",
            "invoice_id": "invt_UZqFoPLamaZqLFkZ",
            "subscription_id": "",
            "quantity": 12,
            "created_at": 1539074485,
            "notes": null
        }
    ]
}

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});




Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/invoices/invt_UZqFoPLamaZqLFkZ/payments
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->invoice->payments('invt_UZqFoPLamaZqLFkZ');




JSON Response:

{
  "total_count": 1,
  "object": "list",
  "data": [
    {
      "id": "pay_mUy6UYsRvIxH9Qi2",
      "object": "payment",
      "amount": 1000,
      "currency": "INR",
      "status": "captured",
      "order_id": "order_D9kQbGJAmGwJ2XMK",
      "international": false,
      "method": "card",
      "description": "new payment done",
      "card": "visa-debit",
      "bank": "",
      "wallet": "",
      "vpa": "",
      "email": "test@example.com",
      "contact": "9999999999",
      "notes": null,
      "fee": 5,
      "service_tax": 0,
      "payout_amount": 995,
      "payout_type": "Cr",
      "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
    }
  ]
}

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.
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 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.

Transfers

The Transfer Object

JSON Response

{
  "id": "trans_ucwszWrXUZJGDgMX",
  "object": "transfer",
  "description": "Test Transfer",
  "source_id": "pay_W2FmbqANt09epUOz",
  "recipient_id": "recp_Y2ojRlJVqRMhB0Ay",
  "amount": 50,
  "currency": "INR",
  "fees": 0,
  "gst": 0,
  "notes": {
    "home": {
      "city": "kolkata"
    }
  },
  "created_at": 1540882106
}

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.
recipient_id string
Unique identifier of the recipient, 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.
fees 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).
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 transfer

Definition

POST https://payabbhi.com/api/v1/payments/{source_id}/transfers
<?php
$payment = $client->payment->retrieve({payment_id});
$payment->transfer();




Example Request

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




JSON Response

{
  "total_count": 2,
  "object": "list",
  "data": [
    {
      "id": "trans_M6dh0SlFlQvnamaD",
      "object": "transfer",
      "description": "Tranfer 1",
      "source_id": "pay_W2FmbqANt09epUOz",
      "recipient_id": "recp_Y2ojRlJVqRMhB0Ay",
      "amount": 20,
      "currency": "INR",
      "fees": 0,
      "gst": 0,
      "notes": null,
      "created_at": 1541422486
    },
    {
      "id": "trans_HfoVbO6FGOvrnhXb",
      "object": "transfer",
      "description": "Tranfer 2",
      "source_id": "pay_W2FmbqANt09epUOz",
      "recipient_id": "recp_Y2ojRlJVqRMhB0Ay",
      "amount": 30,
      "currency": "INR",
      "fees": 0,
      "gst": 0,
      "notes": null,
      "created_at": 1541422486
    }
  ]
}

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.
recipient_id
Unique identifier of the recipient, 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();




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'=>3));




JSON Response

{
  "total_count": 3,
  "object": "list",
  "data": [
    {
      "id": "trans_HfoVbO6FGOvrnhXb",
      "object": "transfer",
      "description": "Tranfer 2",
      "source_id": "pay_W2FmbqANt09epUOz",
      "recipient_id": "recp_Y2ojRlJVqRMhB0Ay",
      "amount": 30,
      "currency": "INR",
      "fees": 0,
      "gst": 0,
      "notes": null,
      "created_at": 1541422487
    },
    {
      "id": "trans_M6dh0SlFlQvnamaD",
      "object": "transfer",
      "description": "Tranfer 1",
      "source_id": "pay_W2FmbqANt09epUOz",
      "recipient_id": "recp_Y2ojRlJVqRMhB0Ay",
      "amount": 20,
      "currency": "INR",
      "fees": 0,
      "gst": 0,
      "notes": null,
      "created_at": 1541422487
    },
    {
      "id": "trans_ucwszWrXUZJGDgMX",
      "object": "transfer",
      "description": "Transfer X",
      "source_id": "pay_W2FmbqANt09epUOz",
      "recipient_id": "recp_Y2ojRlJVqRMhB0Ay",
      "amount": 50,
      "currency": "INR",
      "fees": 0,
      "gst": 0,
      "notes": {
        "home": {
          "city": "kolkata"
        }
      },
      "created_at": 1540882106
    }
  ]
}

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})




Example Request

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/transfers/trans_M6dh0SlFlQvnamaD
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->transfer->retrieve('trans_M6dh0SlFlQvnamaD');




JSON Response

{
  "id": "trans_M6dh0SlFlQvnamaD",
  "object": "transfer",
  "description": "Tranfer 1",
  "source_id": "pay_W2FmbqANt09epUOz",
  "recipient_id": "recp_Y2ojRlJVqRMhB0Ay",
  "amount": 20,
  "currency": "INR",
  "fees": 0,
  "gst": 0,
  "notes": null,
  "created_at": 1541422487
}

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();




Example Request:

$ curl -u access_id:secret_key \
  https://payabbhi.com/api/v1/payments/pay_W2FmbqANt09epUOz/transfers
<?php
$client = new \Payabbhi\Client('access_id', 'secret_key');
$client->payment->retrieve('pay_W2FmbqANt09epUOz')->transfers();




JSON Response:

{
  "total_count": 3,
  "object": "list",
  "data": [
    {
      "id": "trans_HfoVbO6FGOvrnhXb",
      "object": "transfer",
      "description": "Tranfer 2",
      "source_id": "pay_W2FmbqANt09epUOz",
      "recipient_id": "recp_Y2ojRlJVqRMhB0Ay",
      "amount": 30,
      "currency": "INR",
      "fees": 0,
      "gst": 0,
      "notes": null,
      "created_at": 1541422487
    },
    {
      "id": "trans_M6dh0SlFlQvnamaD",
      "object": "transfer",
      "description": "Tranfer 1",
      "source_id": "pay_W2FmbqANt09epUOz",
      "recipient_id": "recp_Y2ojRlJVqRMhB0Ay",
      "amount": 20,
      "currency": "INR",
      "fees": 0,
      "gst": 0,
      "notes": null,
      "created_at": 1541422487
    },
    {
      "id": "trans_ucwszWrXUZJGDgMX",
      "object": "transfer",
      "description": "Transfer X",
      "source_id": "pay_W2FmbqANt09epUOz",
      "recipient_id": "recp_Y2ojRlJVqRMhB0Ay",
      "amount": 50,
      "currency": "INR",
      "fees": 0,
      "gst": 0,
      "notes": {
        "home": {
          "city": "kolkata"
        }
      },
      "created_at": 1540882106
    }
  ]
}

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.