| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
RESTAPI Question to Retrieve Order Details | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
RESTAPI Question to Retrieve Order Details
I have read all of the documentation about the RESTAPI and I do NOT use Guzzle.
I cannot figure out how to fetch the order billing address information, specifically the First Name, Last Name and Company. I am able to get the Order itself and the users email and Profile... Can anyone point me in the right direction?
__________________
Al Ponte |
|||||||
#2
|
|||||||||
|
|||||||||
Re: RESTAPI Question to Retrieve Order Details
@Al Ponte,
You can pull order info by calling this URL: Code:
ORDERID part should be replaced by actual order ID.
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! Last edited by qualiteam : 05-04-2015 at 10:48 PM. |
|||||||||
#3
|
|||||||
|
|||||||
Re: RESTAPI Question to Retrieve Order Details
Tony,
I had figured that out just before reading this but unfortunately, Company is not included in the returned schema. Upon further inspection, it seems Company is not included in the complex schema definition. Also, how can I use RESTAPI to add a note to an order?
__________________
Al Ponte |
|||||||
#4
|
|||||||||
|
|||||||||
Re: RESTAPI Question to Retrieve Order Details
Quote:
Do you mean Company as a custom field in customer profile? Or do you mean some other Company field?
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#5
|
|||||||
|
|||||||
Re: RESTAPI Question to Retrieve Order Details
Tony,
Thanks for your quick response again! I added the field to the "Address Fields" tab of Cart & Checkout settings. I attached a screen shot of it.
__________________
Al Ponte |
|||||||
#6
|
|||||||||
|
|||||||||
Re: RESTAPI Question to Retrieve Order Details
Thanks for clarification.
Unfortunately, there is no straight-forward way of pulling Company field. You can achieve this by multiple queries: 1) Make a query to "order/ORDERID" and see the profile_id field in response 2) Make a query to "profile/PROFILE_ID" and see the value in addresses > address_id field in response 3) Finally make a query to "address/ADDRESS_ID" end-point and get the results. Alternatively, you can extend the REST API module and include the Company info into complex schema.
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#7
|
|||||||
|
|||||||
Re: RESTAPI Question to Retrieve Order Details
Tony,
Thanks! That solution will work just fine - I am actually authoring a page that will allow our customers to sign-up with our service after purchasing a subscription. Is there any way to add an order event note to an order using REST?
__________________
Al Ponte |
|||||||
|
#8
|
|||||||||
|
|||||||||
Re: RESTAPI Question to Retrieve Order Details
Quote:
Yes, sure. For that you need to put data for \XLite\Model\OrderHistoryEvents model. So, you will have to make a POST request to url with _path=orderhistoryevents/0
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#9
|
|||||||
|
|||||||
Re: RESTAPI Question to Retrieve Order Details
Does anyone know how to get the individual item attributes that were selected on the order for each item.
Using &_path=order, you can easily get all the items that were on the order but not the item attributes. Any help would be greatly appreciated.
__________________
Ben |
|||||||
#10
|
|||||||||
|
|||||||||
Re: RESTAPI Question to Retrieve Order Details
Hello @Ben,
Here is the code example (using Guzzle) that will do a trick for you: PHP Code:
Please, let me know if it helps. Tony
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
|
|||
X-Cart forums © 2001-2020
|