User Profile Edit the file on GitHub

Provides information about Users.

Table of Contents

Field Guide

Field Type Description
id Number The unique identifier reference to the resource
username String The username of the user
type String The type of the account. Possible values: "skroutz", "open_id", "twitter", "facebook", "google"
sex String "male" or "female" or null
avatar String URI of the avatar image of the user
created_at String Account creation date
email String The email of the user
birthyear Number The birthyear of the user
mobile String The mobile number of the user
stats Hash Review / comment related stats
email_notifications Array Available email preferences and their status

Retrieve the profile of the authenticated user

  GET /user

GET https://api.skroutz.gr/user

View Response
Show Headers
Status: 200
{
  "user": {
    "id": 1337,
    "username": "tester",
    "avatar": "https://a.scdn.gr/assets/helmet/avatar_male.png",
    "sex": null,
    "created_at": "2015-11-30T12:21:00+02:00",
    "email": "test@skroutz.gr",
    "birthyear": null,
    "mobile": "6912345678",
    "type": "skroutz",
    "stats": {
      "sku_review_count": 3,
      "shop_review_count": 2,
      "sku_comment_count": 0,
      "received_votes": 4
    },
    "email_notifications": [
      {
        "field": "notifications",
        "label": "Γενικές ενημερώσεις",
        "description": "Για να λαμβάνεις τα νέα του Skroutz. Το πολύ ένα email το μήνα.",
        "enabled": true
      },
      {
        "field": "mail_events",
        "label": "Πτώσεις τιμών",
        "description": "Σημαντικές πτώσεις τιμών στα αγαπημένα σου προϊόντα. Μερικά email την εβδομάδα.",
        "enabled": false
      },
      {
        "field": "sku_review_email",
        "label": "Αξιολόγηση προϊόντος",
        "description": "Για να βοηθήσεις άλλους χρήστες αξιολογώντας προϊόντα που έχεις. Το πολύ ένα email το μήνα.",
        "enabled": true
      },
      {
        "field": "shop_review_email",
        "label": "Αξιολογήσεις καταστημάτων",
        "description": "Για να βοηθήσεις άλλους χρήστες αξιολογώντας καταστήματα από τα οποία έχεις αγοράσει. Το πολύ ένα email την εβδομάδα.",
        "enabled": true
      },
      {
        "field": "smart_cart_email",
        "label": "Έξυπνο καλάθι",
        "description": "Ειδοποιήσεις σχετικά με το καλάθι σου. Μερικά emails τον μήνα.",
        "enabled": true
      }
    ],
    "loyalty_tier_level": 1,
    "total_acquired_points": 3257
  }
}

Update profile information

  PATCH /user

PATCH https://api.skroutz.gr/user

View Response Params
{
  "sex": "male",
  "birthyear": 1980
}
Show Headers
Status: 200
{
  "user": {
    "id": 1337,
    "username": "test",
    "avatar": "https://a.scdn.gr/assets/helmet/avatar_male.png",
    "sex": "male",
    "created_at": "2015-11-30T12:21:00+02:00",
    "email": "test@skroutz.gr",
    "birthyear": 1980,
    "mobile": "6912345678",
    "type": "skroutz",
    "stats": {
      "sku_review_count": 3,
      "shop_review_count": 2,
      "sku_comment_count": 0,
      "received_votes": 4
    },
    "email_notifications": [
      {
        "field": "notifications",
        "label": "Γενικές ενημερώσεις",
        "description": "Για να λαμβάνεις τα νέα του Skroutz. Το πολύ ένα email το μήνα.",
        "enabled": true
      },
      {
        "field": "mail_events",
        "label": "Πτώσεις τιμών",
        "description": "Σημαντικές πτώσεις τιμών στα αγαπημένα σου προϊόντα. Μερικά email την εβδομάδα.",
        "enabled": false
      },
      {
        "field": "sku_review_email",
        "label": "Αξιολόγηση προϊόντος",
        "description": "Για να βοηθήσεις άλλους χρήστες αξιολογώντας προϊόντα που έχεις. Το πολύ ένα email το μήνα.",
        "enabled": true
      },
      {
        "field": "shop_review_email",
        "label": "Αξιολογήσεις καταστημάτων",
        "description": "Για να βοηθήσεις άλλους χρήστες αξιολογώντας καταστήματα από τα οποία έχεις αγοράσει. Το πολύ ένα email την εβδομάδα.",
        "enabled": true
      },
      {
        "field": "smart_cart_email",
        "label": "Έξυπνο καλάθι",
        "description": "Ειδοποιήσεις σχετικά με το καλάθι σου. Μερικά emails τον μήνα.",
        "enabled": true
      }
    ],
    "loyalty_tier_level": 1,
    "total_acquired_points": 3257
  }
}

