How to add a customer with an order using JSON API
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 24
- Joined: 15 Mar 2018, 10:04
How to add a customer with an order using JSON API
How can a user see his/her previous order, I think there is no option to attach a order with any user?
Because When i am saving the basket and creating the order there is no parameter to send the customer id.
Because When i am saving the basket and creating the order there is no parameter to send the customer id.
Re: How to add a customer with an order using JSON API
Either the customers have to be logged in or orders are associated depending on their e-mail address.
To retrieve the orders of a customer you have to use the "order" endpoint (GET request without "id" parameter) and the customer has to be logged in.
To retrieve the orders of a customer you have to use the "order" endpoint (GET request without "id" parameter) and the customer has to be logged in.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 24
- Joined: 15 Mar 2018, 10:04
Re: How to add a customer with an order using JSON API
I am using the custom login. I made my own API for login. is there any other way with customer id etc?
Re: How to add a customer with an order using JSON API
It doesn't matter what you use as long as you use the Laravel users table it will work out of the box.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 24
- Joined: 15 Mar 2018, 10:04
Re: How to add a customer with an order using JSON API
I am hitting the
http://localhost/jsonapi/order
and getting the response
{
"meta": {
"total": 0,
"prefix": null,
"content-baseurl": "/",
"csrf": {
"name": "_token",
"value": "7AHkga0vq1L6eMqJuixV9XJggdL1JqPLVxyg2hhR"
}
},
"links": {
"self": "http://localhost/jsonapi/order"
},
"data": []
}
but order exist
http://localhost/jsonapi/order
and getting the response
{
"meta": {
"total": 0,
"prefix": null,
"content-baseurl": "/",
"csrf": {
"name": "_token",
"value": "7AHkga0vq1L6eMqJuixV9XJggdL1JqPLVxyg2hhR"
}
},
"links": {
"self": "http://localhost/jsonapi/order"
},
"data": []
}
but order exist
- Attachments
-
- ordr.PNG (9.44 KiB) Viewed 2466 times
Re: How to add a customer with an order using JSON API
Is the "customerid" value in the mshop_order_base table of these orders are same as the users.id value of the user you are logged in with?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 24
- Joined: 15 Mar 2018, 10:04
Re: How to add a customer with an order using JSON API
No, It is not. But I made the solution to add the customerid after create the order and Created custom api for order listing.
Thanks
Thanks