Explore and test the APIs provided by Viglietti Sergio. These APIs allow clients to log in, view price lists, order products, and perform other shop functions through the API system.

Authentication

To access the API, you need to authenticate using a Bearer Token . Follow these steps:

  1. Request your Bearer Token from Viglietti staff. This token will be used to authenticate your API requests.
  2. Include the Bearer Token in the Authorization header of your API requests. The header should look like this:
Authorization: Bearer <your-token-here>

Example using cURL:

curl -X GET "https://www.viglietti.com/webservice/me" -H "Authorization: Bearer <your-token-here>"

Replace <your-token-here> with the Bearer Token you received upon logging in. Ensure your token is kept secure and not exposed publicly.

Place Order

To place an order, send a POST request to /webservice/orders with the order details.

The system will automatically retrieve the price based on the product alias and create the order.

The required field represents the number of items to order, and the system will multiply this value by the minimum purchasable quantity (deal) .

For example, required: 5 will result in an order of (5 * deal), and the price will be calculated accordingly.

Example using cURL:

curl -X POST "https://www.viglietti.com/webservice/orders" -H "Authorization: Bearer
<your-token-here>" -H "Content-Type: application/json" -d '{
    "order": {
        "notes": "Some notes about the order",
        "shipping": "2023-07-21",
        "items": [{
            "alias": "BLASF40",
            "required": 5
        }]
    }
}'

Flower Prices

To get the flower price list, send a GET request to /webservice/flowers.

The response will include the price list based on the authenticated user's token, with prices and discounts automatically calculated. You can use the offset and limit parameters to paginate the results, with prices and discounts automatically calculated.

curl -X GET "https://www.viglietti.com/webservice/flowers?offset=0&limit=10" -H "Authorization: Bearer <your-token-here>"

Replace <your-token-here> with the Bearer Token you received upon logging in. Adjust the offset and limit parameters as needed to paginate through the flower price list.

Search Flowers

To search for flowers, send a GET request to /webservice/flowers?search=<query>.

The search can be performed using the article code (alias), description, or category . The response will include the results based on the authenticated user's token prices lists.

curl -X GET "https://www.viglietti.com/webservice/flowers?search=rose&offset=0&limit=10" -H "Authorization: Bearer <your-token-here>"

Replace <your-token-here> with the Bearer Token you received upon logging in. Adjust the offset and limit parameters as needed to paginate through the search results.

System Limitations

Please be aware of the following system limitations:

  • Server allows up to 60 requests per minute per user/address.
  • Pagination is limited to a maximum of 100 items per request.
  • The POST order upload is limited to an array of 100 items.
  • Varchar size limited to a maximum of 100 charter.
  • The system may blacklist an API token if it fails too many requests.