Suborder

An object representing a part of an Order tied to a certain Supplier.

To get a list of Suborders for a Supplier, use Supplier.getSuborders.

Methods

get

Fetches information about a suborder.

Parameters

Parameter Description
uid The unique identifier of a suborder.
query Which info to return. See Query language.

getSchema

Parameters

The unique identifier of an order.

Example

API Console
Suborder.getSchema(12345)
Response
{
  "uid": {
    "type":        "integer",
    "description": "Suborder instance's UID"
  },
  "order": {
    "type":        "integer",
    "description": "An Order UID (but can take subqueries into the Order instance)."
  },
  "supplier": {
    "type":        "integer",
    "description": "A Supplier UID (but can take subqueries into the Supplier instance)."
  },
  "deliveryStatus": {
    "type":        "string",
    "description": "The collected delivery status of all Suborder items.",
    "enum": [
      "Shipped",
      "Not shipped"
    ]
  },
  "items": {
    "type":        "array",
    "description": "A list of the OrderItems tied to this Suborder.",
    "items": {
      "type":        "integer",
      "desctiption": "An OrderItem instance (or UID if explicitly queried by 'uid').",
    }
  },
  "cost": {
    "type":        "object",
    "description": "The sum of the OrderItems in this Suborder.",
    "properties": {
      "exVat":  {
        "type":        "number",
        "description": "Total amount without VAT."
      },
      "incVat": {
        "type":        [ "number", "null" ],
        "description": "Total amount, or null if the order is without VAT."
      },
      "vat": {
        "type":        [ "number", "null" ],
        "description": "The VAT sum, or null if the Order is without VAT."
      }
    }
  }
}

set

Updates a suborder.

Parameters

Parameter Description
uid The unique identifier of a suborder.
patch An object containing the properties and values to set for the suborder.
query A query specifying what to return after a successful set (optional).

Example

API Console
Suborder.set(412315, {"deliveryStatus": "Shipped"}, "deliveryStatus")
Response
{"deliveryStatus": "Shipped"}