Hey! These docs are for version 3.2, which is no longer officially supported. Click here for the latest version, 1.0!

Create Customer

Creates a new customer object with the given Customer Data parameters. You may invoke this method whenever someone registers in your website or App. JusPay will respond with a customer_id that you can persist in your Database. Pass this ID at the time of order creation to ensure proper linking of orders/payments belonging to a customer.

  Returns:   Customer Object         (click to view)
FieldTypeDescription
customer_idStringCustomer ID generated by JUSPAY.
objectStringObject type of entity, in this case it’ll be customer.
object_reference_idStringCustomer ID defined by you.
mobile_numberStringCustomer’s mobile number.
date_createdStringDate creation of customer entity.
last_udpatedStringLast updated date of customer entity.
email_addressStringCustomer’s e-mail address.
first_nameStringCustomer’s first name.
last_nameStringCustomer’s last name.
mobile_country_codewwwwiStringMobile country code.

juspay: {
    client_auth_token,
    client_auth_token_expiry}

Object
String
String
Object containing two client_auth_token parameters
Token required for SDK integration
Expiration date of  client_auth_token
Note 1:
A "customer_id" should be returned, not "id", as shown in the main document.
Note 2:
A Juspay Object (client_auth_token parameters) is included in the Customer Object response for the Create Customer API only if  options.get_client_auth_token is set to true in the request .
The request consists of Customer Data, merchant_id, object_reference_id, and an optional  get_client_auth_token parameter.
(click to open table)       Each parameter in tables is listed below:
  Customer Data parameters:       (click to view)
FieldTypeDescription
mobile_number*StringCustomer’s mobile number.wwwwwwwwww
email_address*StringCustomer’s e-mail address.
first_nameStringCustomer’s first name.
last_nameStringCustomer’s last name.
mobile_country_codeStringMobile country code. No need to prefix “+”.
* = Required only for the Create Customer API
FieldTypeDescription
x-merchantid*StringThe merchant id that a merchant hold at Juspay. Must be in Header.
object_reference_idwwwi*StringUnique ID that you use to represent the customer in your database. This must be atleast 8 characters and must be unique. The typical value for this field would be email address or mobile number or auto increment ID that you have in your DB
options.
    get_client_auth_token
Object
Boolean
This is required to obtain the client_auth_token which is used for SDK integration
 * = Required
Language
Authentication
Basic
base64
:
Click Try It! to start a request and see the response here!