Skip to main content

POST /address-book/{address_id}

Upcoming

This REST API reference is upcoming. Routes, parameters, and wire error codes may change before the public release.

Method: POST

Resource: Address Book

Full replace: send the complete address entry in the request body. Omitted fields are not merged from storage.

Route​

POST /wp-json/fluid-checkout/v1/address-book/{address_id}

Parameters​

ParameterTypeRequiredDescription
user_idintegernoWordPress user ID whose address book is targeted. Defaults to the current user.
address_idintegeryesAddress book entry ID.
first_namestringnoFirst name.
last_namestringnoLast name.
companystringnoCompany.
countrystringnoCountry code.
address_1stringnoAddress line 1.
address_2stringnoAddress line 2.
citystringnoCity.
statestringnoState or county.
postcodestringnoPostcode or ZIP.
address_labelstringnoAddress label.
phonestringnoPhone number.
default_shippingbooleannoWhether this entry is the default shipping address.
default_billingbooleannoWhether this entry is the default billing address.

Error codes​

See the REST API errors page for every wire code this plugin may return.

Examples​

Update an entry with a full replace (GET the entry, change fields, then POST the complete object):

curl -X POST 'https://example.com/wp-json/fluid-checkout/v1/address-book/42' \
--user 'USERNAME:APPLICATION_PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
"first_name": "Jane",
"last_name": "Doe",
"country": "US",
"address_1": "456 Oak Avenue",
"city": "New York",
"state": "NY",
"postcode": "10001"
}'