API Test Keys

Fetch All Orders (With Expanded Card Payments)

GET
/v1/orders?expand[]=payments.card

Click to copy

Use this endpoint to retrieve the details of all the orders that you created, with the card parameter expanded in the payments object.

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.card

Success

Failure

1
{
2
"entity": "collection",
3
"count": 1,
4
"items": [
5
{
6
"id": "order_MjehF7I6RXSm2o",
7
"entity": "order",
8
"amount": 500,
9
"amount_paid": 500,
10
"amount_due": 0,
11
"currency": "MYR",
12
"receipt": null,
13
"payments": {
14
"entity": "collection",
15
"count": 1,
16
"items": [
17
{
18
"id": "pay_MjehkbJc3pPERF",
19
"entity": "payment",
20
"amount": 500,
21
"currency": "MYR",
22
"status": "captured",
23
"order_id": "order_MjehF7I6RXSm2o",
24
"invoice_id": null,
25
"international": false,
26
"method": "card",
27
"amount_refunded": 0,
28
"refund_status": null,
29
"captured": true,
30
"description": null,
31
"card_id": "card_MjehkeMkNIzhOb",
32
"card": {
33
"id": "card_MjehkeMkNIzhOb",
34
"entity": "card",
35
"name": "",
36
"last4": "1111",
37
"network": "Visa",
38
"type": "debit",
39
"issuer": null,
40
"international": false,
41
"emi": false,
42
"sub_type": "consumer",
43
"token_iin": null
44
},
45
"bank": null,
46
"wallet": null,
47
"vpa": null,
48
"email": "gaurav.kumar@example.com",
49
"contact": "+919999999939",
50
"notes": [],
51
"fee": 10,
52
"tax": 0,
53
"error_code": null,
54
"error_description": null,
55
"error_source": null,
56
"error_step": null,
57
"error_reason": null,
58
"acquirer_data": {
59
"auth_code": "486881"
60
},
61
"created_at": 1696318958
62
}
63
]
64
},
65
"offer_id": null,
66
"status": "paid",
67
"attempts": 1,
68
"notes": [],
69
"created_at": 1696318929
70
}
71
]
72
}
Query Parameters
expand[]=payments.card
string

Use to expand the card payments made for an order.

Response Parameters
id
string

The unique identifier of the order.

entity
string

Name of the entity. Here, it is 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.

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 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 (28)

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 Card Payments)

GET
/v1/orders?expand[]=payments.card

Click to copy

Use this endpoint to retrieve the details of all the orders that you created, with the card parameter expanded in the payments object.

Is this page helpful?

Query Parameters
expand[]=payments.card
string

Use to expand the card payments made for an order.

Response Parameters
id
string

The unique identifier of the order.

entity
string

Name of the entity. Here, it is 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.

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 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 (28)

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.card

Success

Failure

1
{
2
"entity": "collection",
3
"count": 1,
4
"items": [
5
{
6
"id": "order_MjehF7I6RXSm2o",
7
"entity": "order",
8
"amount": 500,
9
"amount_paid": 500,
10
"amount_due": 0,
11
"currency": "MYR",
12
"receipt": null,
13
"payments": {
14
"entity": "collection",
15
"count": 1,
16
"items": [
17
{
18
"id": "pay_MjehkbJc3pPERF",
19
"entity": "payment",
20
"amount": 500,
21
"currency": "MYR",
22
"status": "captured",
23
"order_id": "order_MjehF7I6RXSm2o",
24
"invoice_id": null,
25
"international": false,
26
"method": "card",
27
"amount_refunded": 0,
28
"refund_status": null,
29
"captured": true,
30
"description": null,
31
"card_id": "card_MjehkeMkNIzhOb",
32
"card": {
33
"id": "card_MjehkeMkNIzhOb",
34
"entity": "card",
35
"name": "",
36
"last4": "1111",
37
"network": "Visa",
38
"type": "debit",
39
"issuer": null,
40
"international": false,
41
"emi": false,
42
"sub_type": "consumer",
43
"token_iin": null
44
},
45
"bank": null,
46
"wallet": null,
47
"vpa": null,
48
"email": "gaurav.kumar@example.com",
49
"contact": "+919999999939",
50
"notes": [],
51
"fee": 10,
52
"tax": 0,
53
"error_code": null,
54
"error_description": null,
55
"error_source": null,
56
"error_step": null,
57
"error_reason": null,
58
"acquirer_data": {
59
"auth_code": "486881"
60
},
61
"created_at": 1696318958
62
}
63
]
64
},
65
"offer_id": null,
66
"status": "paid",
67
"attempts": 1,
68
"notes": [],
69
"created_at": 1696318929
70
}
71
]
72
}