notes

notes.find

Returns all the notes of a document.

JS
CR.api('commerce.notes.find', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.notes.find

request

{
  "conditions" : { // conditions:
    "type" : "customer", // type of document, can be "Customer", "Order", "Quote", "Invoice", "Receipt" or "PackingSlip" (required) - string
    "documents" : [ "5016275026597721493", … ], // documents (id) - bigint(1…)
  },
  "fields" : [ "id", "type", "document", … ] // fields to return
  "order" : [ "id", … ], // sort order of returned notes, can contain "id", "-id", "type", "-type", "document", "-document",
                         // "time" and "-time" - string
  "limit" : 10, // maximum number of notes to return - int(1…100)
  "first" : 0 // index of the first note to return - int(0…)
}

response

{
  "status" : "ok",
  "notes" : [ {
    "id" : 39821, // identifier - int(1…)
    "type" : "Customer", // type, can be "Customer", "Order", "Quote", "Invoice", "Receipt" or "PackingSlip" - string
    "document" : "5016275026597721493", // document (ID) to which the note refers - bigint(1…)
    "time" : "2013-09-15 14:55:34", // date and time - datetime
    "text" : "Confirmation email has been sent" // text - string(0…1200)
  }, … ]
}

notes.count

Number of notes that meet the given conditions.

JS
CR.api('commerce.notes.count', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.notes.count

request

{
  "conditions" : { // conditions:
    "type" : "customer", // type of document, can be "Customer", "Order", "Quote", "Invoice", "Receipt" or "PackingSlip" (required) - string
    "documents" : [ "5016275026597721493", … ], // documents (id) - bigint(1…)
  }
}

response

{
  "status" : "ok",
  "count" : 173 // number of notes - int(1…)
}

notes.create

Creates a new note for a document.

JS
CR.api('commerce.notes.create', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.notes.create

request

{
  "note" : { // note to create (required)
    "type" : "Customer", // type of document, can be "Customer", "Order", "Quote", "Invoice", "Receipt" or "PackingSlip" (required) - string
    "document" : "5016275026597721493", // document (id) to which the note refers (required) - bigint(1…)
    "time" : "2013-09-15 14:55:34", // date and time - datetime
    "text" : "Email has been sent" // text - string(0…1200)
  }
}

response

{
  "status" : "ok",
  "id" : 60913 // identifier of the new note - int(1…)
}

Errors

Field Type Description
document NotFound Document <document> of type '<type>' does not exist
document LimitReached Document <document> of type '<type>' has already 100 notes

notes.update

Updates a note of a document. Any fields left out of the request will remain unchanged.

JS
CR.api('commerce.notes.update', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.notes.update

request

{
  "id" : 90471, // identifier of the note to update (required) - int(1…)
  "note" : { // note's fields to update (required)
    "time" : "2013-09-15 14:55:34", // date and time - datetime
    "text" : "Email has been sent" // text - string(0…1200)
  }
}

response

{
  "status" : "ok"
}

Errors

Field Type Description
document NotFound Document <document> of type <type> does not exist
time InvalidValue Time '<time>' is in the future
time NotFound Note with time '<time>' does not exist
time AlreadyExists Note with time '<time>' already exists

notes.delete

Deletes one o more notes of a document.

JS
CR.api('commerce.notes.delete', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.notes.delete

request

{
  "ids" : [ 90471, 7002, … ] // identifiers of the notes to delete (required) - int(1…)
}

response

{
  "status" : "ok"
}

Errors

Field Type Description
document NotFound Document <document> of type '<type>' does not exist
times InvalidValue Time '<time>' is in the future