Retrieve default shipping address for the given customerId

GET /V1/customers/{customerId}/shippingAddress

Retrieve default shipping address for the given customerId.

Path parameters

  • customerId integer Required

Responses

  • 200

    200 Success.

    Hide response attributes Show response attributes object
    • id integer

      ID

    • customer_id integer

      Customer ID

    • region object

      Customer address region interface.

      Hide region attributes Show region attributes object
      • region_code string Required

        Region code

      • region string Required

        Region

      • region_id integer Required

        Region id

      • extension_attributes object

        ExtensionInterface class for @see \Magento\Customer\Api\Data\RegionInterface

    • region_id integer

      Region ID

    • country_id string

      Country code in ISO_3166-2 format

    • street array[string]

      Street

    • company string

      Company

    • telephone string

      Telephone number

    • fax string

      Fax number

    • postcode string

      Postcode

    • city string

      City name

    • firstname string

      First name

    • lastname string

      Last name

    • middlename string

      Middle name

    • prefix string

      Prefix

    • suffix string

      Suffix

    • vat_id string

      Vat id

    • default_shipping boolean

      If this address is default shipping address.

    • default_billing boolean

      If this address is default billing address

    • extension_attributes object

      ExtensionInterface class for @see \Magento\Customer\Api\Data\AddressInterface

    • custom_attributes array[object]

      Interface for custom attribute value.

      Interface for custom attribute value.

      Hide custom_attributes attributes Show custom_attributes attributes object
      • attribute_code string Required

        Attribute code

      • value string Required

        Attribute value

  • 401

    401 Unauthorized

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Error details

      Hide errors attributes Show errors attributes object
      • message string

        Error message

      • parameters array[object]

        Error parameters item

        Error parameters item

        Hide parameters attributes Show parameters attributes object
        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Error parameters item

      Hide parameters attributes Show parameters attributes object
      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

  • 400

    400 Bad Request

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Error details

      Hide errors attributes Show errors attributes object
      • message string

        Error message

      • parameters array[object]

        Error parameters item

        Error parameters item

        Hide parameters attributes Show parameters attributes object
        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Error parameters item

      Hide parameters attributes Show parameters attributes object
      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

  • 500

    Internal Server error

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Error details

      Hide errors attributes Show errors attributes object
      • message string

        Error message

      • parameters array[object]

        Error parameters item

        Error parameters item

        Hide parameters attributes Show parameters attributes object
        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Error parameters item

      Hide parameters attributes Show parameters attributes object
      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

  • default

    Unexpected error

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Error details

      Hide errors attributes Show errors attributes object
      • message string

        Error message

      • parameters array[object]

        Error parameters item

        Error parameters item

        Hide parameters attributes Show parameters attributes object
        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Error parameters item

      Hide parameters attributes Show parameters attributes object
      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

GET /V1/customers/{customerId}/shippingAddress
curl \
 --request GET 'https://magento2.winkelstraat.mac/rest/all/V1/customers/{customerId}/shippingAddress'
Response examples (200)
{
  "id": 42,
  "customer_id": 42,
  "region": {
    "region_code": "string",
    "region": "string",
    "region_id": 42,
    "extension_attributes": {}
  },
  "region_id": 42,
  "country_id": "string",
  "street": [
    "string"
  ],
  "company": "string",
  "telephone": "string",
  "fax": "string",
  "postcode": "string",
  "city": "string",
  "firstname": "string",
  "lastname": "string",
  "middlename": "string",
  "prefix": "string",
  "suffix": "string",
  "vat_id": "string",
  "default_shipping": true,
  "default_billing": true,
  "extension_attributes": {},
  "custom_attributes": [
    {
      "attribute_code": "string",
      "value": "string"
    }
  ]
}
Response examples (401)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}
Response examples (400)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}
Response examples (500)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}
Response examples (default)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}