Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Rest API pulling Orders

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 12-12-2021, 07:53 AM
 
GDavis GDavis is offline
 

Newbie
  
Join Date: Nov 2021
Posts: 3
 

Default Rest API pulling Orders

I am on 5.3.6.8 and I am using it to pull down Orders. I have two questions.

1. It isn't pulling down some fields like Profile_Id, Payment_Status_id, Shipping_Status_ID etc... But the documentation seems to indicate it will pull down the entire entity. I get almost all the fields but missing just a few. Is this a problem with my install or these fields aren't supported.

2. Does anyone have the paging working?

in my code I have this:

request.QueryStringParams.Add($"_cnd[limit][0]={start}");
request.QueryStringParams.Add($"_cnd[limit][1]={pageSize}");

My start number is incremented by the pageSize + 1 so I should just page and page until I get a partial return with < less that pageSize and I would know I was at the end. But it doesn't seem to work that way, I get to the end and it still gives me 100 records. Is Limit the way to go here?






X-Cart
Business 5.3.6.8
__________________
X-Cart 5.3.6.8
Reply With Quote
  #2  
Old 12-17-2021, 06:16 AM
 
GDavis GDavis is offline
 

Newbie
  
Join Date: Nov 2021
Posts: 3
 

Default Re: Rest API pulling Orders

Ok, after more playing around with this I have some observations. I was going to delete this post but thought I would leave it up for the next dev.

1. The default order object just doesn't return Profile_ID and a few other fields. which is a bummer because it's the full raw object and the field is there, but just not populated. What you can do instead is pull down the Complex Order which does give you a richer object graph including Customer (profile), CustomerAddress, Items (orderItems) etc. This object is not the full record from the DB but it's pretty useful.

Forget my question about the paging. That is working for me now.
__________________
X-Cart 5.3.6.8
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:55 AM.

   

 
X-Cart forums © 2001-2020