DroomPay_Normal_Payment_API%20Document_V2.docx_1

Download as odt, pdf, or txt
Download as odt, pdf, or txt
You are on page 1of 16

API Documentation

1 About Droompay

Droompay is a payment gateway aggregator that has integration with Easebuzz to enable
payments for Merchants and Enterprises. Having onboarded 1 merchant and 3 sub-
merchants, Droompay has successfully facilitated transactions amounting to INR 120 million
YoY, achieving a transaction success rate of 90%. Currently Droom Pay has capability to
enable transactions for Netbanking, Debit Card, Credit Card, Mobile Wallet, UPI, EMI, BNPL
IMPS, RTGS and NEFT.

2 Sequence Diagram for Merchant/Sub Merchant Integration


3 Functional Diagram

Dev Environment Detail


● droom_pay_key/client_id: 37b41f6195b197a9
● Private_key: f159d996160dffcbccd26500c857b394
● Client_secret: a9e537c209a4abbc125d4fabaf4172b33ff21b51

4.API List with Details:


4.1. Generate Authentication Token API(Currently through PHP)

$string = $client_id.":".$client_secret;
$token = base64_encode(json_encode($string));

4.2. Generate Secure hash API

Method Type URL Authorization Body Type

POST https:// Bearer token x-www-form-


devapi2.droompay.co urlencoded
m/api/gethashkey
4.2.1. Request:
client_id:37b41f6195b197a9
private_key:f159d996160dffcbccd26500c857b394
reference_id:312312

Amount:99.00

4.2.2. Response:
{

"StatusCode": "1",
"Message": "Success",
"Result": "7cb1c4e241cb9e78d25190947e7cd4d8"
}

4.3 Initiate Payment API

DroomPay facilitates payments by generating request URLs that accept payments. From your
backend, you need to make a server-to-server call to DroomPay’s server (either test or production)
using the required parameters. These parameters include the key, amount, transaction ID, and
others listed below.Complete list of mandatory and optional parameters are shared in the table
below. Please ensure that all parameters are trimmed (leading and trailing white spaces are
removed) before generating the hash.

Method Type URL Authorization Body Type

POST https:// Bearer token x-www-form-


devapi2.droompay.co urlencoded
m/api/initiate-
payment

4.3.1. Sample Request:

customer_id:1
secure_hash:20c90433970ffd97d7b8c8048e31afb4
reference_id:dp_trans_id_44444
amount:10.00
customer_name:test droompay user
customer_email:pankaj.prasad@droom.in
customer_phone:9718417874
item_name:Droom Pay Item
success_callback_url:http://local.web.droompay.in/easebuzeresponse
fail_callback_url:http://local.web.droompay.in/easebuzeresponse
process_callback_url:http://local.web.droompay.in/easebuzeresponse
show_payment_mode:
udf1:234234.0
Source:dcs

4.3.2. Response:
{
"StatusCode": "1",
"Message": "Success",
"Result": {
"order_id": 5,
"pay_url":
"https://testpay.easebuzz.in/pay/a6f60666be2466958c52909b61f94410584f373636fda9ccfc2253bfe
01d6745",
"status": 1
}
}

4.3.3. Parameters/ PayLoad:

Parameter Sample Value Mandatory/ Datatype Description Match Pattern


Non Mandatory
customer_id 1 Mandatory Integer This parameter N/A
should contain
the ID of the
particular
customer.
secure_hash 7cb1c4e241cb Mandatory Alphanumeric Encryption Key N/A
9e78d251909
47e7cd4d8
reference_id 312312 Mandatory String This parameter ^[a-zA-Z0-
is called 9_\|\-\/]
Reference ID {1,40}$
(or Order ID). It
is the order
reference
number
generated at
your
(Merchant’s)
end. It is an
identifier you
(the merchant)
would use to
track a
particular
order. If a
transaction
using a
particular ID
has already
been
successful at
DroomPay, the
transaction will
fail. Hence, you
must post us a
unique
transaction ID
for every new
transaction.
amount 99.00 Mandatory Float Transaction N/A
Amount
show_payment_ NB,DC,CC,MW Mandatory String NB- Netbanking N/A
mode ,UPI,OM,EMI, DC- Debit Card
CBT,BT CC- Credit Card
(choose any
UPI- Unified
one)
Payment
Interface

