/
AOSv2 Create Order Data

AOSv2 Create Order Data

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

Please use AOS v2. AOS is an 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 a 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 the 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 is available there AOSv2 Get Node-info Data

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 (component).

PackageId

An integer that represents the package's id.

Items

A field of the objects represents the items you ordered.

Items - Id

An integer that represents the 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 requests 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 the order. Every object contains the parameters below.

OrderGuid

A string that represents a unique order's id.

OrderStatus

A string that represents the order's state.

PackageId

An integer that represents the package's id.

PackageTitle

A string that represents the name of the package.

Items

A field of the objects represents the items you ordered.

Items - Id

An integer that represents 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 the creator's role.

The order was created when the Order status is Created, or Accepted, and the Unix Timestamp 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