Skip to content

Message: order.create

Back to Index

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
POST https://<hantera-hostname>/resources/actors/order/new
Authorization: Bearer <YOUR TOKEN>
Content-Type: application/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
}
]
}
}]
Back to Index