Add Order API

The add order API will allow us in adding the order against the customer in the system.

Add Order.

POST https://<sub domain>.kapturecrm.com/ms/customer/order/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 user name and password in the Authorization header. For authentication, use the following header, which will help you generate your Basic Auth token:

Basic <Your Token>

Request Body

The request body should be a JSON object containing the details of the customer against which the order needs to be added along with the order details. Here are the list of parameters.

{
    "customer_info": {
        "customer_name": "ABC",
        "phone": "9380491257",
        "email_id": "abc@abc.min",
        "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": "9380491257",
            "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"
    },
    "order_info": {
        "order_id": "",
        "assign_emp_name": "",
        "assign_emp_code": "",
        "assign_emp_email": "",
        "delivery_status": "",
        "erp_order_id": "",
        "erp_invoice_no": "",
        "create_date": "",
        "remarks": "testing",
        "invoice_no": "",
        "invoice_date": "",
        "unit_name": "",
        "block_name": "",
        "ticket_id": "",
        "encryptOrder": "",
        "payment_mode": "",
        "dealDetails": "",
        "associate_fields": {},
        "update": false //If we need to update the existing order against the customer please change the flag to true
    }
}

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 added order against the customer. If successful, the response will include the customer ID, order ID and the other relevant information.

{
    "status": "success",
    "message": "Order Added successfully !",
    "Order": {
        "result": true,
        "order_id": 23518265,
        "customer_id": 191696570,
        "enquiry_id": 24284201,
        "action": "ORDER",
        "action_event": "ADD_ORDER",
        "contact_id": 210010451
    }
}

Error Codes

Example of a working curl

curl --location 'https://devapi.kapturecrm.com/ms/customer/order/api/v1/add-update' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <Your Token>' \
--header 'Cookie: JSESSIONID=; _KAPTURECRM_SESSION=' \
--data-raw '{
    "customer_info": {
        "customer_name": "ABC",
        "phone": "9380491257",
        "email_id": "abc@abc.min",
        "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": "9380491257",
            "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"
    },
    "order_info": {
        "order_id": "",
        "assign_emp_name": "",
        "assign_emp_code": "",
        "assign_emp_email": "",
        "delivery_status": "",
        "erp_order_id": "",
        "erp_invoice_no": "",
        "create_date": "",
        "remarks": "testing",
        "invoice_no": "",
        "invoice_date": "",
        "unit_name": "",
        "block_name": "",
        "ticket_id": "",
        "encryptOrder": "",
        "payment_mode": "",
        "dealDetails": "",
        "associate_fields": {},
        "update": false
    }
}'

Last updated