Skip to main content

Prerequisites

  1. 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.
  2. 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
When the customer makes a first-time payment, the created 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 created customer_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: /payments

Path 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