Spree Commerce Account API

The Account API from Spree Commerce — 1 operation(s) for account.

Operations 3

GET /api/v2/storefront/account Retrieve an Account #
POST /api/v2/storefront/account Create an Account #
PATCH /api/v2/storefront/account Update an Account #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/spree-commerce-account-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

spree-commerce-account-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 2.0.0
  title: Storefront Account API
  description: 'Storefront API is a modern REST API based on the [JSON API spec](https://jsonapi.org/) which provides you with all the necessary endpoints to build amazing user interfaces either in JavaScript frameworks or native mobile libraries.


    Import to [Postman](https://raw.githubusercontent.com/spree/spree/main/docs/api-reference/storefront.yaml)'
  contact:
    name: Vendo Connect Inc.
    url: https://spreecommerce.org
    email: hello@spreecommerce.org
  license:
    name: BSD-3-Clause
    url: https://github.com/spree/spree/blob/main/LICENSE.md
servers:
- url: https://demo.spreecommerce.org
  description: demo
- url: http://localhost:3000
  description: localhost
tags:
- name: Account
paths:
  /api/v2/storefront/account:
    get:
      description: Returns the current user details.
      summary: Retrieve an Account
      tags:
      - Account
      operationId: account-information
      parameters:
      - $ref: '#/components/parameters/AccountIncludeParam'
      - $ref: '#/components/parameters/SparseFieldsUser'
      responses:
        '200':
          $ref: '#/components/responses/User'
        '403':
          $ref: '#/components/responses/403Forbidden'
      security:
      - bearerAuth: []
    post:
      description: Creates a new account
      summary: Create an Account
      tags:
      - Account
      operationId: account-creation
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                user:
                  type: object
                  properties:
                    email:
                      type: string
                      example: john@snow.org
                    first_name:
                      type: string
                      example: John
                    last_name:
                      type: string
                      example: Snow
                    selected_locale:
                      type: string
                      example: en
                    password:
                      type: string
                      example: spree123
                    password_confirmation:
                      type: string
                      example: spree123
                    public_metadata:
                      type: object
                      example:
                        user_segment: supplier
                      description: The public metadata for this User
                    private_metadata:
                      type: object
                      example:
                        has_abandoned_cart: false
                      description: The private metadata for this User
        description: ''
      responses:
        '200':
          $ref: '#/components/responses/User'
        '422':
          $ref: '#/components/responses/422UnprocessableEntity'
    patch:
      description: Updates the users account details
      summary: Update an Account
      tags:
      - Account
      operationId: account-updates
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                user:
                  type: object
                  properties:
                    email:
                      type: string
                      example: john@snow.org
                    first_name:
                      type: string
                      example: John
                    last_name:
                      type: string
                      example: Snow
                    selected_locale:
                      type: string
                      example: fr
                    bill_address_id:
                      type: string
                      example: '1'
                    ship_address_id:
                      type: string
                      example: '1'
                    password:
                      type: string
                      example: spree123
                    password_confirmation:
                      type: string
                      example: spree123
      responses:
        '200':
          $ref: '#/components/responses/User'
        '422':
          $ref: '#/components/responses/422UnprocessableEntity'
      security:
      - bearerAuth: []
components:
  parameters:
    SparseFieldsUser:
      name: fields[user]
      in: query
      description: Specify the fields you would like returned in the response body. [More information](https://jsonapi.org/format/#fetching-sparse-fieldsets).
      schema:
        type: string
      example: email,completed_orders
    AccountIncludeParam:
      name: include
      in: query
      schema:
        type: string
      description: Pass `default_billing_address` and/or `default_shipping_address` as value to include selected addresses information
      example: default_billing_address,default_shipping_address
  schemas:
    Error:
      x-internal: false
      title: Error
      type: object
      properties:
        error:
          type: string
    Address:
      type: object
      title: Address
      description: The Address model holds the customer details, such as name, address, and phone number.
      properties:
        id:
          type: string
          example: '1'
        type:
          type: string
          default: address
        attributes:
          type: object
          properties:
            firstname:
              type: string
              example: John
            lastname:
              type: string
              example: Doe
            address1:
              type: string
              example: 1600 Amphitheatre Pkwy
            address2:
              type:
              - string
              - 'null'
              example: Suite 1
            city:
              type: string
              example: Mountain View
            zipcode:
              type: string
              example: '94043'
            phone:
              type:
              - string
              - 'null'
              example: (+1) 123 456 789
            state_name:
              type: string
              example: California
            state_code:
              type:
              - string
              - 'null'
              example: CA
              description: State abbreviation
            country_name:
              type: string
              example: United States of America
            country_iso3:
              type: string
              example: USA
              description: Country ISO3 code
            company:
              type:
              - string
              - 'null'
              example: Google Inc.
              description: Company name
            label:
              type:
              - string
              - 'null'
              description: The internal name for this address (Work, Home)
              example: Home
      required:
      - id
      - type
      - attributes
      x-internal: false
    Relation:
      type:
      - object
      - 'null'
      properties:
        id:
          type: string
        type:
          type: string
      required:
      - id
      - type
      x-internal: false
      description: ''
    User:
      type: object
      title: User
      description: ' '
      x-internal: false
      properties:
        id:
          type: string
          example: '1'
        type:
          type: string
          default: user
        attributes:
          type: object
          properties:
            email:
              type: string
              example: spree@example.com
            first_name:
              type: string
              example: John
            last_name:
              type: string
              example: Doe
            selected_locale:
              type: string
              example: fr
            store_credits:
              type: number
              example: 150.75
            completed_orders:
              type: number
              example: 3
              description: Number of placed Orders by this User
            tags:
              type: array
              items:
                type: string
              description: List of tags associated with the user
            public_metadata:
              type: object
              example:
                user_segment: supplier
              description: The public metadata for this User
        relationships:
          type: object
          properties:
            default_billing_address:
              type: object
              description: Default billing address associated with this Account
              properties:
                data:
                  $ref: '#/components/schemas/Relation'
            default_shipping_address:
              type: object
              description: Default shipping address associated with this Account
              properties:
                data:
                  $ref: '#/components/schemas/Relation'
      required:
      - id
      - type
      - attributes
      - relationships
  responses:
    403Forbidden:
      description: 403 Forbidden - You are not authorized to access this page.
      content:
        application/vnd.api+json:
          schema:
            properties:
              error:
                type: string
                example: You are not authorized to access this page.
                default: You are not authorized to access this page.
          examples:
            403 Example:
              value:
                error: You are not authorized to access this page.
    User:
      description: 200 Success - Returns the `user` object.
      content:
        application/vnd.api+json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/User'
              included:
                type: array
                items:
                  allOf:
                  - $ref: '#/components/schemas/Address'
            required:
            - data
          examples:
            Standard response:
              value:
                data:
                  id: '1'
                  type: user
                  attributes:
                    email: spree@example.com
                    first_name: John
                    last_name: Snow
                    selected_locale: en
                    store_credits: 0
                    completed_orders: 0
                    tags:
                    - VIP
                    - supplier
                    public_metadata:
                      user_segment: supplier
                  relationships:
                    default_billing_address:
                      data:
                        id: '2'
                        type: address
                    default_shipping_address:
                      data:
                        id: '1'
                        type: address
            Including Addresses:
              value:
                data:
                  id: '1'
                  type: user
                  attributes:
                    email: spree@example.com
                    store_credits: 0
                    completed_orders: 0
                  relationships:
                    default_billing_address:
                      data:
                        id: '2'
                        type: address
                    default_shipping_address:
                      data:
                        id: '1'
                        type: address
                included:
                - id: '2'
                  type: address
                  attributes:
                    firstname: Destiny
                    lastname: Maggio
                    address1: 12775 Runolfsdottir Greens
                    address2: Apt. 704
                    city: Kochmouth
                    zipcode: '16804'
                    phone: 1-257-860-8433
                    state_name: New York
                    company: null
                    country_name: United States
                    country_iso3: USA
                    country_iso: US
                    state_code: NY
                - id: '1'
                  type: address
                  attributes:
                    firstname: Aimee
                    lastname: Jast
                    address1: 56593 Baumbach Meadows
                    address2: Suite 632
                    city: Port Michaelafort
                    zipcode: '16804'
                    phone: (846)556-4478
                    state_name: New York
                    company: null
                    country_name: United States
                    country_iso3: USA
                    country_iso: US
                    state_code: NY
    422UnprocessableEntity:
      description: 422 Unprocessable Entity
      content:
        application/vnd.api+json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            422 Example:
              value:
                error: Example is invalid
                errors:
                  example:
                  - Example is invalid
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'User token to authorize Cart and Checkout requests.


        It is required to associate Cart with the User.'
    orderToken:
      type: apiKey
      in: header
      description: 'Order token to authorize Cart and Checkout requests.


        [How to obtain X-Spree-Order-Token](../authentication#for-guest-users)'
      name: X-Spree-Order-Token