Fetch All Orders (With Expanded Card Payments)
GET/v1/orders?expand[]=payments.cardClick 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?
1curl -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": "",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": "",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": "0153",37"network": "Visa",38"type": "debit",39"issuer": null,40"international": false,41"emi": false,42"sub_type": "consumer",43"token_iin": null44},45"bank": null,46"wallet": null,47"vpa": null,48"email": "gaurav.kumar@example.com",49"contact": "+919876543210",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": 169631895862}63]64},65"offer_id": null,66"status": "paid",67"attempts": 1,68"notes": [],69"created_at": 169631892970}71]72}
Query Parameters
expand[]=payments.card stringUse to expand the card payments made for an order.
Response Parameters
idstringThe unique identifier of the order.
entitystring Name of the entity. Here, it is order.
amountinteger The amount for which the order was created, in currency subunits. For example, for an amount of ₹295.00, enter 29500.
amount_paidintegerThe amount paid against the order.
amount_dueintegerThe amount pending against the order.
currency *
stringISO code for the currency in which you want to accept the payment. The default length is 3 characters.
receiptstringReceipt number that corresponds to this order. Can have a maximum length of 40 characters and has to be unique.
statusstringThe status of the order. Possible values:
created: When you create an order it is in thecreatedstate. It stays in this state till a payment is attempted on it.attempted: An order moves fromcreatedtoattemptedstate when a payment is first attempted on it. It remains in theattemptedstate till one payment associated with that order is captured.paid: After the successful capture of the payment, the order moves to thepaidstate. No further payment requests are permitted once the order moves to thepaidstate. The order stays in thepaidstate even if the payment associated with the order is refunded.
attemptsintegerThe number of payment attempts, successful and failed, that have been made against this order.
notesjson 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_atintegerIndicates the Unix timestamp when this order was created.
paymentsobjectDetails of the payment.
Show child parameters (30)
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.cardClick 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 stringUse to expand the card payments made for an order.
Response Parameters
idstringThe unique identifier of the order.
entitystring Name of the entity. Here, it is order.
amountinteger The amount for which the order was created, in currency subunits. For example, for an amount of ₹295.00, enter 29500.
amount_paidintegerThe amount paid against the order.
amount_dueintegerThe amount pending against the order.
currency *
stringISO code for the currency in which you want to accept the payment. The default length is 3 characters.
receiptstringReceipt number that corresponds to this order. Can have a maximum length of 40 characters and has to be unique.
statusstringThe status of the order. Possible values:
created: When you create an order it is in thecreatedstate. It stays in this state till a payment is attempted on it.attempted: An order moves fromcreatedtoattemptedstate when a payment is first attempted on it. It remains in theattemptedstate till one payment associated with that order is captured.paid: After the successful capture of the payment, the order moves to thepaidstate. No further payment requests are permitted once the order moves to thepaidstate. The order stays in thepaidstate even if the payment associated with the order is refunded.
attemptsintegerThe number of payment attempts, successful and failed, that have been made against this order.
notesjson 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_atintegerIndicates the Unix timestamp when this order was created.
paymentsobjectDetails of the payment.
Show child parameters (30)
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
1curl -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": "",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": "",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": "0153",37"network": "Visa",38"type": "debit",39"issuer": null,40"international": false,41"emi": false,42"sub_type": "consumer",43"token_iin": null44},45"bank": null,46"wallet": null,47"vpa": null,48"email": "gaurav.kumar@example.com",49"contact": "+919876543210",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": 169631895862}63]64},65"offer_id": null,66"status": "paid",67"attempts": 1,68"notes": [],69"created_at": 169631892970}71]72}