Forums › Forums › OroCRM › OroCRM – Programming Questions › Create an order via API
This topic contains 6 replies, has 3 voices, and was last updated by Paul Clarkin 8 years, 4 months ago.
Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.
- CreatorTopic
- March 3, 2015 at 12:07 pm #25005
Can someone help with information about creating orders via API? Couldn’t find appropriate documentation.. thanks in advance!
- CreatorTopic
- AuthorReplies
- March 24, 2015 at 12:35 am #25006
Hi @salex,
You couldn’t find any documentation since there is no functionality yet to create Magento order, assuming the orders you’re talking about are Magento orders, via the OroCRM api. You could go ahead and create an Api (Rest/SOAP) Order controller and add this functionality yourself :)
The OroCRMSalesBundle has some great examples for creating your own Api controllers https://github.com/orocrm/crm/tree/master/src/OroCRM/Bundle/SalesBundle/Controller/Api/Rest hope this helps to get you started!
Kind Regards,
Jaimy Casteleijn
April 28, 2015 at 3:59 am #25007Hi Jaimy,
thank you for the answer, do I understand correctly that ORO doesn’t have ‘own storage’ for orders and the only one way is installing additionally Magento for this purpose? If so, could you please clarify any other alternative approaches for handling orders in ORO, presently we have own custom e-commerce application written on php framework with custom DB (where stored customers, products, orders etc).
Thanks,
AlexApril 28, 2015 at 4:07 am #25008Hi @salex,
You understand correctly! Oro doesn’t store “basic orders” if you will. It will only store orders for the entities you create. You could use a BaseOrder entity as a start and work from there. This is what I would advise:
– Create an entity which will store you’re Order (if you want could map it 1on1);
– The Order could extend the BaseOrder (BaseOrder) which will give you a nice set of fields to start from;
– Create the related entities, such as OrderItems, Customers, OrderAddress etc..;
– After you’ve done all that, you could create an ApiController to push Orders to your CRM instance.There is no out of the box Order for all platforms so you are stuck with writing some entities on your own, sorry :< . Hope this helps!
Kind Regards,
Jaimy Casteleijn
April 28, 2015 at 1:37 pm #25009Hi Jaimy,
thank you for such detailed explanation, now technical side is clear :)
will think about the best approach.Alex
April 28, 2015 at 11:22 pm #25010Hi @salex,
No problem, hopefully this will help and guide you (in some way) to the right approach. Good luck and have fun with Oro(CRM)!
Kind Regards,
Jaimy Casteleijn
November 26, 2015 at 3:49 am #25011Hi, @salex is this something you solved? I want to do the same. Is your solution something you could share?
Thanks
- AuthorReplies
The forum ‘OroCRM – Programming Questions’ is closed to new topics and replies.