Empoweing blinds industry

Did You Know?

Customer

This domain serves for requests for customer management.

Create Customer

POSTThis API call creates a new customer entry in the database. Finally returning an array containing the ID and number of the newly created customer.

Request Paramters
stringdomain Value should be customer Required
stringaction Value should be create Required
objectdata Contains input parameters. Required
stringc_contact_name The contact name of the customer. Required
stringc_name_1 The first part of the customer name. Required
stringc_name_2 The second part of the customer name. Optional
stringc_address_1 The first line of the customer's address. Required
stringc_address_2 The second line of the customer's address. Optional
stringc_suburb The suburb of the customer's address. Required
stringc_postcode The postcode of the customer's address. Required
stringc_email The email address of the customer. Required
stringc_phone The phone number of the customer. Required
stringc_mobile The mobile number of the customer. Required
intc_discount The discount percentage for the customer. Optional
stringc_method The method of interaction with the customer (e.g., online, offline). Required
stringc_notes Any notes related to the customer. Optional
Sample Request Body
            
            {
                domain: "customer",
                action: "create",
                data: {
                    c_contact_name: "John Doe",
                    c_name_1: "TEST ABC",
                    c_name_2: "Department XYZ",
                    c_address_1: "123 Main Street",
                    c_address_2: "Apt 456",
                    c_suburb: "Anytown",
                    c_postcode: "12345",
                    c_email: "john.doe@example.com",
                    c_phone: "123-456-7890",
                    c_mobile: "987-654-3210",
                    c_discount: 0,
                    c_method: "online",
                    c_notes: "Some notes about the customer"
                }
            }
            
        
Response Paramters
stringstatus This indicate the status of the response. success is the expected value.
stringmessage This explains the reson for status.
objectdata This contain result data object of the API call.
stringid Created customers's ID
stringno Created customers's Customer Number
Sample Response
            
            {
                status: "success",
                data: {
                    status: "success",
                    message: "Customer Created",
                    data: {
                        id: 78,
                        no: "C240048"
                    }
                }
            }
            
        

Update Customer

POSTUpdates the details of an existing customer in the database. This function updates the specified customer's information in the database with the provided details.

Request Paramters
stringdomain Value should be customer Required
stringaction Value should be update Required
objectdata Contains input parameters. Required
intcustomer_id ID of the customer to be updated. Required
stringc_contact_name Contact name of the customer. Required
stringc_name_1 First name or business name of the customer. Required
stringc_name_2 Second name or department of the customer. Optional
stringc_address_1 Primary address line of the customer. Required
stringc_address_2 Secondary address line of the customer. Optional
stringc_suburb Suburb of the customer. Required
stringc_postcode Postcode of the customer. Required
stringc_email Email address of the customer. Required
stringc_phone Phone number of the customer. Required
stringc_mobile Mobile number of the customer. Required
intc_discount Discount value for the customer. Optional
stringc_method Method of customer interaction. Required
stringc_notes Notes regarding the customer. Optional
Sample Request Body
            
            {
                domain: "customer",
                action: "update",
                data: {
                    customer_id: 75,
                    c_contact_name: "John DoeUPD",
                    c_name_1: "TEST ABC UPDATED",
                    c_name_2: "Department XYZ UPDATED",
                    c_address_1: "123 Main Street",
                    c_address_2: "Apt 456",
                    c_suburb: "Anytown Updated",
                    c_postcode: "12345",
                    c_email: "john.doe@example.com",
                    c_phone: "123-456-7890",
                    c_mobile: "987-654-3210",
                    c_discount: 0,
                    c_method: "online",
                    c_notes: "Some notes about the UPDATE"
                }
            }
            
        
Response Paramters
stringstatus This indicate the status of the response. success is the expected value.
stringmessage This explains the reson for status.
objectdata This contain result data object of the API call.
intdata Number of affected records. expeted: 1
Sample Response
            
            {
                status: "success",
                data: {
                    status: "success",
                    message: "Customer Updated",
                    data: 1
                }
            }
            
        

Read Customer

POSTRetrieves the details of a specific customer from the database based on the provided customer ID. If the customer is found, it returns the customer's details; otherwise, it returns a message indicating that no data was found.

Request Paramters
stringdomain Value should be customer Required
stringaction Value should be read Required
objectdata Contains input parameters. Required
intcustomer_id ID of the customer to be retrieved. Required
Sample Request Body
            
            {
                domain: "customer",
                action: "read",
                data: {
                    customer_id: 75
                }
            }
            
        
Response Paramters
stringstatus This indicate the status of the response. success is the expected value.
stringmessage This explains the reson for status.
objectdata This contain result data object of the API call.
intid The unique identifier for the customer record.
stringcustomer_no The customer number associated with the customer.
stringc_contact_name The contact name of the customer.
stringc_name_1 The first part of the customer name.
stringc_name_2 The second part of the customer name.
stringc_address_1 The first line of the customer's address.
stringc_address_2 The second line of the customer's address.
stringc_suburb The suburb of the customer's address.
stringc_postcode The postcode of the customer's address.
stringc_email The email address of the customer.
stringc_phone The phone number of the customer.
stringc_mobile The mobile number of the customer.
intc_discount The discount percentage for the customer.
stringc_method The method of interaction with the customer (e.g., online, offline).
stringc_notes Any notes related to the customer.
stringcreated_date The date and time when the customer record was created.
stringlast_updated_by The name of the user who last updated the customer record.
stringlast_updated_date The date and time when the customer record was last updated.
stringsubmitted_by The name of the user who submitted the customer record.
intuser_id The user ID associated with the customer record.
Sample Response
            
            {
                status: "success",
                data: {
                    id: 75,
                    customer_no: "C240048",
                    c_contact_name: "John Doe",
                    c_name_1: "TEST ABC",
                    c_name_2: "Department XYZ",
                    c_address_1: "123 Main Street",
                    c_address_2: "Apt 456",
                    c_suburb: "Anytown",
                    c_postcode: "12345",
                    c_email: "john.doe@example.com",
                    c_phone: "123-456-7890",
                    c_mobile: "987-654-3210",
                    c_discount: 0,
                    c_method: "online",
                    c_notes: "Some notes about the customer",
                    created_date: "2024-05-30 12:34:56",
                    last_updated_by: "Admin",
                    last_updated_date: "2024-05-30 12:34:56",
                    submitted_by: "Admin",
                    user_id: 69
                }
            }
            
        

