Drop Shipping API V0.9.1 Documentation

Drop Shipping API V0.9.1 Documentation Contents General info ..........................................................................................
Author: Cory Gallagher
4 downloads 0 Views 507KB Size
Drop Shipping API V0.9.1 Documentation

Contents General info ............................................................................................................................................. 3 Resources ............................................................................................................................................ 3 Live and testing ................................................................................................................................... 3 Making your first request .................................................................................................................... 3 Testing ..................................................................................................................................................... 4 Testing endpoint order response ........................................................................................................ 4 Testing endpoint status response ....................................................................................................... 4 Testing endpoint stock response ........................................................................................................ 4 Token test ................................................................................................................................................ 5 Example request .................................................................................................................................. 5 Example response ............................................................................................................................... 5 Categories list .......................................................................................................................................... 6 Example request .................................................................................................................................. 6 Example response ............................................................................................................................... 6 Brands list ................................................................................................................................................ 7 Example request .................................................................................................................................. 7 Example response ............................................................................................................................... 7 Products list ............................................................................................................................................. 8 Example request .................................................................................................................................. 8 Receive all products ............................................................................................................................ 9 Example response ............................................................................................................................... 9 Product .................................................................................................................................................. 10 Example request ................................................................................................................................ 10 Example response ............................................................................................................................. 10 Stock ...................................................................................................................................................... 12 Example request ................................................................................................................................ 12 Example response ............................................................................................................................. 12 Order ..................................................................................................................................................... 13 Example request ................................................................................................................................ 13 Example response ............................................................................................................................. 14 Status ..................................................................................................................................................... 15 Example request ................................................................................................................................ 15 Example response ............................................................................................................................. 15 Revisions ................................................................................................................................................ 16 2

General info Resources Scala Playhouse Drop Shipping API currently has the following functionality:       

Receive categories list Receive brands list Receive products list Receive details for a specific product Receive stock indication for a specific product Create order Receive order status (and track&trace information if available)

Live and testing We have 2 versions of the API: one for testing, another for production. Call URL structure https://www.scalaplayhouse.com/api/v1/test/categorylist https://www.scalaplayhouse.com/api/v1/live/categorylist

Description Test API Live API

In test mode the behaviour for Stock, Order and Status endpoints is different. In order to use the API you need a secure key. This key you can copy from your Scala Playhouse website account page after you’ve been given access.

Making your first request All requests are done as HTTP POST request. To process your request to the API, the JSON containing your token and other values must be part of the POST body. Please review the php example code from our website to see how this is done using cURL. The example code can be found at https://www.scalaplayhouse.com/account/api/api

3

Testing If the test url’s are used the API will respond as described below. For all other calls there are no differences compared to the live versions.

Testing endpoint order response Test order numbers start with ‘T’ (in live version – with ‘V’). Statuses of the test orders can be tested using the table below.

Testing endpoint status response Txxxxx, where xxxxx – number ends with 1 or 6, order created Txxxxx, where xxxxx – number ends with 2 or 7, order handled in warehouse Txxxxx, where xxxxx – number ends with 3 or 8 completed Txxxxx, where xxxxx – number ends with 4 or 9 completed (with/without track and trace info) Txxxxx, where xxxxx – number ends with 5 or 0, order is blocked

Note: the status of a ‘T ‘-order in the live version of API is always set to completed.

Testing endpoint stock response If ‘qty’ is ‘1’ then {"success": true} else {"success": false}

4

Token test API endpoint POST https://www.scalaplayhouse.com/api/v1/live/test

Description Test your API token

Example request { "token":" c17dc66d457257d13fd09a27a27ab7325a93cad2a282515eceae31ceec051def" }

Example response { "success":true, "ipmatch":true, "ip":"12.34.56.78" } If ‘success’ is ‘false’ then the token is not correct. In this case ‘ipmatch will be ‘null’. If ‘ipmatch’ is ‘false’ then token does not match the IP that has been given in Scala Playhouse account settings.

5

Categories list API endpoint POST https://www.scalaplayhouse.com/api/v1/live/categorylist

Description Receive categories tree

Example request { "token":" c17dc66d457257d13fd09a27a27ab7325a93cad2a282515eceae31ceec051def" }

