Documentazione Rest API

Possibilità di estensioni illimitate! Connetti il tuo software a 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

ParameterDescriptionExample
HTTP Header ParameterREQUIRED. Fixed valueAuthorization: Basic d2FtYWFwcDpteS1zZWNyZXQtdG9rZW4tdG8tY2hhbmdlLWluLXByb2R1Y3Rpb24=
usernameREQUIRED. Your wama account username (registration email)diego@wama.cloud
passwordREQUIRED. Your wama account password (registration password)mysup3rs3cr3tpassw0rdz
grant_typeREQUIRED. Value MUST be set to "password".password
scopeOPTIONAL. The scope of the access requestread 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

ParameterRequiredDescriptionTypeExample
includeRelationsNoIf set to yes returns all the related entities (e.g.: currencies)booleantrue
outOfStockNoIf set to yes returns only the products with quantity zerobooleantrue
pageNoNumber of the page. Page numbers start from 0integertrue
sizeNoNumber of product per pageinteger30
sortNoName of field used to sort the results. Separated by comma the sort direction: 'asc' for ascending order, 'desc' for descending orderstringquantity,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":"diego@diego.it - Point of sale name",
         "company":{
            "id":1,
            "name":"diego@diego.it - 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":"diego@diego.it",
               "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":"diego@diego.it",
            "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!