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
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | integer | no | WordPress user ID whose address book is targeted. Defaults to the current user. |
first_name | string | no | First name. |
last_name | string | no | Last name. |
company | string | no | Company. |
country | string | no | Country code. |
address_1 | string | no | Address line 1. |
address_2 | string | no | Address line 2. |
city | string | no | City. |
state | string | no | State or county. |
postcode | string | no | Postcode or ZIP. |
address_label | string | no | Address label. |
phone | string | no | Phone number. |
default_shipping | boolean | no | Whether this entry is the default shipping address. |
default_billing | boolean | no | Whether 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"
}'