Single Integration API

Create Order and Payments in a single API call.


You can now create an order along with a payment using a single API for netbanking, cards and UPI. Given below are details and examples for all three payment methods followed by steps to integrate S2S JSON API and accept payments using

, and .

Netbanking

Create an order along with payment using the consolidated order and payment API. This single API call combines order and payment creation, resulting in a more efficient and faster transaction process.

Create a order along with payment by:

  • Making a single API call to Razorpay, combining order and payment creation.
  • Authenticating using the provided credentials, ensuring access to the consolidated payment API.
  • Manually integrating the API sample codes on your server.

Use the following API to create an order along with payment using netbanking as the payment method:

curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-X POST https://api.razorpay.com/v1/orders \
-H "Content-Type: application/json" \
-d '{
"amount": 50000,
"currency": "INR",
"receipt": "receipt#1",
"notes": {
"key1": "value3",
"key2": "value2"
},
"partial_payment": true,
"customer_id": "cust_E9penp7VGhT5yt",
"transfers": [
{
"account": "acc_IRQWUleX4BqvYn",
"amount": 1000,
"currency": "INR",
"notes": {
"branch": "Acme Corp Bangalore North",
"name": "Gaurav Kumar"
},
"linked_account_notes": [
"branch"
],
"on_hold": 1,
"on_hold_until": 1671222870
},
{
"account": "acc_IROu8Nod6PXPtZ",
"amount": 1000,
"currency": "INR",
"notes": {
"branch": "Acme Corp Bangalore South",
"name": "Saurav Kumar"
},
"linked_account_notes": [
"branch"
],
"on_hold": 0
}
],
"products": [],
"bank_account": {
"account_number": "765432123456789",
"name": "Gaurav Kumar",
"ifsc": "HDFC0000053"
},
"payment_config": {
"capture": "automatic",
"capture_options": {
"automatic_expiry_period": 12,
"manual_expiry_period": 7200,
"refund_speed": "optimum"
}
},
"payment": {
"amount": 100,
"email": "gaurav.kumar@example.com",
"contact": "9123456789",
"ip": "192.168.0.103",
"method": "netbanking",
"bank": "HDFC",
"description": "Test payment",
"notes": {
"note_key": "value1"
}
},
"user_agent": "Mozilla/5.0"
}
{
"id": "order_EKwxwAgItmmXdp",
"status": "attempted",
"receipt": "receipt#1",
"notes": {
"key1": "value3",
"key2": "value2"
},
"created_at": 1582628071,
"amount": 50000,
"amount_paid": 0,
"amount_due": 50000,
"currency": "INR",
"offer_id": null,
"attempts": 1,
"transfers": [],
"payment_workflow": {
"id": "pay_FVmAstJWfsD3SO",
"next": [
{
"action": "redirect",
"url": "https://api.razorpay.com/v1/payments/FVptEs3cSWX1fs/authorize"
},
]
}
}

amount

mandatory

integer The amount for which the order was created in currency subunits. For example, for an amount of ₹295.00, enter 29500. The same amount will be used for the payment creation. For the partial payment scenario, we will use the amount specified in the payment request object in case.

currency

mandatory

string The currency in which the transaction should be made. See the

. Length must be of 3 characters.

receipt

optional

string Receipt number that corresponds to this order. Can have a maximum length of 40 characters and has to be unique.

partial_payment

optional

boolean Indicates whether the customer can make a partial payment. Possible values:

  • true: The customer can make partial payments.
  • false (default): The customer cannot make partial payments.

first_payment_min_amount

optional

integer Minimum amount that must be paid by the customer as the first partial payment. For example, if an amount of ₹7,000 is to be received from the customer in two installments of #1 - ₹5,000, #2 - ₹2,000, then you can set this value as 500000. This parameter should be passed only if partial_payment is true.

customer_id

optional

string Unique identifier of the customer.

transfers

optional

json object Details regarding the transfer.

account

string The recipient account ID for fund transfer.

amount

optional

string The amount of the transfer.

currency

mandatory

string The currency in which the transaction should be made. See the