Delete Customer

POSTThis action deletes customerDeletes a customer and all related data including quotes, quote attachments, and story attachments.

Request Paramters
stringdomain Value should be customer Required
stringaction Value should be delete Required
objectdata Contains input parameters. Required
intuser_id The ID of the user requesting the deletion. Required
intcustomer_id ID of the customer to be retrieved. Required
Sample Request Body
            
            {
                domain: "customer",
                action: "delete",
                data: {
                    user_id: 69,
                    customer_id: 75
                }
            }
            
        
Response Paramters
stringstatus This indicate the status of the response. success is the expected value.
stringmessage This explains the reson for status.
objectdata This contain result data object of the API call.
Sample Response
            
            {
                status: "success",
                data: {
                    status: "success",
                    message: "Customer Deleted",
                    data: null
                }
            }
            
        

Read All Customers

POSTThis request is to get list of customes that maches to given filtersRetrieves a list of customers based on specified date range, if provided.

Request Paramters
stringdomain Value should be customer Required
stringaction Value should be read_all Required
objectdata Contains input parameters. Required
stringdate_from The start date of the date range for filtering customers. Optional
stringdate_to The end date of the date range for filtering customers. Optional
Sample Request Body
            
            {
                domain: "customer",
                action: "read_all",
                data: {
                    date_from: "",
                    date_to: ""
                }
            }
            
        
Response Paramters
stringstatus This indicate the status of the response. success is the expected value.
stringmessage This explains the reson for status.
listdata This contain list of result data objects of the API call.
stringDT_RowId The ID of the row.
stringid The ID of the customer.
stringcreated_date The date when the customer was created.
stringc_contact_name The contact name of the customer.
stringcustomer_no The customer number.
stringc_name The concatenated first and last name of the customer.
stringc_name_1 The first name of the customer.
stringc_name_2 The last name of the customer.
stringc_address The concatenated address details of the customer.
stringc_address_1 The first line of the address.
stringc_address_2 The second line of the address.
stringc_suburb The suburb of the customer's address.
stringc_postcode The postcode of the customer's address.
stringc_method The method of communication with the customer.
stringc_notes Any notes associated with the customer.
stringc_email The email address of the customer.
stringc_phone The phone number of the customer.
stringc_mobile The mobile number of the customer.
stringlead_count The count of leads associated with the customer.
stringjob_count The count of jobs associated with the customer.
stringpo_count The count of purchase orders associated with the customer.
stringsubmitted_by The name of the user who submitted the customer.
stringsubmitted_user_id The ID of the user who submitted the customer.
stringassigned_staff The name of the staff assigned to the customer.
integerdelete_perm Indicates whether the current user has permission to delete the customer (1 for yes, 0 for no).
Sample Response
            
            {
                "status": "success",
                "data": {
                    "status": "success",
                    "message": "Customer Read all",
                    "data": {
                        "draw": 0,
                        "recordsTotal": 84,
                        "recordsFiltered": 84,
                        "data": [
                            {
                                "DT_RowId": "row_4",
                                "id": "4",
                                "created_date": "29 Feb 2024",
                                "c_contact_name": "John DoeUPD",
                                "customer_no": "C240004",
                                "c_name": "TEST ABC UPDATED Department XYZ UPDATED",
                                "c_name_1": "TEST ABC UPDATED",
                                "c_name_2": "Department XYZ UPDATED",
                                "c_address": "123 Main Street Apt 456 Anytown Updated 12345",
                                "c_address_1": "123 Main Street",
                                "c_address_2": "Apt 456",
                                "c_suburb": "Anytown Updated",
                                "c_postcode": "12345",
                                "c_method": "online",
                                "c_notes": "Some notes about the UPDATE",
                                "c_email": "john.doe@example.com",
                                "c_phone": "123-456-7890",
                                "c_mobile": "987-654-3210",
                                "lead_count": "4",
                                "job_count": "0",
                                "po_count": "0",
                                "submitted_by": "Madhawa",
                                "submitted_user_id": "8705",
                                "assigned_staff": " N/A",
                                "delete_perm": 1
                            },
                        ]
                    }
                }
            }    
            
        

Delete Customer

POSTThis action deletes customerDeletes a customer and all related data including quotes, quote attachments, and story attachments.

Request Paramters
stringdomain Value should be customer Required
stringaction Value should be get_customer_names Required
objectdata Contains input parameters. Required
intuser_id The ID of the user requesting the data. Required
Sample Request Body
            
            {
                domain: "customer",
                action: "get_customer_names",
                data: {
                    user_id: 69
                }
            }
            
        
Response Paramters
stringstatus This indicate the status of the response. success is the expected value.
stringmessage This explains the reson for status.
listdata This contain result data list of string customer names.
Sample Response
            
            {
                status: "success",
                data: {
                    status: "success",
                    message: "Customer Names Read",
                    data: [
                        "Jane",
                        "Jhon"
                    ]
                }
            }
            
        
API END POINTS