Jump to content

Web service API Create Order


spk

Recommended Posts

Hello fellow developers,

 

I'm trying to import orders from a marketplace into Prestashop, since we sell on that site.

I got all the information I need from the marketplace via an API, what I need now is to insert the orders into Prestashop and lower the quantity of the product that we sold.

 

I got my module for the marketplace up and running, so I could only apply the function to it.

 

My thoughts goes instantly to the Web Service API, but I'm new to it and I'm not really sure how it works.

Anyone who has done this before and could go through the process?

 

I guess I first have to create a customer, a cart, an address and then create the order. How do I sync all the tables together so it will know which table it should gather the information from?

 

Also, where do I start?

 

 

Regards,

spk

Link to comment
Share on other sites

  • 3 weeks later...

Hi spk,

 

even I am trying to do so. can you please share how did you do that.

Any sample files if you can share will be a great help.

 

Thanks in advance.

 

Hey!

 

I wish I could tell you, but I haven't solved it yet. So if you find a solution for it, please come back to this thread or PM me!

 

Maybe we can help each other in any way?

 

 

Regards,

spk

Link to comment
Share on other sites

Hey!

 

I wish I could tell you, but I haven't solved it yet. So if you find a solution for it, please come back to this thread or PM me!

 

Maybe we can help each other in any way?

 

 

Regards,

spk

Hey,

Thanks for quick reply. May I know how much you tried to solve this, I mean if you did some work and left for some reasons, I can take over it.

Actually I don't know where to start and struggling to find any workaround.

Link to comment
Share on other sites

Hey,

Thanks for quick reply. May I know how much you tried to solve this, I mean if you did some work and left for some reasons, I can take over it.

Actually I don't know where to start and struggling to find any workaround.

 

Hey,

 

Nah, I didn't really put myself into it. I have prioritized other stuff. 

 

My first thought would be Using the API to:

1. Create a cart

2. Create a customer

3. Create "addresses"

4. Then finally create the order synchronizing all the tables.

 

I'd say that I think this is the way to go if you want to do it, if you got time for it you could start

and i'll jump in and help you if you struggle with something.

 

 

Regards,

spk

Link to comment
Share on other sites

  • 10 months later...

I'm interested in this too. What is the best way to do it?

 

The best way to do it is to read the documentation for the web api and use it. I'm afraid I can't help you since I personally

don't know how it works exactly.

Link to comment
Share on other sites

  • 2 months later...

Not going to say much good about documentation - there's nothing in there to provide a very basic rudimentary piece of code to create an order.

 

I have a very specific requirement to batch load multiple large orders using single CSV.

I have created a simple admin module which does the CSV upload bit and got stuck at that phase.

 

Is there any one who can provide a small and simplest possible piece of code that will find customer and address by id and then create an order with given product id and qty ?!

 

It's a simplest possible ask.

 

Web Service API is a complete overkill as my module is operating within the native API name space - it should be possible to use native classes to do the job.

 

P

Edited by iterra (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...