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

NameTypeRequiredDescription
Order IDStringYesOrderwise order ID (the order header ID).
Variant CodeStringYesVariant code of the item to add.
Item NumberStringYesItem number to store on the line.
QuantityNumberYesQuantity to add.
Item NetNumberYesNet price of the item.
Item GrossNumberYesGross price of the item.
Tax Rate IDNumberYesOrderwise tax rate ID (a whole number).
Stock Location IDNumberYesOrderwise stock location ID (a whole number).
Safe ModeBooleanNoIf on, errors are returned in the outputs instead of stopping the flow.

Outputs

NameTypeDescription
SuccessBooleanWhether Orderwise added the line.
ResponseObjectThe Orderwise response body.
Error MessageStringError 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_url from the connection.
  • The connection's base_url must be an https URL, for example https://<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/gettoken and then calls POST /sales/order/{Order ID}/lines. It doesn't cache the token.
  • Order ID can contain only letters, digits, - and _. A number such as 1001.0 is sent as 1001.
  • Number inputs can also arrive as text, for example "3". Whole numbers are sent as integers (2.0 becomes 2). 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, Response wraps it: other JSON values go under value, and plain text goes under text.
  • Safe Mode is off by default, so a failure stops the flow. Turn it on to get Success = false and an Error Message instead, and let the flow continue.


Did this page help you?