Rest API Documentation

Unlimited extensibility! Connect your code with WAMA.


Example clients

Access our Github account and get the example code to create a custom client for WAMA. Available now the PHP client. Clients in other languages are coming soon.
https://github.com/fullstack3

Authentication

WAMA provides the OAuth2 authentication mechanism, in particular is used the Resource Owner Password Credential Grant type, more information can be found here https://tools.ietf.org/html/rfc6749#section-4.3

OAuth Token

Every REST request have to include as header parameter the access token, to get the access token you need to use your credential and send a POST request to the following URL. More info here https://tools.ietf.org/html/rfc6749#section-2.3.1
post
/oauth/token

Parameters

Parameter Description Example
HTTP Header Parameter REQUIRED. Fixed value Authorization: Basic d2FtYWFwcDpteS1zZWNyZXQtdG9rZW4tdG8tY2hhbmdlLWluLXByb2R1Y3Rpb24=
username REQUIRED. Your wama account username (registration email) [email protected]
password REQUIRED. Your wama account password (registration password) mysup3rs3cr3tpassw0rdz
grant_type REQUIRED. Value MUST be set to "password". password
scope OPTIONAL. The scope of the access request read write

Request example

curl 'https://www.wama.cloud/oauth/token' -H 'Authorization: Basic d2FtYWFwcDpteS1zZWNyZXQtdG9rZW4tdG8tY2hhbmdlLWluLXByb2R1Y3Rpb24=' --data 'username=diego%40wama.cloud&password=mysup3rs3cr3tpassw0rdz&grant_type=password&scope=read%20write'

Coming soon!

Response

{
"access_token":"68f0223b-4202-123l-fw43-8d29ff6c5bc3",
"token_type":"bearer",
"refresh_token":"52b19623-ad7c-4ec0-bd7e-882gd254c072",
"expires_in":1203479,
"scope":"read write"
}
All the request to the subsequent resources must contain the access token as header in the following format: 'Authorization: Bearer <access token>'

Product

Get all products with pagination
GET

Parameters

Parameter Required Description Type Example
includeRelations No If set to yes returns all the related entities (e.g.: currencies) boolean true
outOfStock No If set to yes returns only the products with quantity zero boolean true
page No Number of the page. Page numbers start from 0 integer true
size No Number of product per page integer 30
sort No Name of field used to sort the results. Separated by comma the sort direction: 'asc' for ascending order, 'desc' for descending order string quantity,desc

Request example

curl 'https://www.wama.cloud/api/products?cacheBuster=1478650298175&includeRelations=true&outOfStock=false&page=0&size=20&sort=timeModified,desc&sort=id' -H 'Authorization: Bearer 68ea923b-4203-459a-92ea-8d29866c5bc3'

Coming soon!

Response

[
   {
      "id":11,
      "code":null,
      "activated":true,
      "name":null,
      "description":null,
      "barcode":"123",
      "quantity":1E+1,
      "quantityReserved":0,
      "photo":null,
      "timeCreated":"2016-11-08T00:08:01.000Z",
      "timeModified":"2016-11-08T00:08:06.000Z",
      "pointOfSale":{
         "id":1,
         "name":"[email protected] - Point of sale name",
         "company":{
            "id":1,
            "name":"[email protected] - Company name",
            "timeCreated":"2016-10-27T18:34:26.000Z",
            "address":{
               "id":1,
               "line1":null,
               "line2":null,
               "line3":null,
               "taxRegistrationNumber":null,
               "phone1":null,
               "phone2":null,
               "email":"[email protected]",
               "city":"Napoli",
               "postcode":null,
               "longitude":null,
               "latitude":null,
               "defaultAddress":null,
               "deliveryAddress":null,
               "paymentAddress":null,
               "historical":null,
               "country":{
                  "id":77,
                  "code":"GB",
                  "name":"United Kingdom",
                  "icon":null,
                  "currencies":null,
                  "taxInfos":null,
                  "langs":null
               }
            },
            "users":null
         },
         "address":{
            "id":1,
            "line1":null,
            "line2":null,
            "line3":null,
            "taxRegistrationNumber":null,
            "phone1":null,
            "phone2":null,
            "email":"[email protected]",
            "city":"Napoli",
            "postcode":null,
            "longitude":null,
            "latitude":null,
            "defaultAddress":null,
            "deliveryAddress":null,
            "paymentAddress":null,
            "historical":null,
            "country":{
               "id":77,
               "code":"GB",
               "name":"United Kingdom",
               "icon":null,
               "currencies":null,
               "taxInfos":null,
               "langs":null
            }
         },
         "paymentMethods":null,
         "users":null,
         "currencies":null,
         "timezone":null
      },
      "categories":null,
      "prices":[

      ],
      "photoRaw":null
   }
]

We apologise for the incompleteness of the documentation. We are working hard to complete the documentation and many other new features. Thank you for your patience!