Fetch All Orders (With Expanded Payments)
GET
/v1/orders?expand[]=payments
Click to copy
Use this endpoint to retrieve the details of all the orders that you created, with the payment parameter expanded.
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?expand[]=payments
Success
Failure
1{2"entity": "collection",3"count": 2,4"items": [5{6"id": "order_EpMTIJM0rhOj3H",7"entity": "order",8"amount": 10000,9"amount_paid": 0,10"amount_due": 10000,11"currency": "MYR",12"receipt": null,13"payments": {14"entity": "collection",15"count": 1,16"items": [17{18"id": "pay_EpMq4YcK0z5UYk",19"entity": "payment",20"amount": 10000,21"currency": "MYR",22"status": "authorized",23"order_id": "order_EpMTIJM0rhOj3H",24"invoice_id": null,25"international": false,26"method": "card",27"amount_refunded": 0,28"refund_status": null,29"captured": false,30"description": null,31"card_id": "card_EpMq4e7H6fHBQZ",32"bank": null,33"wallet": null,34"email": "gaurav.kumer@example.com",35"contact": "+919900000000",36"notes": [],37"fee": null,38"tax": null,39"error_code": null,40"error_description": null,41"error_source": null,42"error_step": null,43"error_reason": null,44"created_at": 158926939045}46]47},48"offer_id": null,49"status": "attempted",50"attempts": 1,51"notes": [],52"created_at": 158926809653},54{55"id": "order_Eoryq8z9wd0y7i",56"entity": "order",57"amount": 10000,58"amount_paid": 0,59"amount_due": 10000,60"currency": "MYR",61"receipt": null,62"payments": {63"entity": "collection",64"count": 1,65"items": [66{67"id": "pay_EpMr7r6DRIdYPO",68"entity": "payment",69"amount": 10000,70"currency": "MYR",71"status": "authorized",72"order_id": "order_Eoryq8z9wd0y7i",73"invoice_id": null,74"international": false,75"method": "card",76"amount_refunded": 0,77"refund_status": null,78"captured": false,79"description": null,80"card_id": "card_EpMr7y6E5cDXvd",81"bank": null,82"wallet": null,83"email": "gaurav.kumar@example.com",84"contact": "+919900000000",85"notes": [],86"fee": null,87"tax": null,88"error_code": null,89"error_description": null,90"error_source": null,91"error_step": null,92"error_reason": null,93"created_at": 158926945094}95]96},97"offer_id": null,98"status": "attempted",99"attempts": 1,100"notes": [],101"created_at": 1589160718102}103]104}
Query Parameters
expand[]=payments
string
Use to expand the payments made for an order.
Response Parameters
id
string
The unique identifier of the order.
amount
integer
The amount for which the order was created, in currency subunits. For example, for an amount of RM 295.00, enter 29500
.
entity
string
Name of the entity. Here, it is order
.
amount_paid
integer
The amount paid against the order.
amount_due
integer
The amount pending against the order.
currency
*
string
ISO code for the currency in which you want to accept the payment. The default length is 3 characters.
receipt
string
Receipt number that corresponds to this order. Can have a maximum length of 40 characters and has to be unique.
status
string
The status of the order. Possible values:
created
: When you create an order it is in thecreated
state. It stays in this state till a payment is attempted on it.attempted
: An order moves fromcreated
toattempted
state when a payment is first attempted on it. It remains in theattempted
state till one payment associated with that order is captured.paid
: After the successful capture of the payment, the order moves to thepaid
state. No further payment requests are permitted once the order moves to thepaid
state. The order stays in thepaid
state even if the payment associated with the order is refunded.
attempts
integer
The number of payment attempts, successful and failed, that have been made against this order.
notes
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”
.
created_at
integer
Indicates the Unix timestamp when this order was created.
payments
object
Details of the payment.
Show child parameters (27)
Errors
The API {key/secret} provided is invalid.
Error Status: 4xx
The API credentials passed in the API call differ from the ones generated on the Dashboard.
Solution
Fetch All Orders (With Expanded Payments)
GET
/v1/orders?expand[]=payments
Click to copy
Use this endpoint to retrieve the details of all the orders that you created, with the payment parameter expanded.
Is this page helpful?
Query Parameters
expand[]=payments
string
Use to expand the payments made for an order.
Response Parameters
id
string
The unique identifier of the order.
amount
integer
The amount for which the order was created, in currency subunits. For example, for an amount of RM 295.00, enter 29500
.
entity
string
Name of the entity. Here, it is order
.
amount_paid
integer
The amount paid against the order.
amount_due
integer
The amount pending against the order.
currency
*
string
ISO code for the currency in which you want to accept the payment. The default length is 3 characters.
receipt
string
Receipt number that corresponds to this order. Can have a maximum length of 40 characters and has to be unique.
status
string
The status of the order. Possible values:
created
: When you create an order it is in thecreated
state. It stays in this state till a payment is attempted on it.attempted
: An order moves fromcreated
toattempted
state when a payment is first attempted on it. It remains in theattempted
state till one payment associated with that order is captured.paid
: After the successful capture of the payment, the order moves to thepaid
state. No further payment requests are permitted once the order moves to thepaid
state. The order stays in thepaid
state even if the payment associated with the order is refunded.
attempts
integer
The number of payment attempts, successful and failed, that have been made against this order.
notes
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”
.
created_at
integer
Indicates the Unix timestamp when this order was created.
payments
object
Details of the payment.
Show child parameters (27)
Errors
The API {key/secret} provided is invalid.
Error Status: 4xx
The API credentials passed in the API call differ from the ones generated on the Dashboard.
Solution
Curl
change language
change language
1curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]2-X GET https://api.razorpay.com/v1/orders?expand[]=payments
Success
Failure
1{2"entity": "collection",3"count": 2,4"items": [5{6"id": "order_EpMTIJM0rhOj3H",7"entity": "order",8"amount": 10000,9"amount_paid": 0,10"amount_due": 10000,11"currency": "MYR",12"receipt": null,13"payments": {14"entity": "collection",15"count": 1,16"items": [17{18"id": "pay_EpMq4YcK0z5UYk",19"entity": "payment",20"amount": 10000,21"currency": "MYR",22"status": "authorized",23"order_id": "order_EpMTIJM0rhOj3H",24"invoice_id": null,25"international": false,26"method": "card",27"amount_refunded": 0,28"refund_status": null,29"captured": false,30"description": null,31"card_id": "card_EpMq4e7H6fHBQZ",32"bank": null,33"wallet": null,34"email": "gaurav.kumer@example.com",35"contact": "+919900000000",36"notes": [],37"fee": null,38"tax": null,39"error_code": null,40"error_description": null,41"error_source": null,42"error_step": null,43"error_reason": null,44"created_at": 158926939045}46]47},48"offer_id": null,49"status": "attempted",50"attempts": 1,51"notes": [],52"created_at": 158926809653},54{55"id": "order_Eoryq8z9wd0y7i",56"entity": "order",57"amount": 10000,58"amount_paid": 0,59"amount_due": 10000,60"currency": "MYR",61"receipt": null,62"payments": {63"entity": "collection",64"count": 1,65"items": [66{67"id": "pay_EpMr7r6DRIdYPO",68"entity": "payment",69"amount": 10000,70"currency": "MYR",71"status": "authorized",72"order_id": "order_Eoryq8z9wd0y7i",73"invoice_id": null,74"international": false,75"method": "card",76"amount_refunded": 0,77"refund_status": null,78"captured": false,79"description": null,80"card_id": "card_EpMr7y6E5cDXvd",81"bank": null,82"wallet": null,83"email": "gaurav.kumar@example.com",84"contact": "+919900000000",85"notes": [],86"fee": null,87"tax": null,88"error_code": null,89"error_description": null,90"error_source": null,91"error_step": null,92"error_reason": null,93"created_at": 158926945094}95]96},97"offer_id": null,98"status": "attempted",99"attempts": 1,100"notes": [],101"created_at": 1589160718102}103]104}