Document toolboxDocument toolbox

AOSv2 Create Order Data

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

Please use AOS v2. AOS is outdated version.

Configuration

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

The main information about how to use 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.

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

Package contains default component (item)

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

  • automatic item selection is set as true and,

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

Package contains more components (items)

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

ActionContract

This parameter contains request body you want to send.

Package with default component (item)

{ }

Package with more components (items)

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

Information about PackageId and Items Id are available there AOSv2 Get Node-info Data

Data Properties

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

PackageId

An integer that represents package´s id.

Items

A field of the objects represent items you ordered.

Items - Id

An integer that represents the item´s id.

Items - Count

An integer that represents count of the items.

Note

A string that represents note.

Example

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

Response:

{ "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 order. Every object contains parameters below.

OrderGuid

A string that represents uniq order´s id.

OrderStatus

A string that represents order´s state.

PackageId

An integer that represents package´s id.

PackageTitle

A string that represents name of the package.

Items

A field of the objects represent items you ordered.

Items - Id

An integer that represents item´s id.

Items - Title

A string that represents 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 target of the order.

CanDiscard

A boolean value if user can discard order.

Creator

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

WorkRoleCreator

A string that represents creator´s role.

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

If you encounter any issues or need assistance with using this product, please do not hesitate to reach out for support. Our team is here to help you resolve any problems and answer any questions you may have.
To create a support ticket, visit our support portal at https://partner.twinzo.eu/helpdesk/customer-care-1