The avatar can be changed with the following 2 ways

avatar_preset: Filename from the avatar selection returned in the Avatars endpoint (ex: "avatar100.png").
avatar: Base64 form of an avatar image

Note

You should not add the URI format preamble in the base64 version. (ex: data:image/gif;base64,)

Retrieve the selection of predefined avatars

  GET /user/avatars

GET https://api.skroutz.gr/user/avatars

View Response
Show Headers
Status: 200
{
  "avatars": [
    "https://www.skroutz.gr/images/avatars/default/avatar26.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar19.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar23.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar25.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar28.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar4.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar15.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar21.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar29.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar7.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar6.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar18.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar14.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar32.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar24.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar8.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar9.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar10.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar1.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar5.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar30.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar22.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar33.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar35.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar12.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar2.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar3.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar11.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar17.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar20.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar27.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar31.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar34.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar16.jpg",
    "https://www.skroutz.gr/images/avatars/default/avatar13.jpg"
  ]
}

Retrieve user addresses

  GET /user/addresses

GET https://api.skroutz.gr/user/addresses

View Response
Show Headers
Status: 200
{
  "addresses": [
    {
      "id": 25522,
      "label": "Αλέκου Παναγούλη 91, Νέα Ιωνία",
      "first_name": "Βασίλης",
      "last_name": "Τεστοπουλος",
      "street_name": "Αλέκου Παναγούλη",
      "street_number": "91",
      "city": "Νέα Ιωνία",
      "zip": "14234",
      "region": "Αττικής",
      "phone": "",
      "mobile": "6941234567",
      "lng": "23.760006",
      "lat": "38.043322"
    }
  ]
}

Retrieve user address form

  GET /user/addresses/new

GET https://api.skroutz.gr/user/addresses/new

View Response
Show Headers
Status: 200
{
  "address_form": {
    "required": [
      "label",
      "first_name",
      "last_name",
      "street_name",
      "street_number",
      "city",
      "zip",
      "region_id"
    ],
    "optional": [
      "phone",
      "mobile"
    ],
    "regions": {
      "Αιτωλοακαρνανίας": 1,
      "Αργολίδας": 2,
      "Αρκαδίας": 3,
      "Άρτας": 4,
      "Αττικής": 5,
      "Αχαΐας": 6,
      "Βοιωτίας": 7,
      "Γρεβενών": 8,
      "Δράμας": 9,
      "Δωδεκανήσου": 10,
      "Έβρου": 11,
      "Έβρου (Σαμοθράκη)": 53,
      "Εύβοιας": 13,
      "Εύβοιας (Σκύρος)": 52,
      "Ευρυτανίας": 12,
      "Ζακύνθου": 14,
      "Ηλείας": 15,
      "Ημαθίας": 16,
      "Ηρακλείου": 17,
      "Θεσπρωτίας": 18,
      "Θεσσαλονίκης": 19,
      "Ιωαννίνων": 20,
      "Καβάλας": 21,
      "Καβάλας (Θάσος)": 57,
      "Καρδίτσας": 22,
      "Καστοριάς": 23,
      "Κέρκυρας": 24,
      "Κεφαλληνιάς": 25,
      "Κιλκίς": 26,
      "Κοζάνης": 27,
      "Κορινθίας": 28,
      "Κυκλάδων": 29,
      "Λακωνίας": 30,
      "Λάρισας": 31,
      "Λασιθίου": 32,
      "Λέσβου": 33,
      "Λευκάδας": 34,
      "Μαγνησίας": 35,
      "Μαγνησίας (Αλόννησος)": 56,
      "Μαγνησίας (Σκιάθος)": 55,
      "Μαγνησίας (Σκόπελος)": 54,
      "Μεσσηνίας": 36,
      "Ξάνθης": 37,
      "Πέλλας": 38,
      "Πιερίας": 39,
      "Πρέβεζας": 40,
      "Ρεθύμνης": 41,
      "Ροδόπης": 42,
      "Σάμου": 43,
      "Σερρών": 44,
      "Τρικάλων": 45,
      "Φθιώτιδας": 46,
      "Φλώρινας": 47,
      "Φωκίδας": 48,
      "Χαλκιδικής": 50,
      "Χανίων": 51,
      "Χίου": 49
    }
  }
}

