Add New Estimates

POST/api/estimates

Headers

FieldTypeDescription
authtoken String Authentication token, generated from admin area

Parameters

FieldTypeDescription
clientid Number Mandatory. Customer id
number Number Mandatory. Estimates Number
date Date Mandatory. Estimates Date
duedate Date optional Optional. Expiry Date of Estimates
currency Number Mandatory. currency field
newitems Array Mandatory. New Items to be added
subtotal Decimal Mandatory. calculation based on item Qty, Rate and Tax
total Decimal Mandatory. calculation based on subtotal, Discount and Adjustment
billing_street String Optional. Street Address
billing_city String optional Optional. City Name for billing
billing_state String optional Optional. Name of state for billing
billing_zip Number optional Optional. Zip code
billing_country Number optional Optional. Country code
shipping_street String optional Optional. Address of shipping
shipping_city String optional Optional. City name for shipping
shipping_state String optional Optional. Name of state for shipping
shipping_zip Number optional Optional. Zip code for shipping
shipping_country Number optional Optional. Country code
tags String optional Optional. TAGS comma separated
status Number optional Optional. Status id (default status is Accepted)
Reference String optional Optional. Reference name
sale_agent Number optional Optional. Sale Agent name
adminnote String optional Optional. notes by admin
clientnote String optional Optional. client notes
terms String optional Optional. Terms
curl -X POST "https://yoursite.com/api/estimates" \
  -H "authtoken: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "clientid": "...", "number": "...", "date": "...", "currency": "...", "newitems": "...", "subtotal": "...", "total": "...", "billing_street": "..." }'

Success-Response:

HTTP/1.1 200 OK
{
  "status": true,
  "message": "Estimates Added Successfully"
}

Error-Response:

HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "Estimates Add Fail"
}

Error-Response:

    HTTP/1.1 409 Conflict
    {
      "status": false,
      "error": {
			"number":"The Estimates number is already in use"
		},
		"message": "The Estimates number is already in use"
    }

Error-Response:

  HTTP/1.1 404 Not Found
   {
	    "status": false,
	    "error": {
	        "newitems[]": "The Items field is required"
	    },
	    "message": "<p>The Items field is required</p>\n"
	}

Error-Response:

  HTTP/1.1 404 Not Found
   {
	    "status": false,
	    "error": {
	        "subtotal": "The Sub Total field is required"
	    },
	    "message": "<p>The Sub Total field is required</p>\n"
	}

Error-Response:

  HTTP/1.1 404 Not Found
   {
	    "status": false,
	    "error": {
	        "total": "The Total field is required"
	    },
	    "message": "<p>The Total field is required</p>\n"
	}
MethodPOST
Path/api/estimates
GroupEstimates
Sincev0.3.0
Defined inmodules/api/controllers/Estimates.php