Example response { "424":{ "name":"Toys", "count":4425, "childeren":{ "462":{ "name":"Vibrator", "count":1231, "childeren":{ "574":{ "name":"", "count":527 }, "581":{ "name":"Design", "count":175 }, "583":{ "name":"G-Spot", "count":153 } } }, "432":{ "name":"Anal Toys", "count": 451, "childeren":{...} } } } }

6

Brands list API endpoint POST https://www.scalaplayhouse.com/api/v1/live/brandlist

Description Receive brans list

Example request { “token”:” c17dc66d457257d13fd09a27a27ab7325a93cad2a282515eceae31ceec051def” }

Example response Response with 4 brands { "308":{ "name":"KissMe", "count":912 }, "83":{ "name":"Evil Angel", "count":593 }, "31":{ "name":"Seven Creations", "count":419 }, "23":{ "name":"Jules Jordan", "count":331 }, {…..} }

7

Products list API endpoint POST https://www.scalaplayhouse.com/api/v1/live/productlist

Request properties Property categoryId1 categoryId2

Type

categoryId3

Integer No

category1 category2

String String

No No

category3

String

No

labelId1 labelId2 label1 label2

Integer Integer string sting

No No No No

Description Receive product list

Required Description

Integer No Integer No

If specified then filter is applied to categoryId1 (e.g. 424 - Toys) If specified then filter is applied to categoryId1 and categoryId2 (e.g. 424 and 462 – Toys and Vibrator). If categoryId1 is empty then categoryId2 is ignored If specified then filter is applied to categoryId1, categoryId2 and categoryId3 (e.g. 424, 462 and 576 – Toys and Vibrator and Rotating). If categoryId1 or categoryId2 are empty then categoryId3 is ignored If specified then filter is applied to category1 (e.g. ‘Toys’) If specified then filter is applied to category1 and category2 (e.g. ‘Toys’ and ‘Vibrator’). If category1 is empty then category2 is ignored If specified then filter is applied to category1, category2 and category3 (e.g. ‘Toys’, ‘Vibrator’ and ‘Rotating’). If category1 or category2 are empty then category3 is ignored If specified then filter is applied to labelId1 (e.g. 8) If specified then filter is applied to labelId1 and labelId2 If specified then filter is applied to label1 (e.g. TOYJOY) If specified then filter is applied to label1 and label2

Note: categoryId’s and labelId’s are prevailing over corresponding string versions. Please stick to either using Integer types or String types of categories/labels.

Example request Receive Rotating Vibrators by SomeBrand brand { "token":"c17dc66d457257d13fd09a27a27ab7325a93cad2a282515eceae31ceec051def", "categoryId1": 424, "categoryId2": 462, "categoryId3": 576, "label1": "SomeBrand" }

8

Receive all products { "token":"c17dc66d457257d13fd09a27a27ab7325a93cad2a282515eceae31ceec051def" }

Example response Response with 2 products { "7785":{ "productCode":"3000004978", "title":"RABBIT PEARL ROTATING", "isInStock":true, "stockIndicator":5, "isExpiring":false, 9 "priceACP":3499, "priceList":1570, "priceAction":0, "dateActionIn":0, "dateActionOut":0, "label":[31,null,null], "category":[424,462,576], "lastModified":1394788489 }, "7803":{ "productCode":"3000007013", "title":"ECLIPSE ULTRA 7 PENGUITRONIC LAVEND", "isInStock":true, "stockIndicator":5, "isExpiring":false, "priceACP":4999, "priceList":2955, "priceAction":0, "dateActionIn":0, "dateActionOut":0, "label":[31,null,null], "category":[424,462,576], "lastModified":1394788489 } }

9

Product API endpoint https://www.scalaplayhouse.com/api/v1/live/product

Request properties Property productCode

Type String

Description Receive properties of a product

Required Yes

Description SKU

Example request Receive product with SKU 1234567890 { "token":"c17dc66d457257d13fd09a27a27ab7325a93cad2a282515eceae31ceec051def", "productCode": "1234567890" }

