API Test Keys

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

1
curl -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": "INR",
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": "INR",
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
"vpa": null,
35
"email": "gaurav.kumar@example.com",
36
"contact": "+919900000000",
37
"notes": [],
38
"fee": null,
39
"tax": null,
40
"error_code": null,
41
"error_description": null,
42
"error_source": null,
43
"error_step": null,
44
"error_reason": null,
45
"created_at": 1589269390
46
}
47
]
48
},
49
"offer_id": null,
50
"status": "attempted",
51
"attempts": 1,
52
"notes": [],
53
"created_at": 1589268096
54
},
55
{
56
"id": "order_Eoryq8z9wd0y7i",
57
"entity": "order",
58
"amount": 10000,
59
"amount_paid": 0,
60
"amount_due": 10000,
61
"currency": "INR",
62
"receipt": null,
63
"payments": {
64
"entity": "collection",
65
"count": 1,
66
"items": [
67
{
68
"id": "pay_EpMr7r6DRIdYPO",
69
"entity": "payment",
70
"amount": 10000,
71
"currency": "INR",
72
"status": "authorized",
73
"order_id": "order_Eoryq8z9wd0y7i",
74
"invoice_id": null,
75
"international": false,
76
"method": "card",
77
"amount_refunded": 0,
78
"refund_status": null,
79
"captured": false,
80
"description": null,
81
"card_id": "card_EpMr7y6E5cDXvd",
82
"bank": null,
83
"wallet": null,
84
"vpa": null,
85
"email": "gaurav.kumar@example.com",
86
"contact": "+919900000000",
87
"notes": [],
88
"fee": null,
89
"tax": null,
90
"error_code": null,
91
"error_description": null,
92
"error_source": null,
93
"error_step": null,
94
"error_reason": null,
95
"created_at": 1589269450
96
}
97
]
98
},
99
"offer_id": null,
100
"status": "attempted",
101
"attempts": 1,
102
"notes": [],
103
"created_at": 1589160718
104
}
105
]
106
}
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 ₹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. Refer to the

.

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 the created state. It stays in this state till a payment is attempted on it.
  • attempted: An order moves from created to attempted state when a payment is first attempted on it. It remains in the attempted state till one payment associated with that order is captured.
  • paid: After the successful capture of the payment, the order moves to the paid state. No further payment requests are permitted once the order moves to the paid state. The order stays in the paid 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 (29)

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 ₹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. Refer to the

.

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 the created state. It stays in this state till a payment is attempted on it.
  • attempted: An order moves from created to attempted state when a payment is first attempted on it. It remains in the attempted state till one payment associated with that order is captured.
  • paid: After the successful capture of the payment, the order moves to the paid state. No further payment requests are permitted once the order moves to the paid state. The order stays in the paid 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 (29)

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

1
curl -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": "INR",
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": "INR",
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
"vpa": null,
35
"email": "gaurav.kumar@example.com",
36
"contact": "+919900000000",
37
"notes": [],
38
"fee": null,
39
"tax": null,
40
"error_code": null,
41
"error_description": null,
42
"error_source": null,
43
"error_step": null,
44
"error_reason": null,
45
"created_at": 1589269390
46
}
47
]
48
},
49
"offer_id": null,
50
"status": "attempted",
51
"attempts": 1,
52
"notes": [],
53
"created_at": 1589268096
54
},
55
{
56
"id": "order_Eoryq8z9wd0y7i",
57
"entity": "order",
58
"amount": 10000,
59
"amount_paid": 0,
60
"amount_due": 10000,
61
"currency": "INR",
62
"receipt": null,
63
"payments": {
64
"entity": "collection",
65
"count": 1,
66
"items": [
67
{
68
"id": "pay_EpMr7r6DRIdYPO",
69
"entity": "payment",
70
"amount": 10000,
71
"currency": "INR",
72
"status": "authorized",
73
"order_id": "order_Eoryq8z9wd0y7i",
74
"invoice_id": null,
75
"international": false,
76
"method": "card",
77
"amount_refunded": 0,
78
"refund_status": null,
79
"captured": false,
80
"description": null,
81
"card_id": "card_EpMr7y6E5cDXvd",
82
"bank": null,
83
"wallet": null,
84
"vpa": null,
85
"email": "gaurav.kumar@example.com",
86
"contact": "+919900000000",
87
"notes": [],
88
"fee": null,
89
"tax": null,
90
"error_code": null,
91
"error_description": null,
92
"error_source": null,
93
"error_step": null,
94
"error_reason": null,
95
"created_at": 1589269450
96
}
97
]
98
},
99
"offer_id": null,
100
"status": "attempted",
101
"attempts": 1,
102
"notes": [],
103
"created_at": 1589160718
104
}
105
]
106
}