Uncategorized

VIEW Request: Create a customer

POST https://apisandbox.onepay.com/Customer

When a customer needs to be added to the vault, the customer object is called.

Sample Code


{  
   "customer":{  
      "first_name":"Rolling",
      "last_name":"Rocks Ventures",
      "street_1":"#602,Prestiege Atrium,Central Street",
      "street_2":"Near Shivajinagar Bus Stand",
      "city":"Bangalore",
      "state":"karnataka",
      "zip":"560001",
      "country":"India",
      "phone_number":"9972534105",
      "company":"Rolling Rocks Ventures US Ltd",
      "customer_id":"AUTO",
      "invoice_number":null,
      "email":"R2r@certifyglobal.com",
      "email_receipt":"YES",
      "notes":"Test Notes",
      "action_code":"1",
      "UserDefined1":"test1",
      "UserDefined2":null,
      "UserDefined3": "Note1"
   },
   "custom_fields":null,
   "card":{  
      "number":"4523536421558155",
      "code":null,
      "expiration_date":"0820",
      "type":"VI",
      "track_data":"",
      "action_code":"0",
      "default_card":"true",
      "token":null
   },
   "check":null
}

BODY

KEY VALUE DESCRIPTION
first_name string, up to 35 characters. (conditional)
First name associated with customer’s billing address.
Required only when using a European payment processor.
last_name string, up to 35 characters. (conditional)
Last name associated with customer’s billing address.
Required only when using a European payment processor.
If First name exists, Lastname also needs to be passed.
street_1 string, up to 30 characters. (optional)
The street address of the customer. This field is used to submit the street address of the cardholder when attempting to perform address verification.
street_2 string, up to 25 characters. If customer has street 2 information, it is saved on to Onepay's system
city string, up to 25 characters. If customer has city address information, it is saved on to Onepay's system
state string, up to 25 characters. If customer has state address information, it is saved on to Onepay's system
zip string, up to 9 characters. The postal or zip code of the cardholder. This field is used to submit the
postal code of the cardholder when attempting to perform address verification.
For American Express Verification transactions either this field or AVS/Billing
Address is required.
country string, up to 25 characters. If customer has country address information, it is saved on to Onepay's system
phone_number string, up to 15 characters. If customer has phone number contact information, it is saved on to Onepay's system
company string, up to 25 characters. If customer has company contact information, it is saved on to Onepay's system
customer_id alphanumeric, up to 50 characters. The customer ID is either system generated or user specific. Based on customer ID, customer's information is updated.
invoice_number string, up to 50 characters. authorized
amount string, up to 50 characters. The customer related transactions' invoice number.
email alphanumeric, up to 50 characters. Customer email address for any email receipt.
email_receipt boolean
0: False,
1: True.
Indicator to send email receipt to customer based onany acion.
notes string, up to 50 characters. Customer specific notes can be provided here for additional information regarding the transactions.
action_code numeric(1) Based on the action code, customer related updates can be performed.

  • 1 - Add customer - if Customer ID exists update(Always update/ Add new)
  • 2 - Add customer - if Customer ID exists do not update
  • 3 - Add customer - if Customer ID exists throw error. If nothing sent or invalid value no update or add.
check object object is present in transaction request
custom_fields object object is present in transaction request

Leave a Reply

Your email address will not be published. Required fields are marked *