Orderwise Add Order Line
Adds one line to an Orderwise sales order. Uses the Orderwise module connection.
What it does
- Exchanges the Orderwise module connection's login for a bearer token.
- Adds one line to the given Orderwise sales order, with the variant code, item number, quantity, prices, tax rate and stock location you provide.
- Returns whether Orderwise added the line, along with Orderwise's response.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| Order ID | String | Yes | Orderwise order ID (the order header ID). |
| Variant Code | String | Yes | Variant code of the item to add. |
| Item Number | String | Yes | Item number to store on the line. |
| Quantity | Number | Yes | Quantity to add. |
| Item Net | Number | Yes | Net price of the item. |
| Item Gross | Number | Yes | Gross price of the item. |
| Tax Rate ID | Number | Yes | Orderwise tax rate ID (a whole number). |
| Stock Location ID | Number | Yes | Orderwise stock location ID (a whole number). |
| Safe Mode | Boolean | No | If on, errors are returned in the outputs instead of stopping the flow. |
Outputs
| Name | Type | Description |
|---|---|---|
| Success | Boolean | Whether Orderwise added the line. |
| Response | Object | The Orderwise response body. |
| Error Message | String | Error details when Safe Mode is on and the action fails. |
Notes
- Set up an Orderwise module connection before you use this action. The action has no credential inputs. It reads the login and the
base_urlfrom the connection. - The connection's
base_urlmust be anhttpsURL, for examplehttps://<your-host>/OWAPI. Otherwise the action fails before it sends any request. - On every run, the action requests a new bearer token from
{base_url}/token/gettokenand then callsPOST /sales/order/{Order ID}/lines. It doesn't cache the token. - Order ID can contain only letters, digits,
-and_. A number such as1001.0is sent as1001. - Number inputs can also arrive as text, for example
"3". Whole numbers are sent as integers (2.0becomes2). Tax Rate ID and Stock Location ID must be whole numbers. - The action checks all inputs before it contacts Orderwise. A missing or invalid input fails the run with a message such as
Variant Code is required. - Each request times out after 3 seconds to connect and 10 seconds to read. The action doesn't retry failed requests or follow redirects.
- When Orderwise returns an error, the error message includes the status code and Orderwise's own message, capped at 200 characters. For example:
RuntimeError: Orderwise request failed with status 409: Order is locked. - If the response body isn't a JSON object,
Responsewraps it: other JSON values go undervalue, and plain text goes undertext. - Safe Mode is off by default, so a failure stops the flow. Turn it on to get
Success = falseand anError Messageinstead, and let the flow continue.
Updated 1 day ago
Did this page help you?
