Alve API Access Application no longer accepts requests.

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
is_staff String True when user is a staff member

Retrieve the profile of the authenticated user

  GET /user

GET https://app.ux-alve.st.skroutz.gr/api/user

View Response
Show Headers
Status: 200
{
  "user": {
    "id": 17619,
    "username": "android_alve",
    "avatar": "https://assets.ux-alve.st.skroutz.gr/assets/helmet/avatar_male.png",
    "sex": "male",
    "created_at": "2017-11-09T13:42:40+03:00",
    "email": "android@alve.com",
    "birthyear": 1980,
    "mobile": null,
    "type": "skroutz",
    "stats": {
      "sku_review_count": 0,
      "shop_review_count": 0,
      "sku_comment_count": 0,
      "received_votes": 0
    },
    "email_notifications": [
      {
        "field": "notifications",
        "label": "Genel duyurular",
        "description": "Her ay en fazla bir e-mail ile Alve haberleri hakkında bilgilendirme alın.",
        "enabled": true
      },
      {
        "field": "mail_events",
        "label": "Fiyat düşüşleri",
        "description": "Haftada birkaç e-mail ile favori ürünlerinizdeki önemli fiyat düşüşleri hakkında bilgilendirme alın.",
        "enabled": true
      },
      {
        "field": "sku_review_email",
        "label": "Ürün değerlendirmesi",
        "description": "Ayda en fazla bir kere alacağınız e-mail ile sahip olduğunuz ürünlere ilişkin değerlendirme yaparak diğer kullanıcılara satın alma aşamalarında yardımcı olun.",
        "enabled": true
      },
      {
        "field": "shop_review_email",
        "label": "Mağaza değerlendirmeleri",
        "description": "Haftada en fazla bir kere alacağınız e-mail ile sahip olduğunuz mağazalara ilişkin değerlendirme yaparak diğer kullanıcılara satın alma aşamalarında yardımcı olun.",
        "enabled": true
      }
    ],
    "resend_verification_email": true
  }
}

Update profile information

  PATCH /user

PATCH https://api.alve.com/user

View Response Params
{
  "sex": "male",
  "birthyear": 1980
}
Show Headers
Status: 200
{
  "user": {
    "id": 17619,
    "username": "android_alve",
    "avatar": "https://assets.ux-alve.st.skroutz.gr/assets/helmet/avatar_male.png",
    "sex": "male",
    "created_at": "2017-11-09T13:42:40+03:00",
    "email": "android@alve.com",
    "birthyear": 1980,
    "mobile": null,
    "type": "skroutz",
    "stats": {
      "sku_review_count": 0,
      "shop_review_count": 0,
      "sku_comment_count": 0,
      "received_votes": 0
    },
    "email_notifications": [
      {
        "field": "notifications",
        "label": "Genel duyurular",
        "description": "Her ay en fazla bir e-mail ile Alve haberleri hakkında bilgilendirme alın.",
        "enabled": true
      },
      {
        "field": "mail_events",
        "label": "Fiyat düşüşleri",
        "description": "Haftada birkaç e-mail ile favori ürünlerinizdeki önemli fiyat düşüşleri hakkında bilgilendirme alın.",
        "enabled": true
      },
      {
        "field": "sku_review_email",
        "label": "Ürün değerlendirmesi",
        "description": "Ayda en fazla bir kere alacağınız e-mail ile sahip olduğunuz ürünlere ilişkin değerlendirme yaparak diğer kullanıcılara satın alma aşamalarında yardımcı olun.",
        "enabled": true
      },
      {
        "field": "shop_review_email",
        "label": "Mağaza değerlendirmeleri",
        "description": "Haftada en fazla bir kere alacağınız e-mail ile sahip olduğunuz mağazalara ilişkin değerlendirme yaparak diğer kullanıcılara satın alma aşamalarında yardımcı olun.",
        "enabled": true
      }
    ],
    "resend_verification_email": true
  }
}

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.alve.com/user/avatars

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

Retrieve user addresses

  GET /user/addresses

GET https://api.alve.com/user/addresses

View Response
Show Headers
Status: 200
{
  "addresses": [
    {
      "id": 116,
      "label": "Divan Apartman",
      "full": "Ulus Mahalle  1464 Sok. No. 3 Kat 5 D:13",
      "lng": null,
      "lat": null
    }
  ]
}

Retrieve user address form

  GET /user/addresses/new

GET https://api.alve.com/user/addresses/new

View Response
Show Headers
Status: 200
{
  "address_form": {
    "required": [
      "label",
      "full"
    ]
  }
}

Create a new user address

  POST /user/addresses

POST https://api.alve.com/user/addresses

View Response Params
{
  "label": "Divan Apartman",
  "full": "Ulus Mahalle  1463 Sok. No. 3 Kat 5 D:13"
}
Show Headers
Status: 201
{
  "address": {
    "id": 116,
    "label": "Divan Apartman",
    "full": "Ulus Mahalle  1463 Sok. No. 3 Kat 5 D:13",
    "lng": null,
    "lat": null
  }
}

Update an existing user address

  PUT /user/addresses/48937

PUT https://api.alve.com/user/addresses/116

View Response Params
{
  "full": "Kılıçali Paşa Mahallesi, İstanbul Modern Sanat Müzesi, 34433 Beyoğlu/İstanbul, Türkiye"
}
Show Headers
Status: 200
{
  "address": {
    "id": 116,
    "label": "Divan Apartman",
    "full": "Kılıçali Paşa Mahallesi, İstanbul Modern Sanat Müzesi, 34433 Beyoğlu/İstanbul, Türkiye",
    "lng": "28.984444",
    "lat": "41.026647"
  }
}

Delete an existing user address

  DELETE /user/addresses/48937

DELETE https://api.alve.com/user/addresses/116

View Response
Show Headers
Status: 204

User saved orders

  DELETE /user/saved_orders

GET https://api.alve.com/user/saved_orders

View Response
Show Headers
Status: 200
{
  "saved_orders": [
    {
      "date": "2016-11-22T10:33:27+00:00",
      "products_cost": 2.06,
      "shipping_cost": 5.9,
      "total_cost": 7.960000000000001,
      "line_items": [
        {
          "name": "DK-1511-005/R Digitus Patch Kablo, UTP, CAT. 5E, 0.5 metre, AWG 26/7, Kırmızı Renk, 3P sertifikalı",
          "quantity": 1,
          "price": 2.06,
          "image": null,
          "sku_id": 5909226,
          "product_id": 19436242,
          "category_id": 513
        }
      ],
      "shop_id": 1,
      "order_code": "214304"
    },
    {
      "date": "2016-10-31T13:10:39+00:00",
      "products_cost": 7.5,
      "shipping_cost": 7.99,
      "total_cost": 15.49,
      "line_items": [
        {
          "name": "Inf Cap Girls",
          "quantity": 1,
          "price": 7.5,
          "image": null,
          "sku_id": 5667883,
          "product_id": 18355592,
          "category_id": 334
        }
      ],
      "shop_id": 750,
      "order_code": "176079"
    }
  ],
  "meta": {
    "pagination": {
      "total_results": 2,
      "total_pages": 1,
      "page": 1,
      "per": 25
    }
  }
}

User logout

  DELETE /user/logout

DELETE https://app.ux-alve.st.skroutz.gr/api/user/logout

View Response
Show Headers
Status: 200

Lets the server gracefully handle the logout process.