Skip to content
← Back to Index

Message: order.create

Creates an new Order.

Schema

Body
orderNumberstring (optional) The OrderNumber to assign to the asset. If not set, the number is automatically generated.
currencyCodestring ISO-4217 currency code (recommended), or a custom code.
taxIncludedboolean Whether monetary values on the order should be regarded as including tax or not. This applies to commands as well as the graph nodes generated by the actor.
commandsarray of command (optional) An array of order commands to be applied upon creation. If any command fail, the order will not be created.
createdAtany value (optional) Overrides `createdAt` value of the order. If not set (or set to the future), the time will be set to the current system time of creation.
Response Type string

Rule Hooks

During the create message, the following Rule Hooks are run in the given order:

  1. OnOrderBeforeCreated
  2. OnOrderCreated
  3. OnOrderCommands

Examples

Create New Order
```json [{ "type": "create", "body": { "currencyCode": "EUR", "taxIncluded": true, "commands": [{ "type": "createDelivery", "deliveryId": "65812410-bd14-4d6d-ab79-374789a976c1", "shippingPrice": 100 },{ "type": "createOrderLine", "deliveryId": "65812410-bd14-4d6d-ab79-374789a976c1", "productNumber": "P1", "quantity": 1, "unitPrice": 90, "taxFactor": 0.25 } ] } }] ```

© 2024 Hantera AB. All rights reserved.