X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   General questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=66)
-   -   How to get complete order information via REST API (https://forum.x-cart.com/showthread.php?t=76369)

QuickBooksDev 06-27-2018 03:29 AM

How to get complete order information via REST API
 
We are trying to use the V5.3.3.3 version of the REST API to get orders on V5.3.5.3 XCart to import into QuickBooks.

We are not finding the API documentation to be of much help.

We would like to be able to get all the information in 1 call which should include complete customer info (i.e.adresses, phone numbers, etc) and all items. But so far have only been able to get general info.

All other attempts to do anything else gets a
Unable to connect to the remote server No connection could be made because the target machine actively refused it

This URL is the only one that works but does not provide complete order info (i.e. with items and customer info).
"https://clientdomain.com/admin.php?target=RESTPAI&_key=" & APIKey & "&path=order"

Using &_path fails same error
Using &path=orderitems fails same error

Please advise on how we can get complete orders from the rest api.

Thanks

tony_sologubov 06-29-2018 04:06 AM

Re: How to get complete order information via REST API
 
Hi @QuickBooksDev,

Did you try to use schema=complex in REST API request:
https://devs.x-cart.com/rest-api/#what-data-i-can-pull

Essentially, try to run the same request with _path=order, but add &_schema=complex bit to it and you will see whether the data returned is sufficient enough for your task.

Tony

Quote:

Originally Posted by QuickBooksDev
We are trying to use the V5.3.3.3 version of the REST API to get orders on V5.3.5.3 XCart to import into QuickBooks.

We are not finding the API documentation to be of much help.

We would like to be able to get all the information in 1 call which should include complete customer info (i.e.adresses, phone numbers, etc) and all items. But so far have only been able to get general info.

All other attempts to do anything else gets a
Unable to connect to the remote server No connection could be made because the target machine actively refused it

This URL is the only one that works but does not provide complete order info (i.e. with items and customer info).
"https://clientdomain.com/admin.php?target=RESTPAI&_key=" & APIKey & "&path=order"

Using &_path fails same error
Using &path=orderitems fails same error

Please advise on how we can get complete orders from the rest api.

Thanks


QuickBooksDev 06-29-2018 04:18 AM

Re: How to get complete order information via REST API
 
Thanks for replying. I have looked at that web page but it is not clear how to do a orders complex schema. What should be in the URL? I have tried &schema=complex and & "&_schema=complex" but always get 'unable to connect ...'.

What is the correct URL format? I am use VB.Net not php so there may be things that I don't understand looking at the php.

tony_sologubov 06-29-2018 04:25 AM

Re: How to get complete order information via REST API
 
Quote:

Originally Posted by QuickBooksDev
Thanks for replying. I have looked at that web page but it is not clear how to do a orders complex schema. What should be in the URL? I have tried &schema=complex and & "&_schema=complex" but always get 'unable to connect ...'.

What is the correct URL format? I am use VB.Net not php so there may be things that I don't understand looking at the php.


'&_schema=complex' should be in the URL. Did you try to open the URL in browser? Does it display anything?

I am thinking maybe this problem is somewhat related to VB.Net making requests, not to X-Cart directly.

Tony

QuickBooksDev 06-29-2018 05:31 AM

Re: How to get complete order information via REST API
 
Yes, I get the error
The site can't be reached.
nnnn refunded to connect.

Can you please give me the exact URL parameters to use?

tony_sologubov 06-29-2018 05:35 AM

Re: How to get complete order information via REST API
 
Quote:

Originally Posted by QuickBooksDev
Yes, I get the error
The site can't be reached.
nnnn refunded to connect.

Can you please give me the exact URL parameters to use?


It should be something like:
Code:

http://xcart.localhost/admin.php?target=RESTAPI&_key=yourkey&_path=order&_schema=complex

What if you try to run request like this:
Code:

http://xcart.localhost/admin.php?target=RESTAPI&_key=yourkey&_path=order/1&_schema=complex

where 1 is ID of some order. Does it fire the same error?

Tony

QuickBooksDev 06-29-2018 08:45 AM

Re: How to get complete order information via REST API
 
That seem to do the trick. Not sure why it didn't work before but this URL worked.

http://nnn.nnn.nnn.nn/admin.php?target=RESTAPI&_key=kkkkk&_path=order&_s chema=complex

Thanks!!!!

tony_sologubov 07-02-2018 02:01 AM

Re: How to get complete order information via REST API
 
Quote:

Originally Posted by QuickBooksDev
That seem to do the trick. Not sure why it didn't work before but this URL worked.

http://nnn.nnn.nnn.nn/admin.php?target=RESTAPI&_key=kkkkk&_path=order&_s chema=complex

Thanks!!!!


Happy to hear, everything is working now!

Let me know if there are any other questions.

Tony

Dongan 08-25-2018 07:44 PM

Re: How to get complete order information via REST API
 
Hi Tony,

Do we have APIs for placing an order? We need two APIs

1) Get all available shipping methods & cost based on the address
2) Order placement (Inputs: Customer address, payment method, shipping methods selected)

gior_08 11-08-2018 10:33 PM

Re: How to get complete order information via REST API
 
Hello,

following the help provided here https://devs.x-cart.com/rest-api/examples.html#changing-the-shipping-status-for-an-order, does anybody know if I change the shipping status (or the payment status) for an order the customer will get an email from the eshop?

I tested and I did not got an email and I was thinking if I make something wrong.


All times are GMT -8. The time now is 08:20 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.