OM-

EMI- Estimated
Monthly
Installments

CBT- Current
Bank Transfer

BT- Bank
Transfer

customer_name Pankaj Mandatory String This parameter ^[a-zA-Z0-9&\-._


should contain \'()/,@]+$
name of the
customer
customer_email pankaj@gmail Mandatory String This parameter N/A
.com should contain
the email of the
customer.
customer_phon 9090909090 Mandatory Integer This parameter N/A
e should contain
the phone
number of the
customer.
item_name easebuzz test Mandatory String This parameter [a-zA-Z0-9-\
should contain a s\|\-]*$
brief product
description.
success_callback http:// Non Mandatory String This parameter http[s]?://(?:[a-zA-
_url local.web.dro must contain Z]|[0-9]|[$-_@.&+]|
ompay.in/ the URL on [!*\(\),]|(?:%[0-9a-
easebuzeresp which fA-F][0-9a-fA-F]))+
onse DroomPay will
redirect the final
response if the
transaction is
successful.
http:// Non Mandatory String
local.web.dro
ompay.in/
easebuzeresp
onse
process_callback http:// Mandatory String This must http[s]?://(?:[a-zA-
_url local.web.dro contain the Z]|[0-9]|[$-_@.&+]|
ompay.in/ parameters [!*\(\),]|(?:%[0-9a-
failed required by the fA-F][0-9a-fA-F]))+
Merchant
(Droom) after
payment from
Droom Pay.

4.3.4. Note:
For process callback URL, the response will be:
(
[secure_hash] => 161f0899ba06092a2d46892aa192df47
[currency] => INR
[droom_pay_key] => 6bb0f0cd39deda6b
[order_id] => 5
[payment_mode] => CC
[status] => failure
[amount] => 10.99
[reference_id] => order5
[other_data] => ""
[message] => Session expired for the transaction.
[txn_date] => 2023-11-02 08:41:57
)
4.4 Get Order Status

Method Type URL Authorization Reference ID

GET https:// Bearer token Cart ID


devapi2.droompay.com/
api/get-order-status?
reference_id=order5

4.4.1. Response:

"StatusCode": "1",
"Message": "Success",
"Result": {
"order_id": 6,
"credential_id": 1,
"is_enable_autopay": 0,
"source": null,
"item_name": "Activa 125 Disc",
"amount": "699.50",
"currency": "INR",
"reference_id": "order4",
"penny_drop_reference_id": null,
"customer_unique_id": null,
"customer_id": 1,
"customer_name": "Pankaj",
"customer_email": "pankaj@gmail.com",
"customer_phone": "9090909090",
"payment_gateway": "EASEBUZZ",
"payment_method": "CC",
"payment_status": "success",
"refund_id": "RF3JIZ1YLY",
"refund_status": "queued",
"process_callback_url": "http://local.web.droompay.in/failed",
"other_data": "null",
"status": "complete",
"udf1": null,
"udf2": null,
"udf3": null,
"udf4": null,
"udf5": null,
"udf6": null,
"udf7": null,
"udf8": null,
"udf9": null,
"udf10": null,
"created_at": "2023-12-18T05:29:44.000000Z",
"updated_at": "2023-12-18T05:31:26.000000Z",
"payments": {
"id": 4,
"reference_id": "order4",
"order_id": 6,
"transition_id": "S2312181E0OZP7",
"client_id": "37b41f6195b197a9",
"amount": "699.50",
"currency": "INR",
"payment_gateway": "EASEBUZZ",
"payment_method": "CC",
"error_Message": null,
"status": "success",
"other": null,
"transaction_date": "2023-12-18 07:42:14",
"created_at": "2023-12-18T05:30:14.000000Z",
"updated_at": "2023-12-18T05:30:14.000000Z",
"deleted_at": null,
"enach_transactions": null
}
}
}

