Difference between revisions of "AbleCommerce Gold Web Api"

From AbleCommerce Wiki
Jump to: navigation, search
(POST api/AdminProducts)
(Introduction)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== Introduction ==  
 
== Introduction ==  
  
AbleCommerce Web API allows you to interact with a subset of the store data. Currently its under development and only can be used to interact with the products data. It offers post / put / delete functionality.
+
AbleCommerce Web API allows you to interact with a subset of the store data. It can be used to interact with a subset of all data including Products, Categories, Users, Orders, Order Items and Order Shipments. It offers post / put / delete functionality for these domains.
  
  
The Web API includes a help documentation generator and test harness. The help documentation can be access using a URL like this:
+
The Web API includes a help documentation generator and test harness. The help documentation can be accessed using a URL like this:
  
  
Line 12: Line 12:
 
This will list an index of all available functions. Clicking through to one of the functions shows examples. The test buttons on the help pages can be used to specify/send formatted data and read the responses. For detailed and up to date information about API usage check the integrated api help.
 
This will list an index of all available functions. Clicking through to one of the functions shows examples. The test buttons on the help pages can be used to specify/send formatted data and read the responses. For detailed and up to date information about API usage check the integrated api help.
  
 +
For the above mentioned domains mostly two controllers are available for each, one is admin and one is for retail. The admin controller requires authorization and SSL, while the retail controller works over plain HTTP and does not require authentication. However retail controller will only let you examine public data. This is discussed in more details in next section.
  
For products two controllers are available, one is admin and one is for retail. The admin controller require authorization and SSL, while the retail controller works over plain HTTP and does not require authentication. However it will only let you examine public products. Here is complete list of available functions:
 
  
== AdminProducts : API DETAILS ==
+
== Managing Web API Access ==
  
=== GET api/AdminProducts ===
+
Retail controllers are accessible to everyone (e.g. Product and Category controllers), while the admin controllers require SSL and authorization. Though all admin level users can access the admin controllers but to allow third parties to access the Web API without full admin rights a new User Role "Web API Access" is created. So, this way merchants can grant right to access Web API to specific users by assigning them to "Web API Access" role. For example Order, Shipment and User controllers require authorization and users with at least "Web API Access" rights can access those.
Method: GET
+
  
URI: api/AdminProducts
+
== Version and Update History ==
  
Description: Gets all products.
+
A basic Web API feature was added for AbleCommerce Gold R4, and improved continuously with later releases.  
  
 +
For AbleCommerce Gold R7 new admin and retail controllers were added for Category domain. And following new API end points were added for Products domain:
  
=== GET api/AdminProducts/{id} ===
+
/api/products/featured
Method: GET
+
  
URI: api/AdminProducts/{id}
+
/api/products/topsellers
  
Description: Gets a specific product.
+
/api/products/recentlyviewed
  
 +
/api/products/[productid]/related
  
Request Information: Parameters
+
/api/products/[productid]/accessories
  
--
 
  
Name: id
+
For AbleCommerce Gold R12 new admin and retail controllers for Users, Orders, Order Items and Order Shipments are added.
  
Description: Id of the product, define this parameter in the request URI.
+
== Requirements ==
  
 +
Web API requires IIS7 using Integrated Pipeline mode.
  
=== POST api/AdminProducts ===
+
== API DETAILS ==
Method: POST
+
  
URI: POST api/AdminProducts
+
Each controller allow performing different operations, and detailed help is available for each controller at your store "/api/help" page. For example here we list complete list of available functions for admin and retail controllers of Product domain:
  
Description: Creates a product
 
  
 +
== AdminProducts : API DETAILS ==
  
Request Information: Parameters
+
=== GET api/AdminProducts/List ===
 +
Gets all products.
  
--
+
=== GET api/AdminProducts/List?id={id} ===
 +
Gets a specific product.
  
Parameter: product
+
=== GET api/AdminProducts/Featured ===
 +
Gets all featured products.
  
Description: The new product. Define this parameter in the request body.
+
=== GET api/AdminProducts/Related?id={id} ===
 +
Gets related products.
  
=== POST api/AdminProducts ===  
+
=== GET api/AdminProducts/Accessories?id={id} ===
Method: POST
+
Gets upsell products.
  
URI: api/AdminProducts/{id}
+
=== POST api/AdminProducts/PostProduct ===
 +
Creates a product
  
Description: Updates a product
+
=== PUT api/AdminProducts/PutProduct?id={id} ===
 +
Updates a product
  
 +
=== DELETE api/AdminProducts/DeleteProduct?id={id} ===
 +
Deletes a product.
  
Request Information: Parameters
+
=== GET api/AdminProducts/List/{id} ===
 +
