Payments API🔗
Payments APIs are used to capture and fetch payments. You can also fetch payments based on orders and card details of payment.
You can try out our APIs on the Razorpay Postman Public Workspace.
Payments
Capture and fetch Payments using Razorpay APIs.
You can accept payments from your customers by integrating your website or app with Razorpay Payment Gateway. You can also use Razorpay products such as Payment Links, Payment Pages, Subscription Links, Invoices and Smart Collect to accept Payments.
Handy Tips
If you want to integrate with our APIs directly, reach out to our Support team with your requirements.
Payments APIs are used to capture and fetch payments. You can also fetch payments based on orders and card details of payment.
You can try out our APIs on the Razorpay Postman Public Workspace.
The Payments entity has the following fields:
id
string
Unique identifier of the payment.entity
string
Indicates the type of entity.amount
integer
The payment amount represented in smallest unit of the currency passed. For example, amount = 100 translates to 100 paise, that is ₹1 (default currency is INR).currency
string
The currency in which the payment is made. Refer to the list of international currencies that we support.status
string
The status of the payment. Possible values: created
authorized
captured
refunded
failed
base_amount
integer
The converted payment amount used to calculate fees and settlements. Represented in smallest unit of the base_currency
. This attribute is currently only present if the currency
is non-INR.base_currency
string
The conversion currency used to calculate fees and settlements. This currently defaults to INR, and is present only if the currency
is non-INR.method
string
The payment method used for making the payment. Possible values: card
netbanking
wallet
emi
upi
order_id
string
Order ID, if provided. Know more about Orders.description
`string
Description of the payment, if any.international
boolean
Indicates whether the payment is done via an international card or a domestic one.refund_status
string
The refund status of the payment. Possible values:null
partial
full
amount_refunded
integer
The amount refunded in smallest unit of the currency passed.amount_refunded
= 100, here 100 stands for 100 paise, which is equal to ₹1. INR is the default currency.captured
boolean
Indicates if the payment is captured.email
string
Customer email address used for the payment.contact
integer
Customer contact number used for the payment.fee
integer
Fee (including GST) charged by Razorpay.tax
integer
GST charged for the payment.error_code
string
Error that occurred during payment. For example, BAD_REQUEST_ERROR
.error_description
string
Description of the error that occurred during payment. For example, Payment processing failed because of incorrect OTP
.error_source
string
The point of failure. For example, customer
.error_step
string
The stage where the transaction failure occurred. The stages can vary depending on the payment method used to complete the transaction. For example, payment_authentication
.error_reason
string
The exact error reason. For example, incorrect_otp
.notes
json object
Contains user-defined fields, stored for reference purposes.created_at
integer
Timestamp, in UNIX format, on which the payment was created.name
string
Name of the cardholder.last4
integer
The last 4 digits of the card number.network
string
The card network. Possible values:
American Express
Diners Club
Maestro
MasterCard
RuPay
Unknown
Visa
type
string
The card type. Possible values:
credit
debit
prepaid
unknown
issuer
string
The card issuer. The 4-character code denotes the issuing bank.emi
boolean
This attribute is set to true
if the card can be used for EMI payment method.sub_type
string
The sub-type of the customer's card. Possible values:
business
You can perform the following actions on payments from the Razorpay Dashboard:
The following endpoint helps you capture a payment.
authorized
to captured
.Watch Out!
Attempting to capture a payment whose status is not authorized
will produce an error.
Handy Tips
amount
field, enter only the amount associated with the order that is stored in your database.id
mandatorystring
Unique identifier of the payment to be captured.amount
mandatoryinteger
The amount to be captured (should be equal to the authorized amount, in the smallest unit of the chosen currency).currency
mandatorystring
ISO code of the currency in which the payment was made. Refer to the list of supported currencies.Descriptions for the response parameters are present in the Payments Entity parameters table.
The following endpoint retrieves details of a specific payment using its id
.
id
mandatorystring
Unique identifier of the payment to be retrieved.expand[]
optionalarray
Used to retrieve additional information about the payment and the method used to make the payment. The response will include a sub-entity if this parameter is used. card
: Expanded card details, applicable for card and EMI payments.emi
: Expanded EMI plan details, applicable for EMI payments.offers
: Expanded Offer details, applicable when an offer was applied to the payment.Descriptions for the response parameters are present in the Payments Entity parameters table.
The expand[]
parameter on the Payments endpoint returns expandable fields in the response.
expand[]=card
card
.expand[]=emi
emi
.expand[]=offers
The following endpoint retrieves details of all the payments.
Handy Tips
By default, only the last 10 records are displayed. You can use the count
and skip
parameters to retrieve the specific number of records that you need.
from
optionalinteger
UNIX timestamp, in seconds, from when payments are to be fetched.to
optionalinteger
UNIX timestamp, in seconds, till when payments are to be fetched.count
optionalinteger
Number of payments to be fetched. skip
parameter.skip
optionalinteger
Number of records to be skipped while fetching the payments.expand[]
optionalarray
Used to retrieve additional information about the payment, the method used to make the payment. The response will include a sub-entity if this parameter is used. card
: Expanded card details, usable for card and EMI payments.emi
: Expanded EMI plan details, usable for EMI payments.Descriptions for the response parameters are present in the Payments Entity parameters table.
The following endpoint retrieves the expanded card details of the payments, in which the payment method is card
.
The following endpoint retrieves the expanded EMI plan details of the payments, in which the payment method is emi
.
The following endpoint retrieves payments corresponding to an order.
id
mandatorystring
Unique identifier of the order for which you want to fetch payment details.Descriptions for the response parameters are present in the Payments Entity parameters table.
The following endpoint retrieves the details of the card used to make a payment.
id
mandatorystring
Unique identifier of the payment for which you want to retrieve card details.Descriptions for the response parameters are present in the Payments Entity parameters table.
The following endpoint helps you modify the notes
field for a particular payment.
You can modify an existing payment to update the Notes
field only. Notes can be used to record additional information about the payment. You can add up to 15 key-value pairs with each value of the key not exceeding 256 characters.
id
mandatorystring
Unique identifier of the payment for which the Notes
field should be updated.notes
mandatoryjson object
Contains user-defined fields and is stored for reference purposes. Know more about notes.Descriptions for the response parameters are present in the Payments Entity parameters table.
Set up Razorpay Webhooks to configure and receive notifications when a specific event occurs. When one of these events is triggered, we send an HTTP POST payload in JSON to the webhook's configured URL.
ON THIS PAGE