Prerequisites
- To fetch payments made by a customer, you must create and associate a customer with every payment. Create a new customer using the Customers API and store the customer ID at your end. This customer ID must be passed when the payment is made by the customer.
- Generate the API keys from the Dashboard for authenticating the API requests with Razorpay. Watch this animation to learn how to generate the API keys in the Dashboard.
Note
customer_id can be used for future payments made by the same customer.
Associate a Payment with a Customer
To associate the payment details to a specific customer, pass the createdcustomer_id to the Razorpay Checkout at the time of payment.
HTML
Fetch Payments by Customer ID
The following endpoint is used for retrieving a list of payments for a customer: /paymentsPath Parameters
customer_id string
: Unique identifier of the customer, which is passed to the Checkout form at the time of payment.
Query Parameters
from timestamp
: Timestamp, in seconds, at which the payments were created.
to timestamp
: Timestamp, in seconds, till which the payments were created.
count integer
: The number of payments to be fetched. Defaults to 10.
skip integer
: The number of payments to be skipped.
Example
Sample request