Skip to content

Message: order.create

Back to Index

Creates an new Order.

Body
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.

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