NAV Navbar
shell
  • Introduction
  • SDK for PHP
  • Authentication
  • Products
  • Orders
  • Errors
  • Callbacks
  • Limits
  • Introduction

    Welcome to the weewado API! This documentations shows you how to use the webservice.

    If not done yet, please register at artists.weewado.com to get your auth key.

    SDK for PHP

    Feel free to use our SDK for PHP. Get it on GitHub or through composer.

    https://github.com/weewado/api-sdk
    
    composer require weewado/api-sdk
    

    Authentication

    To authorize, use this code:

    # With shell, you can just pass the correct header with each request
    curl "https://api.weewado.com/v1"
      -H "X-weewado-Key: <yourApiKey>"
    

    Make sure to replace <yourApiKey> with your API key.

    weewado uses API keys to allow access to the API. You can register as an artists at artists.weewado.com.

    The API expects for the API key to be included in all API requests to the server in a header that looks like the following:

    X-weewado-Key: <yourApiKey>

    Products

    Get customizable products

    curl "https://api.weewado.com/v1/Products"
      -H "X-weewado-Key: <yourApiKey>"
    
    curl "https://api.weewado.com/v1/Products/<ID>"
      -H "X-weewado-Key: <yourApiKey>"
    

    The above command returns JSON structured like this:

    {
        "status": 200,
        "message": "List of all products",
        "data": {
            "count": 2,
            "products": [
                {
                    "id": "1",
                    "type": "Canvas Float Frame",
                    "size": "100x100cm",
                    "orientation": "horizontal",
                    "minResolution": "150dpi",
                    "price": {
                        "production": "10.00",
                        "shipping": {
                            "DE": "10.00",
                            "EU": "20.00",
                            "ROW": "30.00"
                        }
                    }
                },
                {
                    "id": "2",
                    "type": "Canvas Float Frame",
                    "size": "200x200cm",
                    "orientation": "horizontal",
                    "minResolution": "150dpi",
                    "price": {
                        "production": "20.00",
                        "shipping": {
                            "DE": "10.00",
                            "EU": "20.00",
                            "ROW": "30.00"
                        }
                    }
                }
            ]
        }
    }
    

    This endpoint retrieves all available products for ordering with your own images.

    HTTP Request

    GET https://api.weewado.com/v1/Products

    GET https://api.weewado.com/v1/Products/<ID>

    Get your designed products

    curl "https://api.weewado.com/v1/MyProducts"
      -H "X-weewado-Key: <yourApiKey>"
    
    curl "https://api.weewado.com/v1/MyProducts/<ID>"
      -H "X-weewado-Key: <yourApiKey>"
    

    The above command returns JSON structured like this:

    {
        "status": 200,
        "message": "List of all your products",
        "data": {
            "count": 1,
            "products": [{
                "id": "100",
                "name": "Your Product Name",
                "versions": [
                    {
                        "id": "200",
                        "type": "Textile Canvas Print",
                        "size": "40x50cm",
                        "orientation": "vertical",
                        "price": {
                            "production": "10.00",
                            "shipping": {
                                "DE": "10.00",
                                "EU": "20.00",
                                "ROW": "30.00"
                            }
                        },
                        "variants": [
                            {
                                "id": 50,
                                "configuration": [{
                                    "option": "Frame Depth",
                                    "value": "2 cm"
                                }]
                            },
                            {
                                "id": 60,
                                "configuration": [{
                                    "option": "Frame Depth",
                                    "value": "4 cm"
                                }]
                            }
                        ]
                    },
                    {
                        "id": "300",
                        "type": "Textile Canvas Print",
                        "size": "60x75cm",
                        "orientation": "vertical",
                        "price": {
                            "production": "20.00",
                            "shipping": {
                                "DE": "10.00",
                                "EU": "20.00",
                                "ROW": "30.00"
                            }
                        },
                        "variants": [
                            {
                                "id": 70,
                                "configuration": [{
                                    "option": "Frame Depth",
                                    "value": "2 cm"
                                }]
                            },
                            {
                                "id": 80,
                                "configuration": [{
                                    "option": "Frame Depth",
                                    "value": "4 cm"
                                }]
                            }
                        ]
                    }
                ]
            }]
        }
    }
    

    This endpoint retrieves all products you created and published.

    HTTP Request

    GET https://api.weewado.com/v1/MyProducts

    GET https://api.weewado.com/v1/MyProducts/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the product

    Orders

    Get orders

    curl "https://api.weewado.com/v1/Orders"
      -H "X-weewado-Key: <yourApiKey>"
    
    curl "https://api.weewado.com/v1/Orders/<ID>"
      -H "X-weewado-Key: <yourApiKey>"
    

    The above command returns JSON structured like this:

    {
        "status": 200,
        "message": "Your orders",
        "data": {
            "count": 2,
            "orders": [
                {
                    "id": "5000",
                    "lastchange": "2017-12-10 23:28:57",
                    "added": "2017-12-10 23:28:57",
                    "reference": "123",
                    "status": "NEW"
                },
                {
                    "id": "5003",
                    "lastchange": "2017-12-10 23:28:38",
                    "added": "2017-12-10 23:28:38",
                    "reference": "999",
                    "status": "OPEN"
                }
            ]
        }
    }
    

    This endpoint retrieves all your placed orders.

    HTTP Request

    GET https://api.weewado.com/v1/Orders

    GET https://api.weewado.com/v1/Orders/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the order

    Create an order

    curl "https://api.weewado.com/v1/Orders"
      -X POST
      -H "X-weewado-Key: <yourApiKey>"
      -H "Content-Type: application/json"
      -d "<jsonData>"
    

    Sample data for an order

    {
        "reference": "123",
        "delivery": {
            "company": "Company",
            "forename": "Forename",
            "surename": "Surename",
            "street": "Street",
            "zip": "12345",
            "city": "City",
            "countryCode": "GB",
            "phone": "+491234567890",
            "email": "mail@mail.com"
        }
    }
    

    The above command returns JSON structured like this:

    {
        "status": 200,
        "message": "New order created",
        "data": {"id": 5000}
    }
    

    This endpoint creates a new order.

    HTTP Request

    POST https://api.weewado.com/v1/Orders

    Add custom product with image upload

    curl "https://api.weewado.com/v1/Orders/<ID>/AddProduct"
      -X POST
      -H "X-weewado-Key: <yourApiKey>"
      -H "Content-Type: application/json"
      -d "<jsonData>"
    

    Sample data for adding a designed product

    {
        "product": 123,
        "file": "https://yourdomain.com/file.jpg",
        "options": {
            "frameSize": "2cm",
            "frameColor": "black",
            "glass": "float",
            "mount": "white"
        }
    }
    

    The above command returns JSON structured like this:

    {
        "status": 200,
        "message": "Custom product added to order 5000",
        "data": {"id": 750}
    }
    

    This endpoint adds a product to your order with a given image upload we can download through a http(s) link. It is important that your image fits the requirements of the product exactly.

    HTTP Request

    https://api.weewado.com/v1/Orders/<ID>/AddProduct

    URL Parameters

    Parameter Description
    ID The ID of the order

    Add ready designed product

    curl "https://api.weewado.com/v1/Orders/<ID>/AddMyProduct"
      -X POST
      -H "X-weewado-Key: <yourApiKey>"
      -H "Content-Type: application/json"
      -d "<jsonData>"
    

    Sample data for adding a designed product from your user account

    {
        "version": 555,
        "variant": 999,
        "quantity": 1
    }
    

    The above command returns JSON structured like this:

    {
        "status": 200,
        "message": "Your product has been added to order 5000",
        "data": {"id": 850}
    }
    

    This endpoint adds one of your already designed products to your order.

    HTTP Request

    POST https://api.weewado.com/v1/Orders/<ID>/AddMyProduct

    URL Parameters

    Parameter Description
    ID The ID of the order

    Submit order

    curl "https://api.weewado.com/v1/Orders/<ID>/Submit"
      -X POST
      -H "X-weewado-Key: <yourApiKey>"
    

    The above command returns JSON structured like this:

    {
        "status": 200,
        "message": "Order 5000 submitted sucessfully",
        "data": []
    }
    

    This endpoint closes an open order and sents it to production.

    HTTP Request

    POST https://api.weewado.com/v1/Orders/<ID>/Submit

    URL Parameters

    Parameter Description
    ID The ID of the order

    Errors

    The weewado API uses the following error codes:

    Error Code Meaning
    400 Bad Request -- Your request has errors.
    401 Unauthorized -- Your API key is wrong.
    403 Forbidden -- You tried to access product, order etc. that is not allowed
    404 Not Found -- The ID you requested was not found
    405 Method Not Allowed -- You tried to access an object with an invalid method.
    406 Not Acceptable -- You requested a format that isn't json.
    410 Gone -- The object requested has been removed from our servers.
    429 Too Many Requests -- Slow down!
    500 Internal Server Error -- We had a problem with our server. Try again later.
    503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

    Callbacks

    Sample callback:

    {
        "order": 5000,
        "status": "Shipped",
        "timestamp": "2017-12-01 14:23:47",
    }
    

    After you submitted your order you can get callbacks to a URL of your choice. Your can set the URL in your account and optionally set a custom header for authentication.

    The request expects a 200 response.

    Status Meaning
    PRODUCTION Your order was sent to production
    FINISHED Your order has been finished
    SHIPPED Your order has been shipped
    CANCELED Your order has been canceled
    INVOICED Your order has been invoiced
    ERROR Your order has errors - please check and resubmit

    Limits

    Requests are limited to 1000 per hour.