Orders
Fetch All Orders
Fetch all Orders using Razorpay Orders API.
GET
Use this endpoint to retrieve the details of all the orders you created. In this example, count and skip query parameters have been used. You can invoke this API without these query parameters as well.
Query Parameters
integer
Possible values:
1: Retrieves Orders for which payments have been authorized. Payment and order states differ. Know more about payment states.0: Retrieves orders for which payments have not been authorized.
string
Retrieves the orders that contain the provided value for receipt.
integer
Timestamp (in Unix format) from when the orders should be fetched.
integer
Timestamp (in Unix format) up till when orders are to be fetched.
integer
The number of orders to be fetched. The default value is 10. The maximum value is 100. This can be used for pagination, in combination with
skip.integer
The number of orders to be skipped. The default value is
0. This can be used for pagination, in combination with count.array
Used to retrieve additional information about the payment. Using this parameter will cause a sub-entity to be added to the response. Supported values are:
payments: Returns a collection of all payments made for each order.payments.card: Returns the card details of each payment made for each order.transfers: Returns a collection of transfers created for each order.
For more information about creating transfers using orders, refer to the Route section of the Route API documentation.virtual_account: Returns the virtual account details created for each order.
For more information about creating Virtual Accounts, refer to the Smart Collect API
Response Parameters
string
The unique identifier of the order.
integer
The amount for which the order was created, in currency subunits. For example, for an amount of , enter
29500.string
Name of the entity. Here, it is
order.integer
The amount paid against the order.
integer
The amount pending against the order.
string
required
ISO code for the currency in which you want to accept the payment. The default length is 3 characters. Refer to the list of supported currencies.
string
Receipt number that corresponds to this order. Can have a maximum length of 40 characters and has to be unique.
string
The status of the order. Possible values:
created: When you create an order it is in thecreatedstate. It stays in this state till a payment is attempted on it.attempted: An order moves fromcreatedtoattemptedstate when a payment is first attempted on it. It remains in theattemptedstate till one payment associated with that order is captured.paid: After the successful capture of the payment, the order moves to thepaidstate. No further payment requests are permitted once the order moves to thepaidstate. The order stays in thepaidstate even if the payment associated with the order is refunded.
integer
The number of payment attempts, successful and failed, that have been made against this order.
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”.integer
Indicates the Unix timestamp when this order was created.
string
Unique identifier of the offer associated with this order.
object
The recurring-payment token created when the order was authorised on a subscription / recurring flow. Present on orders that resulted in a token-bearing payment.
string
The authentication type used to create the token. One of
3ds, otp, aadhaar, or physical for emandate / mandate_otp for UPI.integer
Unix timestamp when the token expires.
string
Human-readable reason if the token-creation flow failed.
null on success.integer
Amount of the first recurring payment, in the smallest currency unit (paise for INR).
string
Frequency of the recurring debit. One of
as_presented, daily, weekly, monthly, yearly, etc.integer
Maximum amount that can be debited per cycle, in the smallest currency unit (paise for INR).
string
Lifecycle state of the recurring token. One of
initiated, confirmed, rejected, cancelled, paused, or expired.Errors
The API `<key/secret>
` provided is invalid.
The API `<key/secret> ` provided is invalid.
Code:
400The API credentials passed in the API call differ from the ones generated on the Dashboard. Possible reasons:- Different keys for test mode and live modes.
- Expired API key.
The count must be at least 1.
The count must be at least 1.
Code:
400count=0 (or omitted with explicit zero) passed in the query string.Solution: Pass count as a positive integer between 1 and 100.The count may not be greater than 100.
The count may not be greater than 100.
Code:
400count value above 100 in the query string. The Orders list endpoint caps per-page results at 100.Solution: Use a count of 100 or fewer. For larger datasets, paginate using the skip parameter.The count must be an integer.
The count must be an integer.
Code:
400count query parameter is non-numeric (for example, count=abc).Solution: Pass count as a positive integer.The from must be an integer.
The from must be an integer.
Code:
400from query parameter is not a UNIX-epoch integer (for example, an ISO date string was passed).Solution: Pass from as a UNIX-epoch integer (for example, 1700000000), not a human-readable date.Value of each expand must be one of following types.
Value of each expand must be one of following types.
Code:
400An unsupported value was passed in the expand[] query parameter.Solution: Only the following values are accepted in expand[]: payments, payments.card, virtual_account, transfers, offers.