Skip to main content

POST /address-book

Upcoming

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

Method: POST

Resource: Address Book

Creates a new entry. Any address_id in the body is ignored; the feature class assigns a new id.

Route​

POST /wp-json/fluid-checkout/v1/address-book

Parameters​

ParameterTypeRequiredDescription
user_idintegernoWordPress user ID whose address book is targeted. Defaults to the current user.
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​

Create an entry:

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