Skip to main content
The customers endpoints let you create Razorpay customers, update their details, list and fetch customers, manage bank accounts, and handle saved tokens.

Create customer

POST /api/auth/razorpay/customer/create Creates a new Razorpay customer. Server API name: createCustomer
Client method: authClient.razorpay.customer.create(...)
string
Customer name.
string
Customer email address.
string
Customer phone number with country code.
boolean
Whether to fail if a customer with the same email or contact already exists.
string
Customer GSTIN for tax purposes.
object
Up to 15 key-value pairs for internal metadata.
Errors: UNABLE_TO_CREATE_CUSTOMER.

Edit customer

POST /api/auth/razorpay/customer/edit Updates an existing Razorpay customer. Server API name: editCustomer
Client method: authClient.razorpay.customer.edit(...)
string
required
Razorpay customer id.
string
Updated customer name.
string
Updated customer email.
string
Updated customer phone number.
string
Updated GSTIN.
object
Updated notes object.
Errors: CUSTOMER_EDIT_FAILED.

List customers

GET /api/auth/razorpay/customer/list Lists Razorpay customers with pagination. Server API name: listCustomers
Client method: authClient.razorpay.customer.list({ query: { ... } })
integer
Unix timestamp. Return customers created after this time.
integer
Unix timestamp. Return customers created before this time.
integer
Maximum number of customers to return. Maximum value is 100.
integer
Number of customers to skip.

Get customer

GET /api/auth/razorpay/customer/get Retrieves a single Razorpay customer by id. Server API name: fetchCustomer
Client method: authClient.razorpay.customer.get({ query: { customerId } })
string
required
Razorpay customer id.
Errors: CUSTOMER_NOT_FOUND.

Add bank account

POST /api/auth/razorpay/customer/bank-account Adds a bank account to an existing Razorpay customer. Server API name: addBankAccount
Client method: authClient.razorpay.customer.bankAccount.create(...)
string
required
Razorpay customer id.
string
required
IFSC code of the bank branch.
string
required
Bank account number.
string
Name of the account holder.
Errors: BANK_ACCOUNT_ADD_FAILED.

Delete bank account

POST /api/auth/razorpay/customer/bank-account/delete Deletes a bank account from a Razorpay customer. Server API name: deleteBankAccount
Client method: authClient.razorpay.customer.bankAccount.delete(...)
string
required
Razorpay customer id.
string
required
Bank account id to delete.
Errors: BANK_ACCOUNT_DELETE_FAILED.

Fetch tokens

GET /api/auth/razorpay/customer/tokens Lists saved tokens for a Razorpay customer. Server API name: fetchTokens
Client method: authClient.razorpay.customer.tokens({ query: { customerId } })
string
required
Razorpay customer id.
Errors: TOKEN_FETCH_FAILED.

Fetch token

GET /api/auth/razorpay/customer/token Retrieves a single saved token for a Razorpay customer. Server API name: fetchToken
Client method: authClient.razorpay.customer.token({ query: { customerId, tokenId } })
string
required
Razorpay customer id.
string
required
Token id.

Delete token

POST /api/auth/razorpay/customer/token/delete Deletes a saved token for a Razorpay customer. Server API name: deleteToken
Client method: authClient.razorpay.customer.token.delete(...)
string
required
Razorpay customer id.
string
required
Token id to delete.
Errors: TOKEN_DELETE_FAILED.