Getting started

To begin using the ShopWeDo REST API version 1.0, follow the steps below.

  1. Get your personal access ID and key at support@shopwedo.com.
  2. Read the authentication documentation to create an authentication token.

Any requests should always contain the property "auth".
For POST requests also include the property "data".

{
    "auth": {}, // authentication token
    "data": {} // explained in the methods
}
HOST http://shopwedo.com/admin/api

All requests use this host.

Support

If you need any assistance, feel free to contact us at support@shopwedo.com

  Response codes

Following are the HTTP response codes our API may return.

Code
Status
Description

200

OK

It worked!

201

Created

The creation was successfully. The body should contain response content.

202

Accepted

When using POST /authTest, this response code indicates that the auth_token is valid.

400

Bad request

The request was invalid or empty. You may be missing a required argument or provided bad data. An error message will be returned explaining what happened.

401

Unauthorized

The Authentication required you provided is invalid.

  Authentication

POST /authTest

Method for creating an authentication token in HMAC SHA-512.
The post is only for testing the auth creation.
A authentication token older then 15 minutes will be rejected.

Request

Type
Property
Required?
Description

integer

shopid

 Required

Your own shop ID

timestamp

timestamp

 Required

The current Unix timestamp. A timestamp can not be older than 15 minutes and can not be in the future.

string

salt

 Required

A unique string.

string

token

 Required

A unique hash HMAC SHA-512 encrypted string of the concatenation of the shop ID, shop KEY, timestamp and salt.

Response

202 no content

401 application/json

The authentication you provided is invalid. An error message will be returned explaining what happened.

{
    "error": "Oops!"
}

  Create order

POST /createOrder

ONLY AVAILABLE FOR AUTHORIZED TESTS
Creates a new order.
Authentication required.

Request

Type
Property
Required?
Description

string

order_id

 Required

Your unique order number.

timestamp

created_at

 Required

The timestamp when your order was created. Format YYY-mm-dd H:i:s.

timestamp

update_at

The timestamp when your order was last updated. Format YYY-mm-dd H:i:s.

object

billing_address

An object containning the buyer's address.
If not given, then the shipping address will be used.

string

  firstname

The receiver's first name.

string

  lastname

The receiver's last name.

string

  company

The receiver's company name.

string

  vat

The receiver's VAT number.

string

  street

 Required

The receiver's street name.

string

  number

 Required

The receiver's house number.

string

  box

The receiver's box number.

string

  zip

 Required

The receiver's zip code.

string

  city

 Required

The receiver's city.

string

  country_iso2

 Required

The receiver's country ISO code in 2 characters.

string

  email

 Required

The receiver's email address.

string

  phone

 Required

The receiver's phone number.

object

shipping_address

 Required

An object containning the receiver's address.

string

  firstname

The receiver's first name.

string

  lastname

The receiver's last name.

string

  company

The receiver's company name.

string

  vat

The receiver's VAT number.

string

  street

 Required

The receiver's street name.

string

  number

 Required

The receiver's house number.

string

  box

The receiver's box number.

string

  zip

 Required

The receiver's zip code.

string

  city

 Required

The receiver's city.

string

  country_iso2

 Required

The receiver's country ISO code in 2 characters.

string

  email

 Required

The receiver's email address.

string

  phone

 Required

The receiver's phone number.

array

items

 Required

A box for each item

object

  [item]

 Required

Each orderline represents a item object. At least one is required.

integer

   sku

 Required

Our SKU ID

integer

   amount

 Required

Amount ordered of this stock item

Response

201 application/json

A new order is successfully created.

Type
Property
Required?
Description

integer

order_id

 Required

The ShopWeDo order ID is returned when the order is created

{
    "order_id": 123
}

400 application/json

The request was invalid or empty. You may be missing a required argument or provided bad data.

{
    "error": "Oops!"
}

  Cancel order

POST /cancelOrder

ONLY AVAILABLE FOR AUTHORIZED TESTS
Cancels an order.
Authentication required.

Request

Type
Property
Required?
Description

string

order_id

 Required

Your unique order number.

Response

200 no content

The order is successfully cancelled.

400 no content

The request was invalid or the order fulfilment is started or fulfilment is done.

  Get products

POST /getProducts

Get one or more products.
Authentication required.

Request

Type
Property
Required?
Description

integer|array

product_id

The ID of a specific product or an array of IDs.

integer|array

category_id

The ID of a specific category or an array of IDs.

integer

offset

The page offset, start from 0, limited by 100 items. If not given, all data wil be returned.

Response

200 no content

An array with product data is returned.

Type
Property
Required?
Description

integer

product_id

 Required

The ID of a product

integer

product_parent_id

 Required

If the product is a child (variant), than the parent product ID is given.

integer

sku

 Required

The ID of the connected inventory's item

object

name

 Required

The name of th product in different languages

string

  nl

 Required

The name of th product in dutch

string

  fr

 Required

The name of th product in french

string

  en

 Required

The name of th product in english

string

  de

 Required

The name of th product in german

object

description

 Required

The description of th product in different languages

string

  nl

 Required

The description of th product in dutch

string

  fr

 Required

The description of th product in french

string

  en

 Required

The description of th product in english

string

  de

 Required

The description of th product in german

double

price

 Required

The price of the product ex VAT.

double

VAT

 Required

The VAT of the product

array

