Solar Proof API Documentation - Create Customer

 

 

API > Customers > Create Customer

POST http://localhost/apidata.php?api_key=17eca4408560ac218adef09fa710647ccde4&action=createcustomer

Create a new customer.

Parameters
data (JSON Object) A JSON object containing the following keys:
  • apikey (string): Your API key.
  • action (string): "createcustomer"
  • useremail (string): The email of the user to whom the customer belongs.
  • firstname (string): The first name of the customer.
  • surname (string): The surname of the customer.
  • email (string): The email of the customer.
  • phone1 (string): The primary phone number for the customer.
  • phone2 (string): The secondary phone number for the customer.
  • companyname (string): The company name for the customer's business (if any).
  • companyphone (string): The phone number for the customer's company.
  • type (string): The type of customer - either 'Commercial' or 'Residential'.
  • gststatus (integer): GST status of the customer (e.g., 1 for active).
200 (Success) Returns
Message (string) { "Message": "Customer created successfully!", "id": "79459" }
Non-200 (Error) Returns

Details of the error:

code (string) The error code.
message (string) A description of the error.
Example Request

{
    "data": {
        "apikey": "17eca4408560ac218adef09fa710647ccde4",
        "useremail": "",
        "firstname": "Vishal_20_01",
        "surname": "B",
        "phone1": "9876543210",
        "phone2": "9876543210",
        "email": "vishal_20_01@example.com",
        "gststatus": 1,
        "companyname": "vishal_20_01",
        "companyphone": "1234567890",
        "type": "RESIDENTIAL",
        "action": "createcustomer"
    }
}
Example Response
{
    "Message": "Customer created successfully!"
}