. Length must be of 3 characters.

notes

optional

json object Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”.

linked_account_notes

optional

string Notes associated with the linked account.

on_hold

mandatory

string Indicates whether the transfer amount is on hold.

on_hold_until

mandatory

string Timestamp until which the transfer amount is on hold.

bank_account

optional

json object Details of the bank account that the customer provides at the time of registration.

account_number

optional

string Account number of the customers bank account.

name

optional

string The name associated with the bank account.

ifsc

optional

string The IFSC code of the bank.

payment_config

optional

array Payment capture settings for the payment. The options sent here override the

configured using the Dashboard.

capture

mandatory

string Option to automatically capture payment. Possible values:

  • automatic: Payments are auto-captured according to the configurations specified in the capture_options array.
  • manual: You have to manually capture payments using our or from the .

capture_options

optional

array Use this array to determine the expiry period for automatic and manual capture of payments and the refund speed in the case of non-capture.

automatic_expiry_period

mandatory if capture = automatic

integer Time in minutes till when payments in the authorized state should be auto-captured. Minimum value 12 minutes. This parameter is mandatory only if the value of capture parameter is automatic.

manual_expiry_period

optional

integer Time in minutes till when you can manually capture payments in the authorized state.

  • Must be equal to or greater than the automatic_expiry_period value.
  • Default value 7200 minutes.
  • Maximum value 7200 minutes.
  • Payments in the authorized state after the manual_expire_period are auto-refunded.

refund_speed

mandatory

string Refund speed for payments that were not captured (automatically or manually). Possible values:

  • optimum: We try to process the refund instantly. We charge a small fee for this. If it is not possible to process an instant refund, we will process a normal refund in 5-7 working days. .
  • normal: The refund is processed in 5-7 working days.

    If no value is passed, the refund is processed using the .

payment

mandatory

object Details of the payment.

amount

optional

integer The amount for which the order was created in currency subunits. For example, for an amount of ₹295.00, enter 29500. The same amount will be used for the payment creation. For the partial payment scenario, we will use the amount specified in the payment request object in case.

email

mandatory

string Email address of the customer.

contact

mandatory

integer Contact number of the customer.

ip

mandatory

string The customer's IP address.

method

mandatory

string Name of the payment method (example, netbanking, cards and upi).

bank

mandatory

string Name of the bank.

description

mandatory

string Description of the payment.

Descriptions for the response parameters are present in the

.

Cards

Watch Out!

The request body will differ from those created by other PSPs for tokens created on Razorpay.

The following API will create a payment with cards as the payment method:

curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-X POST https://api.razorpay.com/v1/orders \
-H "Content-Type: application/json" \
-d {
"amount": 50000,
"currency": "INR",
"receipt": "receipt#1",
"notes": {
"key1": "value3",
"key2": "value2"
},
"partial_payment": true,
"customer_id": "cust_E9penp7VGhT5yt",
"transfers": [
{
"account": "acc_IRQWUleX4BqvYn",
"amount": 1000,
"currency": "INR",
"notes": {
"branch": "Acme Corp Bangalore North",
"name": "Gaurav Kumar"
},
"linked_account_notes": [
"branch"
],
"on_hold": 1,
"on_hold_until": 1671222870
},
{
"account": "acc_IROu8Nod6PXPtZ",
"amount": 1000,
"currency": "INR",
"notes": {
"branch": "Acme Corp Bangalore South",
"name": "Gaurav Kumar"
},
"linked_account_notes": [
"branch"
],
"on_hold": 0
}
],
"products": [],
"payment_config": {
"capture": "automatic",
"capture_options": {
"automatic_expiry_period": 12,
"manual_expiry_period": 7200,
"refund_speed": "optimum"
}
},
"payment": {
"amount": 100,
"email": "gaurav.kumar@example.com",
"contact": "9090909090",
"method": "card",
"notes": {
"key1": "value3",
"key2": "value2"
},
"card": {
"number": "4111111111111111",
"name": "Gaurav",
"expiry_month": "11",
"expiry_year": "30",
"cvv": "100"
},
"authentication": {
"authentication_channel": "browser"
},
"browser": {
"java_enabled": false,
"javascript_enabled": false,
"timezone_offset": 11,
"color_depth": 23,
"screen_width": 23,
"screen_height": 100
},
"ip": "105.106.107.108",
"referer": "https://merchansite.com/example/paybill"
},
"user_agent": "Mozilla/5.0"
}
{
"id": "order_EKwxwAgItmmXdp",
"status": "attempted",
"receipt": "receipt#1",
"notes": {
"key1": "value3",
"key2": "value2"
},
"created_at": 1582628071,
"amount": 50000,
"amount_paid": 0,
"amount_due": 50000,
"currency": "INR",
"offer_id": null,
"attempts": 1,
"transfers": [],
"payment_workflow": {
"id": "pay_FVmAstJWfsD3SO",
"next": [
{
"action": "redirect",
"url": "https://api.razorpay.com/v1/payments/pay_FVmAstJWfsD3SO/authorize"
},
{
"action": "otp_generate",
"url": "https://api.razorpay.com/v1/payments/pay_FVmAstJWfsD3SO/otp_generate?track_id=FVmAtLUe9XZSGM&key_id=<YOUR_KEY_ID>"
}
]
}
}

