Hi,
I'm a bit rusty on this, but a few comments on your code:
- there is no need to generate a guid just leave it blank CRM_ORDER_MAINT will do it
- there is no need to generate a handle, just use an arbitrary value (like 1)
- doesn't CRM_ORDER_MAINTAIN return the object id in one of those structures
- I do not think you need to commit work before CRM_ORDER_SAVE. Do it after.
- have you tried debugging CRM_ORDER_SAVE to see where the problem is?
cheers
Paul