Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This guide provides information about how to work with Automated Ordering System (AOS).

Note

Please use AOS v2. AOS is an outdated version.

Configuration

To connect AOS with twinzo digital twinDigital Twin, visit the course page and find out, how to set up an AOS:

The main information about how to use twinzo´s twinzo's REST API and how to authorize your access:

Swagger AOSv2 Section

The Swagger AOSv2 section provides a detailed description of the API for the AOS. For creating a new order we can use /create.

Image RemovedImage Added
  • According to the AOSv2 setting you can use 2 ways, how to create a new order. When:

Package contains default component (item)

  • package, the node working with, contains only default (one) component (item) and,

    Image RemovedImage Added
  • automatic item selection is set as true and,

    Image RemovedImage Added
  • member is allowed to work with this component (item).

    Image RemovedImage Added

Package contains more components (items)

  • package, the node working with, contains more components (items).

ActionContract

This parameter contains the request body you want to send.

Package with default component (item)

Code Block
languagejson
{
  
}

Package with more components (items)

Code Block
languagejson
{
  "PackageId": 10,
  "Items": [
    {
      "Id": 1,
      "Count": 10
    }
  ],
  "Note": "note"
}

Data Properties

The ActionContgract contains JSON with the information about the items you ordered. In case JSON is empty and Node is set according to the description above, the request creates an order with one item (componenetcomponent).

PackageId

An integer that represents

package´s

the package's id.

Items

A field of the objects

represent

represents the items you ordered.

Items - Id

An integer that represents the

item´s

item's id.

Items - Count

An integer that represents the count of the items.

Note

A string that represents a note.

Example

There are examples for /create request requests below. The whole request URL: https://api.twinzo.eu/v3.0/aos/v2/create

Image RemovedImage Added

Response:

Code Block
languagejson
{
  "OrderGuid": "3b683c44-57aa-4672-b40e-211ee4c1b81e",
  "OrderStatus": "Created",
  "PackageId": 40,
  "PackageTitle": "APIPackage",
  "Items": [
    {
      "Id": 97,
      "Title": "Wheel",
      "Count": 10
    }
  ],
  "Note": "test more pcs;",
  "Created": 1689156624153,
  "IsOwner": true,
  "IsTarget": false,
  "CanDiscard": true,
  "Creator": "Office3_temperature",
  "WorkRoleCreator": "APIWorkRole"
}

Data Properties

The request answer you get is JSON with the info about the order. Every object contains the parameters below.

OrderGuid

A string that represents

uniq order´s

a unique order's id.

OrderStatus

A string that represents

order´s

the order's state.

PackageId

An integer that represents

package´s

the package's id.

PackageTitle

A string that represents the name of the package.

Items

A field of the objects

represent

represents the items you ordered.

Items - Id

An integer that represents

item´s

the item's id.

Items - Title

A string that represents the name of the item.

Items - Count

An integer that represents the pieces of the ordered items.

Note

A string that represents the note.

Created

A Unix timestamp in milliseconds that represents the time when the order was created.

IsOwner

A boolean value if the creator is the owner of the order.

IsTarget

A boolean value if the creator is the target of the order.

CanDiscard

A boolean value if the user can discard the order.

Creator

A string that represents who is the creator of the order.

WorkRoleCreator

A string that represents

creator´s

the creator's role.

Tip

The order was created when the Order status is Created, or Accepted, and UnixTimestamp the Unix Timestamp in parameter Created is valid.