API Test Keys

Fetch Payments for an Order

GET
/v1/orders/:id/payments

Click to copy

Use this endpoint to fetch all the payments made for an order. The response contains all the authorised or failed payments for that order.

Is this page helpful?

Curl

change language

change language

1
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]\
2
3
-X GET https://api.razorpay.com/v1/orders/order_DaaS6LOUAASb7Y/payments \

Success

Failure

1
{
2
"entity":"collection",
3
"count":2,
4
"items":[
5
{
6
"id":"pay_N8FUmetkCE2hZP",
7
"entity":"payment",
8
"amount":100,
9
"currency":"INR",
10
"status":"failed",
11
"order_id":"order_N8FRN5zTm5S3wx",
12
"invoice_id":null,
13
"international":false,
14
"method":"upi",
15
"amount_refunded":0,
16
"refund_status":null,
17
"captured":false,
18
"description":null,
19
"card_id":null,
20
"bank":null,
21
"wallet":null,
22
"vpa":"failure@razorpay",
23
"email":"void@razorpay.com",
24
"contact":"+919999999999",
25
"notes":{
26
"notes_key_1":"Tea, Earl Grey, Hot",
27
"notes_key_2":"Tea, Earl Grey… decaf."
28
},
29
"fee":null,
30
"tax":null,
31
"error_code":"BAD_REQUEST_ERROR",
32
"error_description":"Payment was unsuccessful due to a temporary issue. If amount got deducted, it will be refunded within 5-7 working days.",
33
"error_source":"gateway",
34
"error_step":"payment_response",
35
"error_reason":"payment_failed",
36
"acquirer_data":{
37
"rrn":null
38
},
39
"created_at":1701688684,
40
"upi":{
41
"vpa":"failure@razorpay"
42
}
43
},
44
{
45
"id":"pay_N8FVRD1DzYzBh1",
46
"entity":"payment",
47
"amount":100,
48
"currency":"INR",
49
"status":"captured",
50
"order_id":"order_N8FRN5zTm5S3wx",
51
"invoice_id":null,
52
"international":false,
53
"method":"upi",
54
"amount_refunded":0,
55
"refund_status":null,
56
"captured":true,
57
"description":null,
58
"card_id":null,
59
"bank":null,
60
"wallet":null,
61
"vpa":"success@razorpay",
62
"email":"void@razorpay.com",
63
"contact":"+919999999999",
64
"notes":{
65
"notes_key_1":"Tea, Earl Grey, Hot",
66
"notes_key_2":"Tea, Earl Grey… decaf."
67
},
68
"fee":2,
69
"tax":0,
70
"error_code":null,
71
"error_description":null,
72
"error_source":null,
73
"error_step":null,
74
"error_reason":null,
75
"acquirer_data":{
76
"rrn":"267567962619",
77
"upi_transaction_id":"F5B66C7C07CA6FEAD77E956DC2FC7ABE"
78
},
79
"created_at":1701688721,
80
"upi":{
81
"vpa":"success@razorpay"
82
}
83
}
84
]
85
}
Path Parameters
id

*

string

Unique identifier of the order for which the payments should be retrieved.

Response Parameters
id
string

Unique identifier of the payment.

entity
string

Indicates the type of entity.

amount
integer

The payment amount in currency subunits. For example, for an amount of ₹1.00 enter 100.

currency
string

The currency in which the payment is made.

status
string

The status of the payment. Possible values:

  • created
  • authorized
  • captured
  • refunded
  • failed

method
string

The payment method used for making the payment. Possible values:

  • card
  • netbanking
  • wallet
  • upi
  • emi

order_id
string

Order id, if provided. Know more about

.

description
string

Description of the payment, if any.

international
boolean

Indicates whether the payment is done via an international card or a domestic one.

refund_status
string

The refund status of the payment. Possible values:

  • null
  • partial
  • full

amount_refunded
integer

The amount refunded in currency subunits. For example, if amount_refunded = 100, it is equal to ₹1.00.

captured
boolean

Indicates if the payment is captured.

email
string

Customer email address used for the payment.

contact
string

Customer contact number used for the payment.

fee
integer

Fee (including tax) charged by us.

tax
integer

Tax charged for the payment.

error_code
string

Error that occurred during payment. For example, BAD_REQUEST_ERROR.

error_description
string

Description of the error that occurred during payment. For example, Payment processing failed because of incorrect OTP.

error_source
string

The point of failure. For example, customer.

error_step
string

The stage where the transaction failure occurred. The stages can vary depending on the payment method used to complete the transaction. For example, payment_authentication.

error_reason
string

The exact error reason. For example, incorrect_otp.

notes
json object

Contains user-defined fields, stored for reference purposes.

created_at
integer

Timestamp, in UNIX format, on which the payment was created.

card_id
string

The unique identifier of the card used by the customer to make the payment.

wallet
string

The name of the wallet used by the customer to make the payment. For example, payzapp.

acquirer_data
array

A dynamic array consisting of a unique reference numbers.

Show child parameters (3)

bank
string

The 4-character bank code which the customer's account is associated with. For example, UTIB for Axis Bank.

upi
object

Details of the UPI payment received. Applicable if method is upi.

Show child parameters (2)

vpa
string

The customer's VPA (Virtual Payment Address) or UPI id used to make the payment. For example, gauravkumar@exampleupi.

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 Payments for an Order

