Update a Credit Note

PUT/api/credit_notes

Headers

FieldTypeDescription
authtoken String Authentication token, generated from admin area

Parameters

FieldTypeDescription
clientid Number Mandatory. Customer id
date Date Mandatory. Credit Note Date
number Number Mandatory. Credit Note Number
currency Number Mandatory. currency field
newitems Array Mandatory. New Items to be added
items Array Mandatory. Existing items with Id
removed_items Array Optional. Items to be removed
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
discount_type String optional Optional. before_tax / after_tax discount type
Admin String optional Note] Optional. Admin Note
subtotal Decimal Mandatory. calculation based on item Qty, Rate and Tax
total Decimal Mandatory. calculation based on subtotal, Discount and
clientnote String optional Optional. client notes
terms String optional Optional. Terms
curl -X PUT "https://yoursite.com/api/credit_notes" \
  -H "authtoken: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "clientid": "...", "date": "...", "number": "...", "currency": "...", "newitems": "...", "items": "...", "removed_items": "...", "billing_street": "...", "subtotal": "...", "total": "..." }'

Success-Response:

HTTP/1.1 200 OK
{
  "status": true,
  "message": "Credit Note Updated Successfully"
}

Error-Response:

HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "Credit Note Update Fail"
}

Error-Response:

    HTTP/1.1 409 Conflict
    {
      "status": false,
      "error": {
			"number":"The Credit Note number is already in use"
		},
		"message": "The Credit Note 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"
	}
MethodPUT
Path/api/credit_notes
GroupCredit Notes
Sincev0.3.0
Defined inmodules/api/controllers/Credit_notes.php