- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Magento 2 - REST API - Create order for customer with admin token
Hi,
I'm working on an app for Magento store. and I want to create an order for customers with my admin token.
I found 2 ways:
1. To get the customer credentials (user name and password) and create a queue - But I can't get all the users credentials.
2. create a guest order but I didn't find a way to add the customer’s id only email.
so the order is not linked to the customer's orders history.
is there a way to create an order for customer with admin token? and link to order to the customer profile?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Magento 2 - REST API - Create order for customer with admin token
Hello @zivothergmbe01
There is no such feature in rest api which can help you to create order for any customer without using customer token, you first have to create order from customer account.
You can customize code and create a new API which will work that way, but for now there is no default API.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Magento 2 - REST API - Create order for customer with admin token
You can create an order for customers with my admin token
1. Using this API https://magento.redoc.ly/2.4-admin/#operation/twoFactorAuthAdminTokenServiceV1CreateAdminAccessToken... you can get a token then pass to the API create order if your admin account has permission to do that
2. Create order API https://magento.redoc.ly/2.4-admin/tag/orders#operation/salesOrderRepositoryV1SavePost - in this one, you can use customer email (please check parameter required in the spec) => So you can link the order to the customer profile