#Creating a new Order
1 messages · Page 1 of 1 (latest)
You can find store and admin api on the Medusa document
I am not sure but there are those links
https://docs.medusajs.com/api/store/#tag/Order
https://docs.medusajs.com/api/admin/#tag/Order
I have searched. But I don't know which one to use. Please suggest me.
You use cart completion to create an order: https://docs.medusajs.com/api/store/#tag/Cart/operation/PostCartsCartComplete
More information: https://docs.medusajs.com/advanced/storefront/how-to-implement-checkout-flow
I tried that way(using cartcomplete endpoint). But the new order is not saved to the database. Do you think I miss something? what could be possible? Please advise me. I tested locally the cart complete endpoint like that --- curl --location --request POST 'http://localhost:9000/store/v1/carts/cart_01GH12PSKD6F512MW3FC7EKCYR/complete'
--header 'Idempotency-Key: bf70f56a-a9f4-4025-b37b-3e51d3c53c2d'
--header 'Cookie: connect.sid=s%3AphDQsDxDksrLVowxR_lLX1Mglsb3H682.KnPoqYpY5v4WjlM2LRIesk3PTy%2FfNTKL5d7Ix4zIVDg'
--data-raw ''
Are you using sqlite or postgres?
postgres
Are there any errors?
There is no any error. But it does not save to the order table. It just returns the existing old cart information as the response like that -
Why is there a /v1 in the curl address
Hello guy, my cart complete endpoint is working now. I finally found my problem. It is that the given Idempotency-Key value is incorrect. when I fixed that value, the new order is saved to the order table. Thank you guy😍
Thank you so much for giving me your valuable time. I am really sorry for my mistake.