Add Customer API

The Add Customer API will help you in creating/adding customer in the Kapture Database.

Add Customer.

POST https://<sub domain>.kapturecrm.com/ms/customer/customer/api/v1/add-update

NOTE: Please replace with your sub domain name in the API.

Authentication:

To access this API endpoint, you need to include your API key in the request headers. For authentication, use the following header:

Basic <Your Token>

Request Body

The request body should be a JSON object containing the details of the customer to be added. Here are the list of parameters. Note:- Combination of name and phone or name and email is required to push customer data.

Name
Mandatory
Type
Description

name

Yes

Text

Name of the Customer

phone

Yes

Number

Phone Number of the customer

email

Yes

String

Email Address of the customer

contact_person_phone

Yes

Number

One of the contact info is needed among the email and phone inside the contact_info JSON

contact_person_email

Yes

String

One of the contact info is needed among the email and phone inside the contact_info JSON

{
    "customer_info": {
        "customer_name": "ABC",
        "phone": "9380491387",
        "email_id": "",
        "locality": "",
        "city": "",
        "state": "",
        "country": "India",
        "address": "jalsa",
        "type": "",
        "classification": "",
        "pincode": "",
        "customer_code": "",
        "customer_id": "",
        "customer_assign_emp_name": "",
        "customer_assign_emp_code": "",
        "customer_assign_emp_email": "",
        "zone": "",
        "customer_remarks": "",
        "individual": false,
        "organization": true,
        "channel_partner": false,
        "remarks": "testing",
        "primary_source": "",
        "secondary_source": "",
        "tertiary_source": "",
        "additional_fields": {},
        "associate_fields": {},
        "update": false
    },
    "contact_info": [
        {
            "contact_id": "",
            "title": "no",
            "first_name": "Sashankk",
            "last_name": "Goenkaaa",
            "contact_person_name": "",
            "country_code": "",
            "contact_person_phone": "9380491387",
            "contact_person_email": "",
            "additional_contact_phone": "",
            "dob": "",
            "gender": "Male",
            "update": false,
            "matchEmailPhone": false
        }
    ],
    "enquiry_info": {
        "enquiry_id": "",
        "assign_emp_name": "",
        "assign_emp_code": "",
        "assign_emp_email": "",
        "round_robin_key": "",
        "next_follow_up_date": "",
        "action": "",
        "subStatus": "",
        "additional_fields": {},
        "associate_fields": {},
        "update": false,
        "remarks": "testing"
    }
}

Please map in the request body if there's any extra associate body according to your use case.

Response Body

The API responds with a JSON object containing the details of the created customer. If successful, the response will include the customer ID and the other relevant information.

Response
Response Messages

{ ..., "status": "success"}

Customer data pushed successfully.

{"message": "Invalid Auth Key","status": "failed"}

Authorization key is either not passed in header, or incorrect, or expired/disabled

{"message": "Name, Email Id, and Phone Number required", "status": "failed"}

name and phone|email are either missing or empty in request body.

{
    "status": "success",
    "customer": {
        "result": true,
        "customer_id": 191690263,
        "action": "CUSTOMER",
        "action_event": "ADD_CUSTOMER",
        "contact_id": 210004093
    },
    "message": "Customer Added successfully !Contact Added successfully !"
}

Error Codes

Error Codes
Description

400

Bad Request - Invalid parameters or missing data

401

Unauthorized - Invalid or missing API key

403

Forbidden - Insufficient permissions

404

Not Found - Resource or endpoint not found

500

Internal Server Error - Server-side issue

Example of a working curl

curl --location 'https://devapi.kapturecrm.com/ms/customer/customer/api/v1/add-update' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <Your Token>' \
--header 'Cookie: JSESSIONID=; _KAPTURECRM_SESSION=' \
--data '{
    "customer_info": {
        "customer_name": "ABC",
        "phone": "9380491357",
        "email_id": "",
        "locality": "",
        "city": "",
        "state": "",
        "country": "India",
        "address": "jalsa",
        "type": "",
        "classification": "",
        "pincode": "",
        "customer_code": "",
        "customer_id": "",
        "customer_assign_emp_name": "",
        "customer_assign_emp_code": "",
        "customer_assign_emp_email": "",
        "zone": "",
        "customer_remarks": "",
        "individual": false,
        "organization": true,
        "channel_partner": false,
        "remarks": "testing",
        "primary_source": "",
        "secondary_source": "",
        "tertiary_source": "",
        "additional_fields": {},
        "associate_fields": {},
        "update": false
    },
    "contact_info": [
        {
            "contact_id": "",
            "title": "no",
            "first_name": "",
            "last_name": "",
            "contact_person_name": "",
            "country_code": "",
            "contact_person_phone": "9380491357",
            "contact_person_email": "",
            "additional_contact_phone": "",
            "dob": "",
            "gender": "Male",
            "update": false,
            "matchEmailPhone": false
        }
    ],
    "enquiry_info": {
        "enquiry_id": "",
        "assign_emp_name": "",
        "assign_emp_code": "",
        "assign_emp_email": "",
        "round_robin_key": "",
        "next_follow_up_date": "",
        "action": "",
        "subStatus": "",
        "additional_fields": {},
        "associate_fields": {},
        "update": false,
        "remarks": "testing"
    }
}'

Last updated