Gets a specific product.
  
--
+
=== GET api/AdminProducts/Related/{id} ===
 +
Gets related products.
  
Parameter: id
+
=== GET api/AdminProducts/Accessories/{id} ===
 +
Gets upsell products.
  
Description: The id of the product to update. Define this parameter in the request URI.
+
=== PUT api/AdminProducts/PutProduct/{id} ===
 +
Updates a product
  
 +
=== DELETE api/AdminProducts/DeleteProduct/{id} ===
 +
Deletes a product.
  
Parameter: product
+
=== GET api/AdminProducts/{id}/List ===
 +
Gets a specific product.
  
Description: The updated details. Define this parameter in the request body.
+
=== GET api/AdminProducts/{id}/Related ===
 +
Gets related products.
  
=== DELETE api/AdminProducts/{id} ===  
+
=== GET api/AdminProducts/{id}/Accessories ===
Method: DELETE
+
Gets upsell products.
  
URI: api/AdminProducts/{id}
+
=== PUT api/AdminProducts/{id}/PutProduct ===
 +
Updates a product
  
Description: Deletes a product.
+
=== DELETE api/AdminProducts/{id}/DeleteProduct ===
 +
Deletes a product.
  
 +
=== GET api/AdminProducts ===
 +
Gets all products.
  
Request Information: Parameters
+
=== GET api/AdminProducts/{id} ===
 +
Gets a specific product.
  
--
 
  
Parameter: id
+
== Products : API DETAILS ==
  
Description: The id of the product to delete. Define this parameter in the request URI.
+
=== GET api/Products/List ===
 +
Gets all products.
  
== Products : API DETAILS ==
+
=== GET api/Products/List?id={id} ===
 +
Gets a specific product.
  
=== GET api/Products ===  
+
=== GET api/Products/Featured ===
Method: GET
+
Gets all featured products.
  
URI: api/Products
+
=== GET api/Products/Featured?id={id} ===
 +
Gets a specific featured product.
  
Description: Gets all products.
+
=== GET api/Products/TopSellers ===
 +
Gets all popular products.
  
 +
=== GET api/Products/MostViewed ===
 +
Gets most viewed products.
  
=== GET api/Products/{id} ===  
+
=== GET api/Products/RecentlyViewed ===
Method: GET
+
Gets all recently viewed products.
  
URI: api/Products/{id}
+
=== GET api/Products/Related?id={id} ===
 +
Gets related products.
  
Description: Gets a specific product.
+
=== GET api/Products/Accessories?id={id} ===
 +
Gets upsell products.
  
 +
=== GET api/Products/Reviews?id={id} ===
 +
Gets product reviews.
  
Request Information: Parameters
+
=== GET api/Products/List/{id} ===
 +
Gets a specific product.
  
--
+
=== GET api/Products/Featured/{id} ===
 +
Gets a specific featured product.
  
Parameter: id
+
=== GET api/Products/Related/{id} ===
 +
Gets related products.
  
Description: The id of the product. Define this parameter in the request URI.
+
=== GET api/Products/Accessories/{id} ===
 +
Gets upsell products.
 +
 
 +
=== GET api/Products/Reviews/{id} ===
 +
Gets product reviews.
 +
 
 +
=== GET api/Products/{id}/List ===
 +
Gets a specific product.
 +
 
 +
=== GET api/Products/{id}/Featured ===
 +
Gets a specific featured product.
 +
 
 +
=== GET api/Products/{id}/Related ===
 +
Gets related products.
 +
 
 +
=== GET api/Products/{id}/Accessories ===
 +
Gets upsell products.
 +
 
 +
=== GET api/Products/{id}/Reviews ===
 +
Gets product reviews.
 +
 
 +
=== GET api/Products ===
 +
Gets all products.
 +
 
 +
=== GET api/Products/{id} ===
 +
Gets a specific product.
  
 
== List of Available Fields for AdminProducts ==
 
== List of Available Fields for AdminProducts ==
Line 183: Line 240:
 
ExtendedDescription
 
ExtendedDescription
 
</pre>
 
</pre>
 +
 +
== List of Available Fields for Users ==
 +
<pre>
 +
Id
 +
Username
 +
Email
 +
AffiliateId
 +
IsApproved
 +
IsAnonymous
 +
IsLockedOut
 +
CreateDate
 +
LastActivityDate
 +
LastLoginDate
 +
Comment
 +
</pre>
 +
 +
== List of Available Fields for Categories and AdminCategories ==
 +
<pre>
 +
Id
 +
ParentId
 +
Name
 +
Summary
 +
Description
 +
ThumbnailUrl
 +
ThumbnailAltText
 +
MetaDescription
 +
MetaKeywords
 +