amount

mandatory

integer The amount for which the order was created in currency subunits. For example, for an amount of ₹295.00, enter 29500. The same amount will be used for the payment creation. For the partial payment scenario, we will use the amount specified in the payment request object in case.

currency

mandatory

string The currency in which the transaction should be made. See the

. Length must be of 3 characters.

receipt

optional

string Receipt number that corresponds to this order. Can have a maximum length of 40 characters and has to be unique.

partial_payment

optional

boolean Indicates whether the customer can make a partial payment. Possible values:

  • true: The customer can make partial payments.
  • false (default): The customer cannot make partial payments.

first_payment_min_amount

optional

integer Minimum amount that must be paid by the customer as the first partial payment. For example, if an amount of ₹7,000 is to be received from the customer in two installments of #1 - ₹5,000, #2 - ₹2,000, then you can set this value as 500000. This parameter should be passed only if partial_payment is true.

customer_id

optional

string Unique identifier of the customer.

transfers

optional

json object Details regarding the transfer.

account

string The recipient account ID for fund transfer.

amount

optional

string The amount of the transfer.

currency

mandatory

string The currency in which the transaction should be made. See the

. Length must be of 3 characters.

notes

optional

json object Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”.

linked_account_notes

optional

string Notes associated with the linked account.

on_hold

mandatory

string Indicates whether the transfer amount is on hold.

on_hold_until

mandatory

string Timestamp until which the transfer amount is on hold.

payment_config

optional

array Payment capture settings for the payment. The options sent here override the

configured using the Dashboard.

capture

mandatory

string Option to automatically capture payment. Possible values:

  • automatic: Payments are auto-captured according to the configurations specified in the capture_options array.
  • manual: You have to manually capture payments using our or from the .

capture_options

optional

array Use this array to determine the expiry period for automatic and manual capture of payments and the refund speed in the case of non-capture.

automatic_expiry_period

mandatory if capture = automatic

integer Time in minutes till when payments in the authorized state should be auto-captured. Minimum value 12 minutes. This parameter is mandatory only if the value of capture parameter is automatic.

manual_expiry_period

optional

integer Time in minutes till when you can manually capture payments in the authorized state.

  • Must be equal to or greater than the automatic_expiry_period value.
  • Default value 7200 minutes.
  • Maximum value 7200 minutes.
  • Payments in the authorized state after the manual_expire_period are auto-refunded.

refund_speed

mandatory

string Refund speed for payments that were not captured (automatically or manually). Possible values:

  • optimum: We try to process the refund instantly. We charge a small fee for this. If it is not possible to process an instant refund, we will process a normal refund in 5-7 working days. .
  • normal: The refund is processed in 5-7 working days.

    If no value is passed, the refund is processed using the .

payment

mandatory

object Details of the payment.

amount

optional

