Create an address
How to create an address via API
To create a new address, send a POST
request to the /api/addresses
endpoint, passing the resource arguments in the request body.
Request
POST https://yourdomain.commercelayer.io/api/addresses
Arguments
type
string
Required
attributes.business
boolean
Optional, default is 'false'
attributes.first_name
string
Required if 'business' is 'false'
attributes.last_name
string
Required if 'business' is 'false'
attributes.company
string
Required if 'business' is 'true'
attributes.line_1
string
Required
attributes.line_2
string
Optional
attributes.city
string
Required
attributes.zip_code
string
Required, but for some countries
attributes.state_code
string
Required
attributes.country_code
string
Required
attributes.phone
string
Required
attributes.email
string
Optional
attributes.notes
string
Optional
attributes.lat
float
Optional
attributes.lng
float
Optional
attributes.billing_info
string
Optional
attributes.reference
string
Optional
attributes.reference_origin
string
Optional
attributes.metadata
object
Optional
relationships.geocoder
object
Optional
relationships.tags
array
Optional
Example
The following request creates a new address:
Last updated