Title
 +
HtmlHead
 +
</pre>
 +
 +
== List of Available Fields for Orders ==
 +
<pre>
 +
Id
 +
OrderNumber
 +
OrderDate
 +
StoreId
 +
Store
 +
UserId
 +
UserName
 +
OrderStatus
 +
BillToFirstName
 +
BillToLastName
 +
BillToCompany
 +
BillToAddress1
 +
BillToAddress2
 +
BillToCity
 +
BillToProvince
 +
BillToPostalCode
 +
BillToCountryCode
 +
BillToPhone
 +
BillToFax
 +
BillToEmail
 +
ProductSubtotal
 +
TotalCharges
 +
TotalPayments
 +
Exported
 +
RemoteIP
 +
Referrer
 +
ShippingAmount
 +
TaxAmount
 +
</pre>
 +
 +
== List of Available Fields for Order Items ==
 +
<pre>
 +
Id
 +
OrderId
 +
OrderItemTypeId
 +
OrderShipmentId
 +
Name
 +
VariantName
 +
Sku
 +
Price
 +
Weight
 +
CostOfGoods
 +
Quantity
 +
LineMessage
 +
OrderBy
 +
GiftMessage
 +
TaxRate
 +
TaxAmount
 +
KitList
 +
IsSubscription
 +
Frequency
 +
FrequencyUnitId
 +
</pre>
 +
 +
== List of Available Fields for Order Shipments ==
 +
<pre>
 +
Id
 +
OrderId
 +
OrderNumber
 +
ShipMethod
 +
Warehouse
 +
ShipToFirstName
 +
ShipToLastName
 +
ShipToCompany
 +
ShipToAddress1
 +
ShipToAddress2
 +
ShipToCity
 +
ShipToProvince
 +
ShipToPostalCode
 +
ShipToCountry
 +
ShipToPhone
 +
ShipToFax
 +
ShipToEmail
 +
OriginCountry
 +
ShipToResidence
 +
ShipMessage
 +
ShipDate
 +
ProductSubtotal
 +
TotalCharges
 +
ShippingAmount
 +
</pre>
 +
 +
[[Category:AbleCommerce Gold]]

Latest revision as of 12:32, 22 April 2016

Contents

Introduction

AbleCommerce Web API allows you to interact with a subset of the store data. It can be used to interact with a subset of all data including Products, Categories, Users, Orders, Order Items and Order Shipments. It offers post / put / delete functionality for these domains.


The Web API includes a help documentation generator and test harness. The help documentation can be accessed using a URL like this:


/api/help


This will list an index of all available functions. Clicking through to one of the functions shows examples. The test buttons on the help pages can be used to specify/send formatted data and read the responses. For detailed and up to date information about API usage check the integrated api help.

For the above mentioned domains mostly two controllers are available for each, one is admin and one is for retail. The admin controller requires authorization and SSL, while the retail controller works over plain HTTP and does not require authentication. However retail controller will only let you examine public data. This is discussed in more details in next section.


Managing Web API Access

Retail controllers are accessible to everyone (e.g. Product and Category controllers), while the admin controllers require SSL and authorization. Though all admin level users can access the admin controllers but to allow third parties to access the Web API without full admin rights a new User Role "Web API Access" is created. So, this way merchants can grant right to access Web API to specific users by assigning them to "Web API Access" role. For example Order, Shipment and User controllers require authorization and users with at least "Web API Access" rights can access those.

Version and Update History

A basic Web API feature was added for AbleCommerce Gold R4, and improved continuously with later releases.

For AbleCommerce Gold R7 new admin and retail controllers were added for Category domain. And following new API end points were added for Products domain:

/api/products/featured

/api/products/topsellers

/api/products/recentlyviewed

/api/products/[productid]/related

/api/products/[productid]/accessories


For AbleCommerce Gold R12 new admin and retail controllers for Users, Orders, Order Items and Order Shipments are added.

Requirements

Web API requires IIS7 using Integrated Pipeline mode.

API DETAILS

Each controller allow performing different operations, and detailed help is available for each controller at your store "/api/help" page. For example here we list complete list of available functions for admin and retail controllers of Product domain:


AdminProducts : API DETAILS

GET api/AdminProducts/List

Gets all products.

GET api/AdminProducts/List?id={id}

Gets a specific product.

GET api/AdminProducts/Featured

Gets all featured products.

GET api/AdminProducts/Related?id={id}

Gets related products.

GET api/AdminProducts/Accessories?id={id}

Gets upsell products.

POST api/AdminProducts/PostProduct

Creates a product

PUT api/AdminProducts/PutProduct?id={id}

Updates a product

DELETE api/AdminProducts/DeleteProduct?id={id}

Deletes a product.