GET
/v1/orders/:id/payments

Click to copy

Use this endpoint to fetch all the payments made for an order. The response contains all the authorised or failed payments for that order.

Is this page helpful?

Path Parameters
id

*

string

Unique identifier of the order for which the payments should be retrieved.

Response Parameters
id
string

Unique identifier of the payment.

entity
string

Indicates the type of entity.

amount
integer

The payment amount in currency subunits. For example, for an amount of ₹1.00 enter 100.

currency
string

The currency in which the payment is made.

status
string

The status of the payment. Possible values:

  • created
  • authorized
  • captured
  • refunded
  • failed

method
string

The payment method used for making the payment. Possible values:

  • card
  • netbanking
  • wallet
  • upi
  • emi

order_id
string

Order id, if provided. Know more about

.

description
string

Description of the payment, if any.

international
boolean

Indicates whether the payment is done via an international card or a domestic one.

refund_status
string

The refund status of the payment. Possible values:

  • null
  • partial
  • full

amount_refunded
integer

The amount refunded in currency subunits. For example, if amount_refunded = 100, it is equal to ₹1.00.

captured
boolean

Indicates if the payment is captured.

email
string

Customer email address used for the payment.

contact
string

Customer contact number used for the payment.

fee
integer

Fee (including tax) charged by us.

tax
integer

Tax charged for the payment.

error_code
string

Error that occurred during payment. For example, BAD_REQUEST_ERROR.

error_description
string

Description of the error that occurred during payment. For example, Payment processing failed because of incorrect OTP.

error_source
string

The point of failure. For example, customer.

error_step
string

The stage where the transaction failure occurred. The stages can vary depending on the payment method used to complete the transaction. For example, payment_authentication.

error_reason
string

The exact error reason. For example, incorrect_otp.

notes
json object

Contains user-defined fields, stored for reference purposes.

created_at
integer

Timestamp, in UNIX format, on which the payment was created.

card_id
string

The unique identifier of the card used by the customer to make the payment.

wallet
string

The name of the wallet used by the customer to make the payment. For example, payzapp.

acquirer_data
array

A dynamic array consisting of a unique reference numbers.

Show child parameters (3)

bank
string

The 4-character bank code which the customer's account is associated with. For example, UTIB for Axis Bank.

upi
object

Details of the UPI payment received. Applicable if method is upi.

Show child parameters (2)

vpa
string

The customer's VPA (Virtual Payment Address) or UPI id used to make the payment. For example, gauravkumar@exampleupi.

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
3
-X GET https://api.razorpay.com/v1/orders/order_DaaS6LOUAASb7Y/payments \

Success

Failure

1
{
2
"entity":"collection",
3
"count":2,
4
"items":[
5
{
6
"id":"pay_N8FUmetkCE2hZP",
7
"entity":"payment",
8
"amount":100,
9
"currency":"INR",
10
"status":"failed",
11
"order_id":"order_N8FRN5zTm5S3wx",
12
"invoice_id":null,
13
"international":false,
14
"method":"upi",
15
"amount_refunded":0,
16
"refund_status":null,
17
"captured":false,
18
"description":null,
19
"card_id":null,
20
"bank":null,
21
"wallet":null,
22
"vpa":"failure@razorpay",
23
"email":"void@razorpay.com",
24
"contact":"+919999999999",
25
"notes":{
26
"notes_key_1":"Tea, Earl Grey, Hot",
27
"notes_key_2":"Tea, Earl Grey… decaf."
28
},
29
"fee":null,
30
"tax":null,
31
"error_code":"BAD_REQUEST_ERROR",
32
"error_description":"Payment was unsuccessful due to a temporary issue. If amount got deducted, it will be refunded within 5-7 working days.",
33
"error_source":"gateway",
34
"error_step":"payment_response",
35
"error_reason":"payment_failed",
36
"acquirer_data":{
37
"rrn":null
38
},
39
"created_at":1701688684,
40
"upi":{
41
"vpa":"failure@razorpay"
42
}
43
},
44
{
45
"id":"pay_N8FVRD1DzYzBh1",
46
"entity":"payment",
47
"amount":100,
48
"currency":"INR",
49
"status":"captured",
50
"order_id":"order_N8FRN5zTm5S3wx",
51
"invoice_id":null,
52
"international":false,
53
"method":"upi",
54
"amount_refunded":0,
55
"refund_status":null,
56
"captured":true,
57
"description":null,
58
"card_id":null,
59
"bank":null,
60
"wallet":null,
61
"vpa":"success@razorpay",
62
"email":"void@razorpay.com",
63
"contact":"+919999999999",
64
"notes":{
65
"notes_key_1":"Tea, Earl Grey, Hot",
66
"notes_key_2":"Tea, Earl Grey… decaf."
67
},
68
"fee":2,
69
"tax":0,
70
"error_code":null,
71
"error_description":null,
72
"error_source":null,
73
"error_step":null,
74
"error_reason":null,
75
"acquirer_data":{
76
"rrn":"267567962619",
77
"upi_transaction_id":"F5B66C7C07CA6FEAD77E956DC2FC7ABE"
78
},
79
"created_at":1701688721,
80
"upi":{
81
"vpa":"success@razorpay"
82
}
83
}
84
]
85
}