Create a new user address

  POST /user/addresses

POST https://api.skroutz.gr/user/addresses

View Response Params
{
  "label": "home",
  "first_name": "bill",
  "last_name": "Testopoulos",
  "street_name": "Panagouli",
  "street_number": "61",
  "city": "Nea Ionia",
  "zip": 14123,
  "region_id": 5
}
Show Headers
Status: 201
{
  "address": {
    "id": 48937,
    "label": "home",
    "first_name": "bill",
    "last_name": "Testopoulos",
    "street_name": "Panagouli",
    "street_number": "61",
    "city": "Nea Ionia",
    "zip": "14123",
    "region": "Αττικής",
    "phone": null,
    "mobile": null,
    "lng": null,
    "lat": null
  }
}

Update an existing user address

  PUT /user/addresses/48937

PUT https://api.skroutz.gr/user/addresses/48937

View Response Params
{
  "street_number": "62"
}
Show Headers
Status: 200
{
  "address": {
    "id": 48937,
    "label": "home",
    "first_name": "bill",
    "last_name": "Testopoulos",
    "street_name": "Panagouli",
    "street_number": "62",
    "city": "Nea Ionia",
    "zip": "14123",
    "region": "Αττικής",
    "phone": null,
    "mobile": null,
    "lng": null,
    "lat": null
  }
}

Delete an existing user address

  DELETE /user/addresses/48937

DELETE https://api.skroutz.gr/user/addresses/48937

View Response
Show Headers
Status: 204

User saved orders

  DELETE /user/saved_orders

GET http://api.skroutz.gr/api/user/saved_orders

View Response
Show Headers
Status: 200
{
  "saved_orders": [
    {
      "date": "2017-10-06T11:37:36+00:00",
      "products_cost": 21.0,
      "shipping_cost": 5.0,
      "total_cost": 26.0,
      "line_items": [
        {
          "name": "Φίμωτρο Flex Σιλικόνης XL Trixie 39cm",
          "quantity": 1,
          "price": 21.0,
          "image": "https://d.scdn.gr/images/sku_main_images/012831/12831032/medium_20170920075526_fimotro_flex_silikonis_xl_trixie_39cm.jpeg",
          "sku_id": 12831032,
          "product_id": 31088776,
          "category_id": 1665
        }
      ],
      "shop_id": 4163,
      "order_code": "935812"
    },
    {
      "date": "2017-06-16T08:20:33+00:00",
      "products_cost": 441.2,
      "shipping_cost": 0.0,
      "total_cost": 441.2,
      "line_items": [
        {
          "name": "HUAWEI P10 64GB GRAPHITE BLACK EU",
          "quantity": 1,
          "price": 433.2,
          "image": "https://b.scdn.gr/images/sku_main_images/011407/11407671/medium_20170711142032_huawei_p10_64gb.jpeg",
          "sku_id": 11407671,
          "product_id": 28419471,
          "category_id": 40
        },
        {
          "name": "Θήκη για Huawei P10 TPU Clear",
          "quantity": 1,
          "price": 8.0,
          "image": null,
          "sku_id": null,
          "product_id": null,
          "category_id": null
        }
      ],
      "shop_id": 1521,
      "order_code": "229100"
    }
  ],
  "meta": {
    "pagination": {
      "total_results": 2,
      "total_pages": 1,
      "page": 1,
      "per": 25
    }
  }
}

User logout

  DELETE /user/logout

DELETE https://api.skroutz.gr/user/logout

View Response
Show Headers
Status: 200

Lets the server gracefully handle the logout process.