4.5. Refund API

Method Type URL Authorization Body Type

POST https:// Bearer token x-www-form-urlencoded


devapi2.droompay.co
m/api/payment/
refund-initiate

4.5.1. Request
transaction_id:13
refund_amount:11.99

4.5.2. Response:
{
"StatusCode": "1",
"Message": "Success",
"Result": {
"status": true,
"reason": "Refund Initiated, Your Request ID -R4POF94QQC",
"error_msg": "",
"refund_id": "R4POF94QQC",
"refund_amount": 11.99
}
}

4.6. Refund Status API:

Method Type URL Authorization Body Type

POST https:// Bearer token x-www-form-urlencoded


devapi2.droompay.co
m/api/payment/
refund-status

4.6.1. Request
refund_id: RBF8KB78ZP

4.6.2. Response:
{
"StatusCode": "1",
"Message": "Success",
"Result": {
"status": true,
"txnid": "8",
"easebuzz_id": "S2311061GX4ITD",
"net_amount_debit": "11.99",
"amount": "11.99",
"refunds": [
{
"refund_id": "RBF8KB78ZP",
"refund_status": "queued",
"merchant_refund_id": null,
"merchant_refund_date": "07-11-2023 15:17:20",
"refund_settled_date": null,
"auto_refund": "NO",
"refund_amount": "11.99",
"arn_number": null,
"udf1": null,
"udf2": null,
"udf3": null,
"udf4": null,
"udf5": null,
"udf6": null,
"udf7": null,
"chargeback_description": null
}
]
}
}

4.7 Webhooks:

4.7.1. Transaction Webhook

Method Type URL Body Type

POST To be shared by Merchant x-www-form-urlencoded

4.7.2. Request
"secure_hash": "6901ac029965465ac054d98014aafa34",
"currency": "INR",

"droom_pay_key": "18a9bd3fc0a85625",

"order_id": 2338,

"payment_mode": "NA",

"status": "success",

"amount": "2199.00",

"reference_id": "dsfdsfsdf",

"service_type": "PG",

"other_data": "null",

"udf1": null,

"udf2": null,

"udf3": null,

"udf4": null,

"udf5": "null",

"udf6": null,

"udf7": null,

"udf8": null,

"udf9": null,

"udf10": null,

"message": "Transaction is successful.",

"txn_date": "2024-06-06 13:10:06"

4.7.3 Response
{

"StatusCode": "1",

"Message": "Success",

"Result": true
}

4.7.4. Refund Webhook

Method Type URL Body Type

POST To be shared by Merchant x-www-form-urlencoded

"56ae8f9fd139a7985375cd800248b5e0926a9ed767ff96f63664f769a43020c32da4a5c77c5cef
cc02764b9f63a3bdad054c224f838395f809bb2d99eb703350",

"udf1": null,

"udf2": null,

"udf3": null,

"udf4": null,

"udf5": null,

"udf6": null,

"udf7": null,

"txnid": "DP240711129A6ZNRP",

"easepayid": "S240711073SF5Z",

"refund_id": "RSTPHZYD0L",

"arn_number": null,

"refund_amount": 699.5,

"refund_status": "accepted",

"transaction_date": "2024-07-11 15: 23: 16.000000",

"transaction_type": "Netbanking",

"merchant_refund_id": null,
"transaction_amount": 699.5,

"refund_request_date": "2024-07-11 15: 25: 01.936643",

"chargeback_description": ""

4.7.5 Response
{

"StatusCode": "1",

"Message": "Success",

"Result": true

You might also like