Skip to main content

OnionPay API Reference (1.0.0)

Safest and fastest way to collect payments for your business.

Payment

Quickly integrate OnionPay Checkout into your website.

Payment Create

Create a payment

Request Body schema: application/json
appId
string

Your Payment App ID

amount
string

Numeric string with two decimal places.

currency
string
merTransNo
string

Merchant's trade No.

notifyUrl
string
returnUrl
string
sign
string

Checksum of params

version
string

1.1

object

Responses

Request samples

Content type
application/json
{
  • "appId": "Your Payment App ID",
  • "amount": "1.00",
  • "currency": "INR",
  • "merTransNo": "6486e4cd691e407184e67d3d513d8153",
  • "sign": "string",
  • "version": "1.1",
  • "extInfo": {
    }
}

Response samples

Content type
application/json
{
  • "code": "200",
  • "msg": "Ok",
  • "timestamp": "1654674426737",
  • "data": {
    }
}

Payment Query

Request Body schema: application/json
merchantId
string

Your Payment App ID

merTransNo
string

Merchant's trade No.

tradeNo
string

Payment Gateway's trade No.

version
string

1.1

sign
string

Checksum of params

Responses

Request samples

Content type
application/json
{
  • "merchantId": "Your Payment App ID",
  • "merTransNo": "6486e4cd691e407184e67d3d513d8153",
  • "tradeNo": "20220609091914600809950013807798",
  • "version": "1.1",
  • "sign": "string"
}

Response samples

Content type
application/json
{
  • "code": "200",
  • "msg": "Ok",
  • "timestamp": "1654674527571",
  • "data": {
    }
}

Refund

To initiate partial or complete refund of payment.

Refund Create

Request Body schema: application/json
merchantId
string

Your Payment App ID

tradeNo
string

Payment Gateway's trade No.

merRefundNo
string

Merchant's refund No.

amount
string

Numeric string with two decimal places.

currency
string

Currency

notifyUrl
string
sign
string

Checksum of params

version
string

2.0

Responses

Request samples

Content type
application/json
{
  • "merchantId": "Your Payment App ID",
  • "tradeNo": "20220609091914600809950013807798",
  • "merRefundNo": "refund-demo-0000000001",
  • "amount": "1.00",
  • "currency": "INR",
  • "sign": "string",
  • "version": "2.0"
}

Response samples

Content type
application/json
{
  • "code": "200",
  • "msg": "Ok",
  • "timestamp": "1654748663403",
  • "data": {
    }
}

Refund Query

Request Body schema: application/json
merchantId
string

Your Payment App ID

refundNo
string

Payment Gateway's refund No.

merRefundNo
string

Merchant's refund No.

sign
string

Checksum of params

version
string

1.1

Responses

Request samples

Content type
application/json
{
  • "merchantId": "Your Payment App ID",
  • "refundNo": "20220609095423500809024013805348",
  • "merRefundNo": "refund-demo-0000000001",
  • "sign": "string",
  • "version": "1.1"
}

Response samples

Content type
application/json
{
  • "code": "200",
  • "msg": "Ok",
  • "timestamp": "1654748663403",
  • "data": {
    }
}

Payout

This API is used to disburse fund from Merchant's balance accounts to bank account using VPA / Mobile number / Bank account number and IFSC code.

Payout Create

Request Body schema: application/json
appId
string

Your Payout App ID

amount
string

Numeric string with two decimal places.

currency
string
merTransNo
string

Merchant's payout No.

notifyUrl
string
version
string

1.1

sign
string

Checksum of params

object

Responses

Request samples

Content type
application/json
{
  • "appId": "Your Payout App ID",
  • "amount": "1.00",
  • "currency": "INR",
  • "merTransNo": "payout-demo-0000000001",
  • "version": "1.1",
  • "sign": "string",
  • "extInfo": {
    }
}

Response samples

Content type
application/json
{
  • "code": "200",
  • "msg": "Ok",
  • "timestamp": "1654752475664",
  • "data": {
    }
}

Payout Query

Request Body schema: application/json
merchantId
string

Your Payout App ID

tradeNo
string

Payout Gateway's trade No.

version
string

1.1

sign
string

Checksum of params

Responses

Request samples

Content type
application/json
{
  • "merchantId": "Your Payout App ID",
  • "tradeNo": "20220609105755200809565013895720",
  • "version": "1.1",
  • "sign": "string"
}

Response samples

Content type
application/json
{
  • "code": "200",
  • "msg": "Ok",
  • "timestamp": "1654752572302",
  • "data": {
    }
}

Account

Query account info

Account Query

Request Body schema: application/json
merchantId
string

Your Payment App ID

accType
string
version
string

1.1

sign
string

Checksum of params

Responses

Request samples

Content type
application/json
{
  • "merchantId": "Your Payment App ID",
  • "accType": "default",
  • "version": "1.1",
  • "sign": "string"
}

Response samples

Content type
application/json
{
  • "code": "200",
  • "msg": "Ok",
  • "timestamp": "1654753923155",
  • "data": {
    }
}

Signature

Please refer to Signature Document for the specific algorithm.