Skip to Content
0
Jul 28, 2020 at 11:16 AM

How to set shippingAddress flag field and companyName field of an address entity?

38 Views

The OCC v2 API documentation [1] shows Address creation, update and patch APIs.


One strange thing in those APIs is that the request body [2] does accept neither shippingAddress?: boolean property nor companyName property whereas the response body [3] contains them.
How are developers supposed to set the shippingAddress flag field and companyName field of an address entity to true or false through OCC v2 API invocations?

[1] https://help.sap.com/doc/6dfaf37b026442278f45fca5e2a33c56/6.0.0.0/en-US/ycommercewebservices/main.html#_users__userId__addresses_post
[2] Request body json schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "AddressWsDTO",
  "type": "object",
  "properties":
  {
    "titleCode":
    {
      "type": "string"
    },
    "firstName":
    {
      "type": "string"
    },
    "lastName":
    {
      "type": "string"
    },
    "line1":
    {
      "type": "string"
    },
    "line2":
    {
      "type": "string"
    },
    "town":
    {
      "type": "string"
    },
    "region":
    {
      "type": "object",
      "properties":
      {
        "isocode":
        {
          "type": "string"
        }
      }
    },
    "postalCode":
    {
      "type": "string"
    },
    "country":
    {
      "type": "object",
      "properties":
      {
        "isocode":
        {
          "type": "string"
        }
      }
    }
  }
}

[3] Response body json schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "AddressWsDTO",
  "type": "object",
  "properties":
  {
    "id":
    {
      "type": "string"
    },
    "title":
    {
      "type": "string"
    },
    "titleCode":
    {
      "type": "string"
    },
    "firstName":
    {
      "type": "string"
    },
    "lastName":
    {
      "type": "string"
    },
    "companyName":
    {
      "type": "string"
    },
    "line1":
    {
      "type": "string"
    },
    "line2":
    {
      "type": "string"
    },
    "town":
    {
      "type": "string"
    },
    "region":
    {
      "$ref": "#/definitions/RegionWsDTO"
    },
    "postalCode":
    {
      "type": "string"
    },
    "phone":
    {
      "type": "string"
    },
    "email":
    {
      "type": "string"
    },
    "country":
    {
      "$ref": "#/definitions/CountryWsDTO"
    },
    "shippingAddress":
    {
      "type": "boolean"
    },
    "visibleInAddressBook":
    {
      "type": "boolean"
    },
    "formattedAddress":
    {
      "type": "string"
    }
  },
  "definitions":
  {
    "RegionWsDTO":
    {
      "properties":
      {
        "isocode":
        {
          "type": "string"
        },
        "isocodeShort":
        {
          "type": "string"
        },
        "countryIso":
        {
          "type": "string"
        },
        "name":
        {
          "type": "string"
        }
      }
    },
    "CountryWsDTO":
    {
      "properties":
      {
        "isocode":
        {
          "type": "string"
        },
        "name":
        {
          "type": "string"
        }
      }
    }
  }
}