All domain models have factory methods so to create an order you’d use Order.Create(...);. This needs to be called within a unit of work. Once you’ve created your order you can persist it in the usual way _orderService.SaveOrder(order); making sure to complete your uow.
The next issue I’ve hit is with AddProduct(...). When I call it in my background service, it tries to resolve a product snapshot internally via IProductService, which blows up because there’s no published snapshot available (no HTTP request context). The exception is:
System.InvalidOperationException: Wasn't possible to get a valid Snapshot
at Umbraco.Extensions.PublishedSnapshotAccessorExtensions.GetRequiredPublishedSnapshot(...)
Since my subscription processor runs outside of a request pipeline, there’s no PublishedSnapshot, so I can’t rely on the default AddProduct overload.