Kapture API
  • Welcome!
  • Reference
    • API Reference
      • Add Ticket API
      • Update Ticket API
      • Get Ticket API
      • Pull Ticket API by Date Range
      • Add Customer API
      • Update Customer API
      • Get Customer API
      • Pull Customer API by Date Range
      • Add Order API
      • Update Order API
      • Pull Order API
      • Get FAQ Content API
      • Get FAQ Category API
      • Search FAQ Content API
Powered by GitBook
On this page
  • Update Order.
  • Authentication:
  • Request Body
  • Response Body
  • Error Codes
  • Example of a working curl

Was this helpful?

  1. Reference
  2. API Reference

Update Order API

The Update order API will allow us in updating the already added order against the customer in the system.

PreviousAdd Order APINextPull Order API

Last updated 1 year ago

Was this helpful?

Update Order.

POST

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.

Name
Mandatory
Type
Description

customer_name

Yes

Date

Indicates the name of the customer exisiting in the System.

order_id

Yes

Number

Kapture generated unique order id against which the update of information is needed.

{
    "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.

Response
Response Messages

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

List of customers fetched successfully.

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

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

{
    "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

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/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);
});

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