Insert Order Using 7.0 API

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
Rhonda
Ensign (ENS)
Ensign (ENS)
Posts: 1
Joined: Tue Jan 29, 2008 9:19 am
Contact:

Insert Order Using 7.0 API

Post by Rhonda » Tue Jan 29, 2008 11:02 am

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!

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Post by Logan Rhodehamel » Thu Jan 31, 2008 10:52 am

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.

Code: Select all

                //CREATE THE ORDER RECORD
                order = new Order();
                order.OrderId = StoreDataSource.GetNextOrderId(true);
                order.OrderStatusId = OrderStatusDataSource.GetNewOrderStatus().OrderStatusId;
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.
Cheers,
Logan
Image.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.

Post Reply