> ## Documentation Index
> Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an Address

> Creates a new address for the current user.



## OpenAPI

````yaml /api-reference/storefront.yaml post /api/v2/storefront/account/addresses
openapi: 3.0.3
info:
  version: 2.0.0
  title: Storefront 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
security: []
tags:
  - name: Account
  - name: Account / Address
  - name: Account / Credit Cards
  - name: Account / Orders
  - name: Cart
  - name: Cart / Line Items
  - name: Cart / Coupons
  - name: Cart / Other
  - name: Checkout
  - name: Checkout / State
  - name: Checkout / Shipments
  - name: Checkout / Payments
  - name: Checkout / Store Credit
  - name: Stripe
  - name: Adyen
  - name: Countries
  - name: Digital Downloads
  - name: Order Status
  - name: Products
  - name: Variants
  - name: Stores
  - name: Policies
  - name: Taxons
  - name: Vendors
  - name: Wishlists
  - name: Wishlists / Wished Items
paths:
  /api/v2/storefront/account/addresses:
    post:
      tags:
        - Account / Address
      summary: Create an Address
      description: Creates a new address for the current user.
      operationId: create-address
      parameters:
        - $ref: '#/components/parameters/SparseFieldsAddress'
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                address:
                  $ref: '#/components/schemas/AddressPayload'
            examples:
              Create an Address:
                value:
                  address:
                    firstname: Mark
                    lastname: Winterburn
                    company: Paper Street Soap Co.
                    address1: 775 Old Georgetown Road
                    address2: 3rd Floor
                    city: Qethesda
                    phone: '3488545445002'
                    zipcode: '90210'
                    state_name: CA
                    country_iso: US
                    label: Work
      responses:
        '200':
          $ref: '#/components/responses/Address'
        '403':
          $ref: '#/components/responses/403Forbidden'
      security:
        - bearerAuth: []
components:
  parameters:
    SparseFieldsAddress:
      in: query
      name: fields[address]
      example: firstname,lastname,country_name
      description: >-
        Specify the fields you would like returned in the response body. [More
        information](https://jsonapi.org/format/#fetching-sparse-fieldsets).
      schema:
        type: string
  schemas:
    AddressPayload:
      example:
        firstname: John
        lastname: Snow
        address1: 7735 Old Georgetown Road
        address2: 2nd Floor
        city: Bethesda
        phone: '3014445002'
        zipcode: '20814'
        state_name: MD
        country_iso: US
      type: object
      x-internal: false
      title: ''
      x-examples: {}
      description: ''
      properties:
        firstname:
          type: string
        lastname:
          type: string
        address1:
          type: string
          description: Street address
        address2:
          type: string
          description: Additional address information, floor no etc
        city:
          type: string
          description: City, town
        phone:
          type: string
        zipcode:
          type: string
          description: Valid zipcode, will be validated against the selected Country
        state_name:
          type: string
          description: State/region/province 2 letter abbreviation
        country_iso:
          type: string
          description: >-
            Country ISO (2-chars) or ISO3 (3-chars) code. [List of all
            codes](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)
        company:
          type: string
          example: Paper Street Soap Co.
          description: Company name
        label:
          type: string
          example: Work
          description: The internal name for this address (Work, Home)
      required:
        - firstname
        - lastname
        - address1
        - city
        - country_iso
    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
              example: Suite 1
              nullable: true
            city:
              type: string
              example: Mountain View
            zipcode:
              type: string
              example: '94043'
            phone:
              type: string
              example: (+1) 123 456 789
              nullable: true
            state_name:
              type: string
              example: California
            state_code:
              type: string
              example: CA
              description: State abbreviation
              nullable: true
            country_name:
              type: string
              example: United States of America
            country_iso3:
              type: string
              example: USA
              description: Country ISO3 code
            company:
              type: string
              example: Google Inc.
              description: Company name
              nullable: true
            label:
              type: string
              description: The internal name for this address (Work, Home)
              example: Home
              nullable: true
      required:
        - id
        - type
        - attributes
      x-internal: false
  responses:
    Address:
      description: 200 Success - Returns the `address` object.
      content:
        application/vnd.api+json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/Address'
          examples:
            Standard response:
              value:
                data:
                  id: '29'
                  type: address
                  attributes:
                    firstname: Mark
                    lastname: Winterburn
                    address1: 775645 Old Georgetown Road
                    address2: 3rd Floor
                    city: Qethesda
                    zipcode: '90210'
                    phone: '3488545445002'
                    state_name: California
                    company: Paper Street Soap Co.
                    country_name: United States
                    country_iso3: USA
                    country_iso: US
                    label: Work
                    state_code: CA
    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.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        User token to authorize Cart and Checkout requests.

        It is required to associate Cart with the User.

````