Skip to main content
GET
/
api
/
v2
/
storefront
/
account
Retrieve an Account
curl --request GET \
  --url https://demo.spreecommerce.org/api/v2/storefront/account \
  --header 'Authorization: Bearer <token>'
{
  "data": {
    "id": "1",
    "type": "user",
    "attributes": {
      "email": "[email protected]",
      "first_name": "John",
      "last_name": "Doe",
      "selected_locale": "fr",
      "store_credits": 150.75,
      "completed_orders": 3,
      "tags": [
        "<string>"
      ],
      "public_metadata": {
        "user_segment": "supplier"
      }
    },
    "relationships": {
      "default_billing_address": {
        "data": {
          "id": "<string>",
          "type": "<string>"
        }
      },
      "default_shipping_address": {
        "data": {
          "id": "<string>",
          "type": "<string>"
        }
      }
    }
  },
  "included": [
    {
      "id": "1",
      "type": "address",
      "attributes": {
        "firstname": "John",
        "lastname": "Doe",
        "address1": "1600 Amphitheatre Pkwy",
        "address2": "Suite 1",
        "city": "Mountain View",
        "zipcode": "94043",
        "phone": "(+1) 123 456 789",
        "state_name": "California",
        "state_code": "CA",
        "country_name": "United States of America",
        "country_iso3": "USA",
        "company": "Google Inc.",
        "label": "Home"
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

User token to authorize Cart and Checkout requests.

It is required to associate Cart with the User.

Query Parameters

include
string

Pass default_billing_address and/or default_shipping_address as value to include selected addresses information

fields[user]
string

Specify the fields you would like returned in the response body. More information.

Response

200 Success - Returns the user object.

data
User · object
required
included
Address · object[]