integer The amount for which the order was created in currency subunits. For example, for an amount of ₹295.00, enter 29500. The same amount will be used for the payment creation. For the partial payment scenario, we will use the amount specified in the payment request object in case.

email

mandatory

string Email address of the customer.

contact

mandatory

integer Contact number of the customer.

method

mandatory

string Name of the payment method (example, netbanking, cards and upi).

card

mandatory

object Details of the payment.

number

mandatory

integer Details associated with the card.

expiry_month

mandatory

string Expiry month for the card in MM format.

name

mandatory

string Name of the cardholder.

expiry_year

mandatory

string Expiry year for the card in YY format.

cvv

mandatory

integer CVV printed on the back of the card.

ip

mandatory

string The customer's IP address.

referrer

optional

string Referrer header passed by the client's browser.

user-agent

mandatory

string The User-Agent header of the user's browser. The default value will be passed by Razorpay if not provided by you.

authentication

mandatory

object Details of the authentication method used for the payment.

authentication_channel

mandatory

string Specifies the channel through which authentication is performed. In this example, it's set to browser.

browser

mandatory

object Information regarding the customer's browser. This parameter need not be passed when authentication_channel=app.

java_enabled

mandatory

boolean Indicates whether the customer's browser supports Java. Obtained from the navigator HTML DOM object.

javascript_enabled

mandatory

boolean Indicates whether the customer's browser can execute JavaScript.Obtained from the navigator HTML DOM object.

timezone_offset

mandatory

integer Time difference between UTC time and the cardholder's browser local time. Obtained from the getTimezoneOffset() method applied to the Date object.

color_depth

mandatory

integer Obtained from the payer's browser using the screen.colorDepth HTML DOM property.

screen_width

mandatory

integer Total width of the payer's screen in pixels. Obtained from the screen.width HTML DOM property.

screen_height

mandatory

integer Obtained from the navigator HTML DOM object.

Descriptions for the response parameters are present in the

.

UPI

The following API will create a payment with UPI as the payment method:

curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-X POST https://api.razorpay.com/v1/orders \
-H "Content-Type: application/json" \
-d {
"amount": 50000,
"currency": "INR",
"receipt": "receipt#1",
"notes": {
"key1": "value3",
"key2": "value2"
},
"partial_payment": true,
"customer_id": "cust_E9penp7VGhT5yt",
"transfers": [
{
"account": "acc_IRQWUleX4BqvYn",
"amount": 1000,
"currency": "INR",
"notes": {
"branch": "Acme Corp Bangalore North",
"name": "Gaurav Kumar"
},
"linked_account_notes": [
"branch"
],
"on_hold": 1,
"on_hold_until": 1671222870
},
{
"account": "acc_IROu8Nod6PXPtZ",
"amount": 1000,
"currency": "INR",
"notes": {
"branch": "Acme Corp Bangalore South",
"name": "Gaurav Kumar"
},
"linked_account_notes": [
"branch"
],
"on_hold": 0
}
],
"products": [],
"bank_account": {
"account_number": "765432123456789",
"name": "Gaurav Kumar",
"ifsc": "HDFC0000053"
},
"payment_config": {
"capture": "automatic",
"capture_options": {
"automatic_expiry_period": 12,
"manual_expiry_period": 7200,
"refund_speed": "optimum"
}
},
"payment": {
"amount": 100,
"email": "gaurav.kumar@example.com",
"contact": "9090909090",
"method": "upi",
"upi": {
"flow": "collect",
"vpa": "gauravkumar@okhdfcbank"
},
"ip": "192.168.0.103",
"referer": "http",
"user_agent": "Mozilla/5.0",
"description": "Test payment",
"notes": {
"note_key": "value1"
}
},
"user_agent": "Mozilla/5.0"
}
{
"id": "order_EKwxwAgItmmXdp",
"status": "attempted",
"receipt": "receipt#1",
"notes": {
"key1": "value3",
"key2": "value2"
},
"created_at": 1582628071,
"amount": 50000,
"amount_paid": 0,
"amount_due": 50000,
"currency": "INR",
"offer_id": null,
"attempts": 1,
"transfers": [],