addresses

Create an address

Changed on

Create an address

post/addresses

Request

  • Base URL
    https://{your_organization_slug}.commercelayer.io/api
  • URL
    https://{your_organization_slug}.commercelayer.io/api/addresses
  • Auth
    HTTP bearer

Request body

Example request

{
  "data": {
    "attributes": {
      "first_name": "John",
      "last_name": "Smith",
      "company": "The Red Brand Inc.",
      "line_1": "2883 Geraldine Lane",
      "line_2": "Apt.23",
      "city": "New York",
      "zip_code": "10013",
      "state_code": "NY",
      "country_code": "US",
      "phone": "(212) 646-338-1228",
      "email": "john@example.com",
      "notes": "Please ring the bell twice",
      "lat": 40.6971494,
      "lng": -74.2598672,
      "billing_info": "VAT ID IT02382940977",
      "reference": "ANY-EXTERNAL-REFEFERNCE",
      "reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
      "metadata": {
        "foo": "bar"
      }
    },
    "relationships": {
      "geocoder": {
        "data": {
          "id": "XAyRWNUzyN"
        }
      },
      "tags": {
        "data": {
          "id": "XAyRWNUzyN"
        }
      }
    }
  }
}

Response

The created address object

Changes

    • breaking

      added the new required request property ///

    • breaking

      request property / was restricted to a list of enum values

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • info

      added the new optional request property //

    • info

      the request property // became optional

    • info

      the request property default value addresses was removed

    • info

      added the new addresses enum value to the request property /

    • info

      added the media type application/vnd.api+json for the response with the status