| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
Advice with REST API | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Advice with REST API
Hi
I am in the process of evaluating the implications of moving from XC 4.7.5 to XC 5.3. I plan to use the REST API of XC5 for synchronisation of stock information and the export of new Sales Orders. Order processing will be carried out externally with Zoho Inventory (ZI), and the transfer of data to and from Zoho Inventory will be done using Zapier. I need to know what is possible and if a Custom Module needs to be written. Products Many products will need attributes defined in XC5 and I would like to keep the master versions of these in ZI. The documentation for the REST API does not mention attributes. Does this mean that product attribute data cannot be transferred via the REST API? Sales Orders When a customer order is placed on XC5, how can the REST API be used to push the order to ZI? Will it be necessary for ZI to poll the REST API to check for a new order instead? Access to Custom Module Can the REST API be used to communicate with a Custom Module? Any help or suggestions will be warmly received.
__________________
John Legg www.TheDebugStore.com 5.4.1.18 Business, Crisp White Skin Template Backorder-Preorder Module X-Cart to Zoho Creator (in progress) Zoho Creator <-> Zoho Inventory for order processing NGINX hosted - XC virtual server |
|||||||||
#2
|
|||||||||
|
|||||||||
Re: Advice with REST API
Quote:
It is possible to retrieve product attributes, but not in a single REST API request. First, you should get the product information: https://[YOUR_STIE]/admin.php?target=RESTAPI&_key=[YOUR_KEY]&_path=product/[PRODUCT_ID] Then you should iterate over product attributes and get information on every product attribute: https://[YOUR_SITE]/admin.php?target=RESTAPI&_key=[YOUR_KEY]&_path=attribute/[ATTRIBUTE_ID] Perhaps, you also should run other requests to get information on which attribute options the product has available. You will end up with a lot requests per product, so it may make sense to customise the REST API module and add a custom API function that will return all the product's attributes in a single request. Quote:
REST API can be used for pull requests only. Yes, you should poll the API to check for new orders. Quote:
REST API provides an interface to access the database from third-party applications. You can access database records and fields added by a custom module, but you can't communicate with the module's functions directly (all requests translate to methods defined in Model/Repo classes).
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#3
|
|||||||
|
|||||||
Re: Advice with REST API
How can I modify REST API to get configurable product information?
I have created one order which has configurable product. Now I want to read that product attributes. How can I read?
__________________
ashish Xcart version :-X-Cart Business 5.3.2.8 |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Advice with REST API
REST API is an interface to manipulate data in the database through Repository classes.
So, first you should check the source code and understand what Models (subclasses of \XLite\Model\AEntity) you want to retrieve and how they relate to each other. They you should run a series of API requests to retrieve the necessary models by their identifiers. The exact list of requests depends on what exact information you require, so I'm not sure if I can guess it and post there. When sending a search request, you may filter the data with the _cnd parameters. To find what parameters are available for your models look for prepareCnd***() methods defined in the Repository classes (subclasses of \XLite\Model\Repo\ARepo) that handle operations on models which you need.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#5
|
|||||||
|
|||||||
Re: Advice with REST API
i already use rest api,
but im installing the Announce module now, and that requires a rest api key (read only) when i go to the settings on rest api, it does not display any keys i have 2 questions. 1. do i enter a key manually and match that in my announce login for it to work? 2. if i do the above will it break other connections that i use rest api for, like amazon and ebay. as i dont want to overwrite a working key with the one i enter to get announce working im asking this as i cannot see anywhere on xcart 5 where any current keys are being used, and im not sure if i can simply add another without affecting existing keys i hope this make sense i hope this makes sense |
|||||||
#6
|
|||||||||
|
|||||||||
Re: Advice with REST API
Quote:
1. Yes, you specify your API keys manually, it can be anything you want, if otherwise is not stated in Announce's documentation. 2. I don't think eBay or Amazon use REST API to work with your store. Since you don't have any REST API key specified in the module settings, you are free to enter any key you want.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|