Customer - Addresses

Creating an customer address

Endpoint

POST /v1/customer_addresses

Parameters

Name Description
firstname required Firstname
lastname Lastname
company Company (required if firstname not provided)
email Email
phone Phone
address1 required Address
address2 Address Extra
district District
city required City
zip Zip
sex Gender (false = men, true = woman)
zone_id Zone Id
country_id required Country Id
reference Address reference
extra Extra fields (Meta data)
is_default_ship Is default shipping address
is_default_bill Is default billing address

Request

curl "https://capi.storyblok.com/v1/customer_addresses" -d '{"firstname":"Max","address1":"Street 1","city":"City","country_id":"Country"}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=12b3aa7cf40c53160c9272a9cf0349e5" \
	-H "Cookie: _storeblok_cky=U1VrWFh1dHhESVYyQ0lMakt5VzFuU3BVVVJIdzZ2UFVCSmd5cjE0MnlJMkRaRFJKT3N3blpsV1c2a21JTHlnSTREbmhIOVJ6NzArNHlES1FEY2tIWkcvaWpGUnk3QklYK094OFpodjB0WlNnVGFVbXVkdHQyUmhOWDN4dCt0SnE0dklnN1ZlTUtjY2RMQWYzbXlxa040RmMzSEpxVDB6WWVUQWM1ck1NZXpjMUJXdWlIaWZWZVQ5OVZ3TjhUbFVSLS1FdjM0d1RqUEg0ZEtDTEkrQzBoUWdBPT0%3D--6d7c0f93578e2333a4da4646ac14c46550e23a63" \
	-H "Host: example.org"

Response

{
  "id": 928,
  "company": null,
  "firstname": "Max",
  "lastname": null,
  "email": null,
  "phone": null,
  "address1": "Street 1",
  "address2": null,
  "anumber": null,
  "district": null,
  "city": "City",
  "zip": null,
  "zone_id": null,
  "zone": null,
  "country_id": "Country",
  "country": null,
  "country_code": null,
  "reference": null,
  "extra": "{}",
  "site_id": 38587,
  "customer_id": 7220,
  "is_default_ship": null,
  "is_default_bill": null,
  "sex": null,
  "created_at": "2018-07-04T16:56:52.000Z",
  "updated_at": "2018-07-04T16:56:52.000Z"
}

Deleting a customer address

Endpoint

DELETE /v1/customer_addresses/:id

Request

curl "https://capi.storyblok.com/v1/customer_addresses/930" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=0871f7d23e3a4a67c07706b92cd337b6" \
	-H "Cookie: _storeblok_cky=cVVjNnJpNnlzeElTYktxWGp1RFl5MmtYSUhoM1p3Rm5hTVkvL2phSkUwWG5EU3RRNlVsZEZEU0FoY3NXQTlEM1lUSWZ5WkVOWVNsMFR5TGpFWTErRXJWR29mWXNoL0RIWXRycitRTFg5SlBkWjVTeVdTbmUyMkxPaW04dzFVM0hDelA1UXI4Y1FzeTViRWtxNmUvWkVYRVI0emZCdXFFWUpWVTZWK2ErN01GbzlDM1RJTE9kcExRckpLVzMyYzZQLS1aa1dVemlrUEZwOXpRR2ljbWpMdUh3PT0%3D--bb467a1d32711de7c525bbecdc7e7f27467aa20c" \
	-H "Host: example.org"

Getting a list of customer addresses

Endpoint

GET /v1/customer_addresses

Parameters

Name Description
page Current page of customer address

Request

Query Parameters

page=1
curl "https://capi.storyblok.com/v1/customer_addresses?page=1" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=f30ce51d5554a03100fc0e405a963a6e" \
	-H "Cookie: _storeblok_cky=VGl3TnpXdzNTaENTUk1VNy9EMVZwd1dQaEpEYjNvdHovcW90MzQ2SjJKaTNCKzNiR0ZlTDBLMDRUWk9SdS9sT0txT3FnSXl2cWszUEtVV2hKV3pWUllZUWNXOWNXNlFRUTZpOEx5MjJhampBd3c1MGM3MGhjam9kblQvdkhwQnQvUmNsc21GK2QvUjJkZ1ZJRk1MaGN5UTZLSmVFVVNhSlpQVjJjVDhmZFBoa1VKa0xXMDc2L3I4YXFsSG5iaVFGLS1kMVM5dXA4WkhYblZSNVIzOXkreXVBPT0%3D--d34917843300197a0e0861a5691fb6726fc9b5c3" \
	-H "Host: example.org"

Response

[

]

Updating a customer address

Endpoint

PUT /v1/customer_addresses/:id

Parameters

Name Description
name required Name of customer address

Request

curl "https://capi.storyblok.com/v1/customer_addresses/929" -d '{"name":"Blue Property"}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=ad3f8dff48957fa3ba58753eb8254fa5" \
	-H "Cookie: _storeblok_cky=bnZqNG9JaTdFTzJhU0ZPTUNjWEZYdEZEUnRlejRsWTFuL2dPRzltTFFUT2NXY0lUazBCQXpYL2NQNm5tdm5QOVBOemlKVUNXQnQwNVpnVzd0YUExTmtHU0NTQmdOdXNYY2QvYzl6TjhyUzFkVVRLT1BzQitrT2habnJKNXRqZmFER1JReUpVWVJYMlpCZi9FRXpDdXlyaGNncFJSLzhqTlFkTjhXdmFabVNrTXVRVGpzR2JqWDBzTUFsTmlsWjF1LS16VmFmYmVGcGc0Q0w5Z3h1R0MrM1JRPT0%3D--0fe8d47d2c1efc9517912fe1a9149a29aafe7c47" \
	-H "Host: example.org"

Response

{
  "extra": "{}",
  "customer_id": 7221,
  "id": 929,
  "company": "",
  "firstname": "Max",
  "address1": "Street 1",
  "city": "City",
  "country_id": "15",
  "site_id": 38588,
  "lastname": "",
  "email": "",
  "phone": "",
  "address2": "",
  "anumber": "",
  "district": "",
  "zip": "",
  "zone_id": 0,
  "zone": "",
  "country": "",
  "country_code": "",
  "reference": "",
  "is_default_ship": false,
  "is_default_bill": false,
  "sex": false,
  "created_at": "2018-07-04T16:56:52.000Z",
  "updated_at": "2018-07-04T16:56:52.000Z"
}