Example response { "productCode":"3000004978", "ean":"4890888114083", "title":"RABBIT PEARL ROTATING", "dateRelease":20040531, "dateInStock":20140228, "isInStock":true, "stockIndicator":5, "isExpiring":false, "priceACP":3499, "priceList":1570, "vatNL":"H", "priceAction":0, "dateActionIn":0, "dateActionOut":0, "isNetPrice":false, "imageThumb":["https:\/\/img.scalaplayhouse.com\/import\/b2b_oud\/3000004978\/3000 004978_135x135.jpg"], "imageMedium":["https:\/\/img.scalaplayhouse.com\/import\/b2b_oud\/3000004978\/300 0004978_228x228.jpg"], "imageLarge":["https:\/\/img.scalaplayhouse.com\/import\/b2b_oud\/3000004978\/300000 4978_700x700.jpg"], "video":[""], "description":"", "gender":30, "gender_s":"Unisex", "batteryType":20, 10

"batteryType_s":"2 Batteries AA", "lengthTotal":0, "lengthShaft":170, "diameterIn":0, "diameterOut":40, "isBatteryIncl":false, "isBodysave":false, "isMultifunction":false, "isMultispeed":true, "isOnetouch":false, "isRemote":false, "isStimulating":false, "isVibrating":false, "isWaterproof":false, "size":0, 11 "size_s":"", "composition":"", "genre":[0], "genre_ss":[""], "feature":0, "feature_s":"", "duration":0, "discs":0, "label":[31,null,null], "category":[424,462,576], "lastModified":1394789959 }

11

Stock API endpoint POST https://www.scalaplayhouse.com/api/v1/live/stock

Description Receive stock indication of a single product

Note: in testing endpoint (https://www.scalaplayhouse.com/api/v1/test/stock) API response is different. See examples section below. Request properties Property productCode qty

Type String Integer

Required Yes Yes

Description SKU Product quantity

Example request Receive product with SKU 1234567890 { "token":"c17dc66d457257d13fd09a27a27ab7325a93cad2a282515eceae31ceec051def", "productCode" : "1234567890", "qty":2 }

Example response Product’s stock level is enough for placing an order {"success": true}

12

Order API endpoint POST https://www.scalaplayhouse.com/api/v1/live/order

Description Create an order

Request properties Property address -> firstname -> middlename -> lastname -> street_name -> street_number -> street_addition -> zipcode -> city -> country

Type

Required Description

Object String String String String String String String String String (2)

Yes Yes No Yes Yes Yes No No Yes Yes

shippingMethod

ENUM [“DS2”, “DS3”,”DS4”] Object String Integer String

Yes

Delivery address information First Name Middle Name Last Name Street name House number Address addition Postal Code Name of the city 2-character country code (e.g. ‘NL’ for The Netherlands) Scala Playhouse shipping method

Yes Yes Yes No

Order lines SKU Product quantity Add your reference to this order

items -> productCode -> qty Reference

Example request { "token": "c17dc66d457257d13fd09a27a27ab7325a93cad2a282515eceae31ceec051def", "address": { "firstName":"Ru", "middleName": null, "lastName": "Paul", "streetName": "Rondebeltweg", "streetNumber": "2", "streetAddition": null, "zipCode”: "1329 BA", "city": "Almere", "country": "NL" }, "shippingMethod": "DS2", "items" :[ { "productCode": "1234567890", "qty": 2 },{ "productCode": "1234567891", "qty": 4 } 13

] }

Example response Successful order { "success": true, "orderNumber": "V1234567" }

Failed order { "success": false, "message": "shippingMethod can not be empty" }

14

Status API endpoint POST https://www.scalaplayhouse.com/api/v1/live/status

Request properties Property orderNumber

Type

Required Description

String

Yes

Description Receive order status

Scala Playhouse order number

List of possible order statuses:     

created warehouse completed completed (with track and trace info) blocked

Example request { "token": "c17dc66d457257d13fd09a27a27ab7325a93cad2a282515eceae31ceec051def", "orderNumber" : "V1234567" }

Example response Order is in the picking area { "success": true, "status" : "warehouse" } Order is shipped and track and trace info is available { "success": true, "status” : "completed", "tracktrace" : { "barcode”: "V1234567", "url”: "http://trackyourparcel.eu/.../AW5f456saf6D/", "courier": "trackyourparcel.eu" } }

15

Revisions 0.9

Initial version

0.9.1

Add mention to example code Add reference to order call Corrected an error in the 0.9 documentation, items key should contain an array with items

16