This document describes the LINK Web Service, which provides a SOAP and REST interface to the shopping cart. It provides a basic CRUD pattern for reading and writing products, orders, and customer data.
The REST interface uses JSON; the SOAP interface uses XML. Additionally, the SOAP interface uses WSDL, which is an XML file, to describe the web service.
It's assumed that you understand the basics of programming, web services, and either SOAP or REST before moving on unless you are using a library that has abstracted this for you. For example, you don't have to know much about SOAP or XML to use the SoapClient object in PHP, and code examples will be given in PHP.
Changes
Changes will be noted here as they are implemented.
- Feb 14 2020
- Updated Create and Update product functions to create the manufacturer if it doesn't already exist.
- Sep 03 2019
- Fixed bug where update function would assign default values to products for certain fields, if they we're not passed.
- Aug 20 2019
- Fixed bug where array couldn't be encoded into json when it contained fields that weren't ASCII/UTF-8
- Modified json_encode to substitute unecodable characters
- Aug 19 2019
- Modified create method to check if SKU already exists. If so method returns 0 otherwise return the product_id.
- Changed category_paths and manfacturer name fields to allow modifying via update and create methods
- Changed category_paths delimiters from
->
and;
to/
and|
respectively - Added default values for the following fields:
- product_desc
- attribute
- custom_attribute
- product_pkg_contents
- product_features
- product_saety_blurb
- product_order
- product_hash
- product_last_mirror_check
- product_thumb_file_id
- block_coupons
- Feb 7 2017
- Added filtering by mdate (&filterKey=mdate&filterValue=>12343)
- Filtering supports
>=
and<=
but the=
must be URI encoded (%3d
) so for example, to find anything newer than 123, you could usefilterValue=>%3d124
(your HTTP library probably already handles the encoding) - Added authoritative time header (X-Authoritative-Time) to assist w/ accurate mdate filtering
- June 2016
- Added Product publish field (product_publish)
- Added Product creation date (cdate) field
- Added Product EAN field
- Added Product ISBN field
- Added Product ID field
- Added Product's MFG SKU field
- Added Product's Manufacturer's name field
- Added Product's category path(s) field (paths are seperated by ';'
- May 2013
- Added the ability to update a products
mdate
record to the SOAP link
- Added the ability to update a products
- February 2013
- Added link-tester on GitHub for unit testing
- Updated this documentation
- Added some PHP examples
- January 2013
- Changed update to no longer return HTTP 400 when submitting data that was identical to the existing data.
Testing
Grab
the link-tester unit tests and run them. See the
README
or GitHub page for details, but basically edit config.php
and run ./test or php test.php
After running the test you should see a series of OK
for each
test that was passed, or an error and which test failed. You should contact
STN if the tester fails, including the output of the failed test.