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":"MYR",
10
"status":"failed",
11
"order_id":"order_N8FRN5zTm5S3wx",
12
"invoice_id":null,
13
"international":false,
14
"method":"fpx",
15
"amount_refunded":0,
16
"refund_status":null,
17
"captured":false,
18
"description":null,
19
"card_id":null,
20
"bank":"HSBC",
21
"wallet":null,
22
"email":"nur.aisyah@example.com",
23
"contact":"+6026901125",
24
"notes":{
25
"notes_key_1":"Tea, Earl Grey, Hot",
26
"notes_key_2":"Tea, Earl Grey… decaf."
27
},
28
"fee":null,
29
"tax":null,
30
"error_code":"BAD_REQUEST_ERROR",
31
"error_description":"Payment was unsuccessful due to a temporary issue. If amount got deducted, it will be refunded within 5-7 working days.",
32
"error_source":"gateway",
33
"error_step":"payment_response",
34
"error_reason":"payment_failed",
35
"acquirer_data":{
36
"auth_code":null
37
},
38
"created_at":1701688684
39
},
40
{
41
"id":"pay_N8FVRD1DzYzBh1",
42
"entity":"payment",
43
"amount":100,
44
"currency":"MYR",
45
"status":"captured",
46
"order_id":"order_N8FRN5zTm5S3wx",
47
"invoice_id":null,
48
"international":false,
49
"method":"fpx",
50
"amount_refunded":0,
51
"refund_status":null,
52
"captured":true,
53
"description":null,
54
"card_id":null,
55
"bank":"HSBC",
56
"wallet":null,
57
"email":"siti.aisyah@example.com",
58
"contact":"+6026901126",
59
"notes":{
60
"notes_key_1":"Tea, Earl Grey, Hot",
61
"notes_key_2":"Tea, Earl Grey… decaf."
62
},
63
"fee":2,
64
"tax":0,
65
"error_code":null,
66
"error_description":null,
67
"error_source":null,
68
"error_step":null,
69
"error_reason":null,
70
"acquirer_data":{
71
"auth_code":null
72
},
73
"created_at":1701688721
74
}
75
]
76
}
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 MYR 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
  • wallet
  • fpx

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

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 MYR 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
  • wallet
  • fpx

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

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":"MYR",
10
"status":"failed",
11
"order_id":"order_N8FRN5zTm5S3wx",
12
"invoice_id":null,
13
"international":false,
14
"method":"fpx",
15
"amount_refunded":0,
16
"refund_status":null,
17
"captured":false,
18
"description":null,
19
"card_id":null,
20
"bank":"HSBC",
21
"wallet":null,
22
"email":"nur.aisyah@example.com",
23
"contact":"+6026901125",
24
"notes":{
25
"notes_key_1":"Tea, Earl Grey, Hot",
26
"notes_key_2":"Tea, Earl Grey… decaf."
27
},
28
"fee":null,
29
"tax":null,
30
"error_code":"BAD_REQUEST_ERROR",
31
"error_description":"Payment was unsuccessful due to a temporary issue. If amount got deducted, it will be refunded within 5-7 working days.",
32
"error_source":"gateway",
33
"error_step":"payment_response",
34
"error_reason":"payment_failed",
35
"acquirer_data":{
36
"auth_code":null
37
},
38
"created_at":1701688684
39
},
40
{
41
"id":"pay_N8FVRD1DzYzBh1",
42
"entity":"payment",
43
"amount":100,
44
"currency":"MYR",
45
"status":"captured",
46
"order_id":"order_N8FRN5zTm5S3wx",
47
"invoice_id":null,
48
"international":false,
49
"method":"fpx",
50
"amount_refunded":0,
51
"refund_status":null,
52
"captured":true,
53
"description":null,
54
"card_id":null,
55
"bank":"HSBC",
56
"wallet":null,
57
"email":"siti.aisyah@example.com",
58
"contact":"+6026901126",
59
"notes":{
60
"notes_key_1":"Tea, Earl Grey, Hot",
61
"notes_key_2":"Tea, Earl Grey… decaf."
62
},
63
"fee":2,
64
"tax":0,
65
"error_code":null,
66
"error_description":null,
67
"error_source":null,
68
"error_step":null,
69
"error_reason":null,
70
"acquirer_data":{
71
"auth_code":null
72
},
73
"created_at":1701688721
74
}
75
]
76
}