movements

movements.find

Returns the movement that meet the given conditions.

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

request

{
  "conditions" : { // returns only the movements …
    "sku" : "A927TP", // … with this item SKU - string(1…32)
    "fromCreationTime" : "2010-11-01 12:00:00", // … created after this date - datetime
    "toCreationTime" : "2010-01-31 23:59:59", // … created before this date - datetime
    "keywords" : "shirt" // … with these exact keywords - string(1…100)
  },
  "fields" : [ "id", "sku", … ], // fields to return - string
  "order" : [ "name" ], // sort order of returned movements, can contain "id", "-id", "sku", "-sku", "adjustment", "-adjustment",
                        // "creationTime", "-creationTime", "description", "-description" - string
  "limit" : 10, // maximum number of movements to return - int(1…100)
  "first" : 0 // index of the first movement to return - int(0…)
}

response

{
  "status" : "ok",
  "movements" : [ {
    "id" : 58913, // identifier - int(1…)
    "sku" : "A927TP", // item SKU - string(1…32)
    "adjustment" : "-5.00", // adjustment of the quantity in stock - decimal[11,2]
    "creationTime" : "2013-08-01 12:34:50", // creation time - datetime
    "description" : "order number 3819" // description - string(0…255)
  }, … ]
}

movements.get

Returns a movement given its identifier.

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

request

{
  "id" : 58913, // identifier of the movement (required) - int(1…)
  "fields" : [ "id", "sku", … ] // fields to return - string
}

response

{
  "status"   : "ok",
  "movement" : { // (can be null)
    "id" : 58913, // identifier - int(1…)
    "sku" : "A927TP", // item SKU - string(1…32)
    "adjustment" : "-5.00", // adjustment of the quantity in stock - decimal[11,2]
    "creationTime" : "2013-08-01 12:34:50", // creation time - datetime
    "description" : "order number 3819" // description - string(0…255)
  }
}

movements.count

Number of movements that meet the specified conditions.

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

request

{
  "conditions" : { // returns only the movements …
    "sku" : "A927TP", // … with this item SKU - string(1…32)
    "fromCreationTime" : "2010-11-01 12:00:00", // … created after this date - datetime
    "toCreationTime" : "2010-01-31 23:59:59", // … created before this date - datetime
    "keywords" : "shirt" // … with these keywords - string(1…100)
  }
}

response

{
  "status" : "ok",
  "count"  : 83028 // number of movements - int(0…)
}

movements.create

Creates a new movement.

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

request

{
  "movement" : { // movement to create (required)
    "sku" : "A927TP", // item SKU (required) - string(1…32)
    "adjustment" : "-5.00", // adjustment of the quantity in stock (required) - decimal[11,2]
    "description" : "order number 3819" // description - string(0…255)
  }
{

response

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

Errors

Field Type Description
sku NotFound Item '<sku>' does not exist
adjustment InvalidValue Adjustment <adjustment> is out of range

movements.update

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

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

request

{
  "id"  : 58913, // identifier of the movement to update (required) - int(1…)
  "movement" : { // movement's fields to update (required)
    "description" : "order number 3819" // movement's properties to update - string(1…255)
  }
}

response

{
  "status" : "ok"
}

Errors

Field Type Description
id NotFound Movement <id> does not exist

movements.delete

Deletes one or more movements.

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

request

{
  "ids" : [ 4903, 4097, … ] // identifiers of the movements to delete (required) - int(1…)
}

response

{
  "status" : "ok"
}