Message: order.create
Back to IndexCreates an new Order.
Body
currencyCode | string ISO-4217 currency code (recommended), or a custom code. |
taxIncluded | boolean 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. |
commands | array 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:
Examples
Create New Order
POST https://<hantera-hostname>/resources/actors/order/newAuthorization: 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 } ] }}]
curl -i -X POST \ https://<hantera-hostname>/resources/actors/order/new \ -H 'Authorization: Bearer <YOUR TOKEN>' \ -H 'Content-Type: application/json' \ -d '[{ "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 } ] }}]'
Invoke-WebRequest `-Uri "https://<hantera-hostname>/resources/actors/order/new" `-Method POST ` `-Headers @{Authorization="Bearer <YOUR TOKEN>"; 'Content-Type'="application/json"}-Body '[{ "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 } ] }}]'