# Supplier

Representing a partner of type Supplier.

A Supplier can be connected to certain parts of an Order. The parts of an Order connected to a specific Supplier make up a Suborder.

# Properties

Property Type Decription
uid integer The unique identifier of the supplier.
company string Company name of supplier.
firstName string First name of supplier contact.
lastName string Last name of supplier contact.
email string Email of supplier contact.
orderEmail string The email address to which order notifications will be sent.

# Methods

# count

Takes a filter object and returns the number of suppliers found, as an integer.

# Parameters

A filter object specifying which suppliers to count. See Filter objects on the page List selection.

# Example

The request below returns the number of suppliers found where the company name starts with the characters Libre.

Supplier.count({
  "/name/en": {
    "startsWith": "Libre"
  }
})

# get

Fetches a supplier object.

# Parameters

Parameter Description
uid The unique identifier of an article choice.
query Which info to return. See Query language.

# Example

Supplier.get(12345, "orderEmail")

# getSchema

Fetches the JSON Schema which can be used for client-side validation.

# Parameters

The unique identifier of a supplier.

# list

Fetches multiple suppliers as an array of supplier objects.

# Parameters

Parameter Description
query Which info to return. See sQuery language.
selection Which articles to list. See List selection.

# getSuborders

Retreives all Suborder objects matching a filter, giving a query for what to return.

# Parameters

Parameter Description
filter An object for filtering out which Suborder instances to return.
query An object specifying a get-query. See Query language for detailed documentation.
offset Offset to skip. Defaults to 0.
limit Limit the number of Suborders. Default is set to 100 and max to 100.

The filtering object should match the following schema.

    # Example

    The request below prints the non-shipped suborder UIDs of the supplier.

    Supplier.getSuborders(12345, {
      "deliveryStatus": "Not shipped"
    })
    

    The request below prints the non-shipped suborder cost and order UID of the supplier.

    Supplier.getSuborders(12345, {
      "deliveryStatus": "Not shipped"
    }, [
      "uid",
      "cost",
      "order"
    ])