GET api/AdminProducts/List/{id}

Gets a specific product.

GET api/AdminProducts/Related/{id}

Gets related products.

GET api/AdminProducts/Accessories/{id}

Gets upsell products.

PUT api/AdminProducts/PutProduct/{id}

Updates a product

DELETE api/AdminProducts/DeleteProduct/{id}

Deletes a product.

GET api/AdminProducts/{id}/List

Gets a specific product.

GET api/AdminProducts/{id}/Related

Gets related products.

GET api/AdminProducts/{id}/Accessories

Gets upsell products.

PUT api/AdminProducts/{id}/PutProduct

Updates a product

DELETE api/AdminProducts/{id}/DeleteProduct

Deletes a product.

GET api/AdminProducts

Gets all products.

GET api/AdminProducts/{id}

Gets a specific product.


Products : API DETAILS

GET api/Products/List

Gets all products.

GET api/Products/List?id={id}

Gets a specific product.

GET api/Products/Featured

Gets all featured products.

GET api/Products/Featured?id={id}

Gets a specific featured product.

GET api/Products/TopSellers

Gets all popular products.

GET api/Products/MostViewed

Gets most viewed products.

GET api/Products/RecentlyViewed

Gets all recently viewed products.

GET api/Products/Related?id={id}

Gets related products.

GET api/Products/Accessories?id={id}

Gets upsell products.

GET api/Products/Reviews?id={id}

Gets product reviews.

GET api/Products/List/{id}

Gets a specific product.

GET api/Products/Featured/{id}

Gets a specific featured product.

GET api/Products/Related/{id}

Gets related products.

GET api/Products/Accessories/{id}

Gets upsell products.

GET api/Products/Reviews/{id}

Gets product reviews.

GET api/Products/{id}/List

Gets a specific product.

GET api/Products/{id}/Featured

Gets a specific featured product.

GET api/Products/{id}/Related

Gets related products.

GET api/Products/{id}/Accessories

Gets upsell products.

GET api/Products/{id}/Reviews

Gets product reviews.

GET api/Products

Gets all products.

GET api/Products/{id}

Gets a specific product.

List of Available Fields for AdminProducts

Id
Name
Price
CostOfGoods
MSRP
Weight
Length
Width
Height
Manufacturer
Sku
ModelNumber
TaxCode
Warehouse
InStock
InStockWarningLevel
InventoryMode
ThumbnailUrl
ThumbnailAltText
ImageUrl
ImageAltText
Summary
Description
ExtendedDescription
Vendor
CreatedDate
LastModifiedDate
IsFeatured
IsProhibited
AllowReviews
AllowBackorder
ExcludeFromFeed
DisablePurchase
MinQuantity
MaxQuantity
IsGiftCertificate
WrapGroup
Visibility
Shippable

List of Available Fields for Retail Products

Id
Name
Price
MSRP
Weight
Length
Width
Height
Manufacturer
Sku
ModelNumber
ImageUrl
ImageAltText
Summary
Description
ExtendedDescription

List of Available Fields for Users

Id
Username
Email
AffiliateId
IsApproved
IsAnonymous
IsLockedOut
CreateDate
LastActivityDate
LastLoginDate
Comment

List of Available Fields for Categories and AdminCategories

Id
ParentId
Name
Summary
Description
ThumbnailUrl
ThumbnailAltText
MetaDescription
MetaKeywords
Title
HtmlHead

List of Available Fields for Orders

Id
OrderNumber
OrderDate
StoreId
Store
UserId
UserName
OrderStatus
BillToFirstName
BillToLastName
BillToCompany
BillToAddress1
BillToAddress2
BillToCity
BillToProvince
BillToPostalCode
BillToCountryCode
BillToPhone
BillToFax
BillToEmail
ProductSubtotal
TotalCharges
TotalPayments
Exported
RemoteIP
Referrer
ShippingAmount
TaxAmount

List of Available Fields for Order Items

Id
OrderId
OrderItemTypeId
OrderShipmentId
Name
VariantName
Sku
Price
Weight
CostOfGoods
Quantity
LineMessage
OrderBy
GiftMessage
TaxRate
TaxAmount
KitList
IsSubscription
Frequency
FrequencyUnitId

List of Available Fields for Order Shipments

Id
OrderId
OrderNumber
ShipMethod
Warehouse
ShipToFirstName
ShipToLastName
ShipToCompany
ShipToAddress1
ShipToAddress2
ShipToCity
ShipToProvince
ShipToPostalCode
ShipToCountry
ShipToPhone
ShipToFax
ShipToEmail
OriginCountry
ShipToResidence
ShipMessage
ShipDate
ProductSubtotal
TotalCharges
ShippingAmount