I am trying to insert an order using the 7.0 API and have a couple questions.
1. How do I increment the order id? Currently, when I do the insert, the order id is set to zero.
2. What is the minimum data that needs to be inserted for the order to be valid. Currently, when I go to the default admin order page, I am getting a value is null on the data grid select.
Thanks!
Insert Order Using 7.0 API
- Logan Rhodehamel
- Developer
- Posts: 4116
- Joined: Wed Dec 10, 2003 5:26 pm
Well, for starters, you probably want to create your order ID and order status something like this. Unless you know the order status ID specifically that you want to assign, this sets it to whatever order status is associated with the "Order Placed" event.
I am not sure of minimum required data, since we have only tested orders added via the checkout process or our import. The minimum in the database is not necessarily what is expected by the ASP.NET script - those pages obviously have made a bad assumption about some data being present for your order.
Were you setting an order status? I wonder if that could be what it is expecting and not finding.
Let me know on that and I can suggest other data elements it might be looking for.
Code: Select all
//CREATE THE ORDER RECORD
order = new Order();
order.OrderId = StoreDataSource.GetNextOrderId(true);
order.OrderStatusId = OrderStatusDataSource.GetNewOrderStatus().OrderStatusId;
Were you setting an order status? I wonder if that could be what it is expecting and not finding.
Let me know on that and I can suggest other data elements it might be looking for.
Cheers,
Logan
.com
If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Logan

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.