Fetch All Orders
GET/v1/ordersClick to copy
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.
Is this page helpful?
Curl
change language
change language
1curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]\2-X GET https://api.razorpay.com/v1/orders?count=2&skip=1
Success
Failure
1{2"entity": "collection",3"count": 2,4"items": [5{6"id": "order_EKzX2WiEWbMxmx",7"entity": "order",8"amount": 1234,9"amount_paid": 0,10"amount_due": 1234,11"currency": "",12"receipt": "Receipt No. 1",13"offer_id": null,14"status": "created",15"attempts": 0,16"notes": [],17"created_at": 158263710818},19{20"id": "order_EAI5nRfThga2TU",21"entity": "order",22"amount": 100,23"amount_paid": 0,24"amount_due": 100,25"currency": "",26"receipt": "Receipt No. 1",27"offer_id": null,28"status": "created",29"attempts": 0,30"notes": [],31"created_at": 158030073132}33]34}
Query Parameters
authorizedintegerPossible values:
1: Retrieves Orders for which payments have been authorized. Payment and order states differ. Know more about .0: Retrieves orders for which payments have not been authorized.
receiptstringRetrieves the orders that contain the provided value for receipt.
fromintegerTimestamp (in Unix format) from when the orders should be fetched.
tointegerTimestamp (in Unix format) up till when orders are to be fetched.
countinteger 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.
skipinteger The number of orders to be skipped. The default value is 0. This can be used for pagination, in combination with count.
expand[]arrayUsed 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.
Response Parameters
idstringThe unique identifier of the order.
amountinteger The amount for which the order was created, in currency subunits. For example, for an amount of $295.00, enter 29500.
entitystring Name of the entity. Here, it is order.
amount_paidintegerThe amount paid against the order.
amount_dueintegerThe amount pending against the order.
currency *
stringISO code for the currency in which you want to accept the payment. The default length is 3 characters.
receiptstringReceipt number that corresponds to this order. Can have a maximum length of 40 characters and has to be unique.
statusstringThe 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.
attemptsintegerThe number of payment attempts, successful and failed, that have been made against this order.
notesjson 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”.
created_atintegerIndicates the Unix timestamp when this order was created.
Errors
The API <key/secret> provided is invalid.
Error Status: 400
The 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.
Solution
Fetch All Orders
GET/v1/ordersClick to copy
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.
Is this page helpful?
Query Parameters
authorizedintegerPossible values:
1: Retrieves Orders for which payments have been authorized. Payment and order states differ. Know more about .0: Retrieves orders for which payments have not been authorized.
receiptstringRetrieves the orders that contain the provided value for receipt.
fromintegerTimestamp (in Unix format) from when the orders should be fetched.
tointegerTimestamp (in Unix format) up till when orders are to be fetched.
countinteger 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.
skipinteger The number of orders to be skipped. The default value is 0. This can be used for pagination, in combination with count.
expand[]arrayUsed 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.
Response Parameters
idstringThe unique identifier of the order.
amountinteger The amount for which the order was created, in currency subunits. For example, for an amount of $295.00, enter 29500.
entitystring Name of the entity. Here, it is order.
amount_paidintegerThe amount paid against the order.
amount_dueintegerThe amount pending against the order.
currency *
stringISO code for the currency in which you want to accept the payment. The default length is 3 characters.
receiptstringReceipt number that corresponds to this order. Can have a maximum length of 40 characters and has to be unique.
statusstringThe 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.
attemptsintegerThe number of payment attempts, successful and failed, that have been made against this order.
notesjson 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”.
created_atintegerIndicates the Unix timestamp when this order was created.
Errors
The API <key/secret> provided is invalid.
Error Status: 400
The 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.
Solution
Curl
change language
change language
1curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]\2-X GET https://api.razorpay.com/v1/orders?count=2&skip=1
Success
Failure
1{2"entity": "collection",3"count": 2,4"items": [5{6"id": "order_EKzX2WiEWbMxmx",7"entity": "order",8"amount": 1234,9"amount_paid": 0,10"amount_due": 1234,11"currency": "",12"receipt": "Receipt No. 1",13"offer_id": null,14"status": "created",15"attempts": 0,16"notes": [],17"created_at": 158263710818},19{20"id": "order_EAI5nRfThga2TU",21"entity": "order",22"amount": 100,23"amount_paid": 0,24"amount_due": 100,25"currency": "",26"receipt": "Receipt No. 1",27"offer_id": null,28"status": "created",29"attempts": 0,30"notes": [],31"created_at": 158030073132}33]34}