Update Order API
The Update order API will allow us in updating the already added order against the customer in the system.
Update 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 updated 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": "23518265",
"assign_emp_name": "",
"assign_emp_code": "",
"assign_emp_email": "",
"delivery_status": "",
"erp_order_id": "",
"erp_invoice_no": "",
"create_date": "",
"remarks": "testing 2345",
"invoice_no": "3141341",
"invoice_date": "",
"unit_name": "",
"block_name": "",
"ticket_id": "",
"encryptOrder": "",
"payment_mode": "",
"dealDetails": "",
"associate_fields": {},
"update": 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 Updated successfully !",
"Order": {
"result": true,
"customer_id": 191696570,
"enquiry_id": 24284719,
"action": "ORDER",
"action_event": "ORDER_FIELD_UPDATION",
"contact_id": 210006001
}
}
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": "23518265",
"assign_emp_name": "",
"assign_emp_code": "",
"assign_emp_email": "",
"delivery_status": "",
"erp_order_id": "",
"erp_invoice_no": "",
"create_date": "",
"remarks": "testing 2345",
"invoice_no": "3141341",
"invoice_date": "",
"unit_name": "",
"block_name": "",
"ticket_id": "",
"encryptOrder": "",
"payment_mode": "",
"dealDetails": "",
"associate_fields": {},
"update": true
}
}'
import requests
import json
url = "https://devapi.kapturecrm.com/ms/customer/order/api/v1/add-update"
payload = json.dumps({
"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": "23518265",
"assign_emp_name": "",
"assign_emp_code": "",
"assign_emp_email": "",
"delivery_status": "",
"erp_order_id": "",
"erp_invoice_no": "",
"create_date": "",
"remarks": "testing 2345",
"invoice_no": "3141341",
"invoice_date": "",
"unit_name": "",
"block_name": "",
"ticket_id": "",
"encryptOrder": "",
"payment_mode": "",
"dealDetails": "",
"associate_fields": {},
"update": True
}
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Basic <Your Token>',
'Cookie': 'JSESSIONID=; _KAPTURECRM_SESSION='
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://devapi.kapturecrm.com/ms/customer/order/api/v1/add-update',
'headers': {
'Content-Type': 'application/json',
'Authorization': 'Basic <Your Token>',
'Cookie': 'JSESSIONID=; _KAPTURECRM_SESSION='
},
body: JSON.stringify({
"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": "23518265",
"assign_emp_name": "",
"assign_emp_code": "",
"assign_emp_email": "",
"delivery_status": "",
"erp_order_id": "",
"erp_invoice_no": "",
"create_date": "",
"remarks": "testing 2345",
"invoice_no": "3141341",
"invoice_date": "",
"unit_name": "",
"block_name": "",
"ticket_id": "",
"encryptOrder": "",
"payment_mode": "",
"dealDetails": "",
"associate_fields": {},
"update": true
}
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Last updated