promotions

If the product has promotions, it's given here.

object

  promotion

 Required

The promotion.

double

   price

 Required

The discount value.

date

   start

 Required

The start date of the promotion in format YYYY-mm-dd

date

   end

 Required

The end date of the promotion in format YYYY-mm-dd

integer

status

 Required

The product's status. 1: online, 2: out-of-stock, 0: offline

object

extra_handling

If the product has a extra handling, it's given here.

double

  price

 Required

The extra handling value.

object

  description

 Required

The description of the axtra handling in different languages.

string

   nl

 Required

The description of the axtra handling in dutch.

string

   fr

 Required

The description of the axtra handling in french.

string

   en

 Required

The description of the axtra handling in english.

string

   de

 Required

The description of the axtra handling in german.

string

barcode

The barcode of the inverntory item.

integer

ATP

 Required

the Available-To-Promise value of the inverntory item.

double

weight

The inverntory item's weigth in grams.

integer

sort

 Required

The sort / order of the product.

boolean

is_featured

 Required

Whether the product is a featured as a homepage product.

boolean

is_virtual

 Required

Whether the product is a virtual product.

boolean

is_nostock

 Required

Whether the product can be sold withoud stock.

array

images

 Required

The product's images. The first in the array is the main image.

object

  img

 Required

Each image is represented as an object with information.

string

   src

 Required

The link to the image.

string

   alt

 Required

The alt text of the image.

integer

   product_child_id

If the image is assined to a specific product's variant, its ID is given here.

array

categories

 Required

The product's categories.

object

  category

 Required

Each category is represented as an object with information.

integer

   id

 Required

The ID of the category.

object

   name

 Required

The name of th category in different languages

string

    nl

 Required

The name of th category in dutch

string

    fr

 Required

The name of th category in french

string

    en

 Required

The name of th category in english

string

    de

 Required

The name of th category in german

array

childs

An array of the product IDs from the childs / variants of the product.

array

related_products

An array of the product IDs related to this product.

400 no content

The request was invalid or empty. You may be missing a required argument or provided bad data.

  Get categories

POST /getCategories

Get one or more categories.
Authentication required.

Request

Type
Property
Required?
Description

integer|array

category_id

The ID of a specific category or an array of IDs.

integer

offset

The page offset, start from 0, limited by 100 items. If not given, all data wil be returned.

Response

200 no content

An array with categorie data is returned.

Type
Property
Required?
Description

integer

category_id

 Required

The ID of a category

integer

category_parent_id

 Required

If the category is a child, than the parent category ID is given.

object

name

 Required

The name in different languages

string

  nl

 Required

The name in dutch

string

  fr

 Required

The name in french

string

  en

 Required

The name in english

string

  de

 Required

The name in german

object

description

 Required

The description in different languages

string

  nl

 Required

The description in dutch

string

  fr

 Required

The description in french

string

  en

 Required

The description in english

string

  de

 Required

The description in german

integer

sort

 Required

The sort / order of the category.

object

images

 Required

The category's images.

string

  foreground|background|product

 Required

The link to the image.

integer

status

 Required

The product's status. 1: online, 2: out-of-stock, 0: offline

array

childs

An array of the child IDs.

400 no content

The request was invalid or empty. You may be missing a required argument or provided bad data.

  Get blog posts

POST /getBlogPosts

Get one or more blog posts.
Authentication required.

Request

Type
Property
Required?
Description

integer|array

post_id

The ID of a specific blog post or an array of IDs.

integer

offset

The page offset, start from 0, limited by 100 items. If not given, all data wil be returned.

Response

200 no content

An array with blog post data is returned.

Type
Property
Required?
Description

integer

post_id

 Required

The ID of a blog post

string

title

 Required

The title of the blog post

string

content

 Required

The HTML content of the blog post

string

language

 Required

The language of the blog post

string

date

 Required

The date of the blog post in format Y-m-d H:i:s

string

image

The link to the image.

integer

status

 Required

The blog post's status. 1: online, 0: offline

400 no content

The request was invalid or empty. You may be missing a required argument or provided bad data.

  Get shipper add label

GET http://shopwedo.com/admin/shipper/add?ext=manual

URL with parameters to prefill the form.
API authentication is not required, but you should be logged in into the admin section.

Request

Type
Property
Required?
Description

string

trackingReference

A custom reference for this shipment; eg. an order ID. Accepts: a-z, A-Z, 0-9, -, _

string

addressFirstname

The firstname of the reciever. Field is not mandatory, but one of fistname, lastname or company name should be filled in.

string

addressLastname

The lastname of the reciever. Field is not mandatory, but one of fistname, lastname or company name should be filled in.

string

addressCompany

The company's name of the reciever. Field is not mandatory, but one of fistname, lastname or company name should be filled in.

string

addressEmail

 Required

The email address of the reciever.

string

addressPhone

The phone number of the reciever. Field is only mandatory non-EU countries.

string

addressStreet

 Required

The street of the reciever.

string

addressNumber

 Required

The house number of the reciever.

string

addressBox

The box number of the reciever.

string

addressZip

 Required

The zip code of the reciever.

string

addressCity

 Required

The city of the reciever.

string

addressCountry

 Required

The country's ISO code of the reciever. Default: BE

string

addressLanguage

 Required

The language of the reciever. Choose from: nl, fr, en or de. Default: nl