Customer - Accounts

Signup

Endpoint

POST /v1/customer_accounts

Parameters

Name Description
email required Email address
password required Password
email_subscribe Subscribe customer to newsletter
company Company
firstname Firstname
lastname Lastname
phone Phone
mobile Mobile
sex Gender
birthday Birthday
email Email
password Password
password_confirmation Password confirmation
company_registration Company tax number
meta_data Key value pairs of additional meta data
default_address1 Default address
default_address2 Default address extra
default_city Default city
default_zip Default zip code
default_country_id Default country id
access_code Access code for customer group
notify_owner Notifies the shop owner about the account creation

Request

curl "https://capi.storyblok.com/v1/customer_accounts" -d '{"email":"1530723410.46084@delooks.at","password":"123456","email_subscribe":"1","company":"Apple Inc","firstname":"Steve","lastname":"Jobs","mobile":"023432432","sex":"1","birthday":"2000-01-01","password_confirmation":"123456","company_registration":"123","meta_data":{"factory":"XYZ"},"default_address1":"Street 1","default_address2":"Apt. 3","default_city":"New York","default_zip":"5322323","default_country_id":9515,"notify_owner":"1"}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=e32f797582f39aadb18bbcddf11f0521" \

Response

{
  "id": 7216,
  "email": "1530723410.46084@delooks.at",
  "company": "Apple Inc",
  "firstname": "Steve",
  "lastname": "Jobs",
  "phone": null,
  "mobile": "023432432",
  "sex": true,
  "email_subscribe": true,
  "birthday": "2000-01-01",
  "active": true,
  "group_id": 41830,
  "confirmed": false,
  "company_alt": null,
  "company_registration": "123",
  "company_registration_alt": null,
  "subscribed": false,
  "job": null,
  "company_description": "",
  "origin_id": null,
  "euid": null,
  "default_billing_address": 926,
  "default_shipping_address": 926,
  "meta_data": {
    "factory": "XYZ"
  }
}

Change password

Endpoint

PUT /v1/customer_accounts/:id

Parameters

Name Description
current_password Current password
password Password
email Email address
password Password
email_subscribe Subscribe customer to newsletter
company Company
firstname Firstname
lastname Lastname
phone Phone
mobile Mobile
sex Gender
birthday Birthday
email Email
meta_data Key value pairs of additional meta data

Request

curl "https://capi.storyblok.com/v1/customer_sessions" -d '{"email":"1530723411.4795678@delooks.at","password":"123456789"}' -X POST \
	-H "Authorization: Token token=117fe1d3110cb3c1c83093b9128af29e" \
	-H "Content-Type: application/json"

Response

{
  "id": 7218,
  "email": "1530723411.4795678@delooks.at",
  "company": "",
  "firstname": "",
  "lastname": "",
  "phone": "",
  "mobile": "",
  "sex": false,
  "email_subscribe": null,
  "birthday": null,
  "active": true,
  "group_id": 1,
  "confirmed": false,
  "company_alt": "",
  "company_registration": "",
  "company_registration_alt": "",
  "subscribed": false,
  "job": "",
  "company_description": "",
  "origin_id": null,
  "euid": null,
  "default_billing_address": null,
  "default_shipping_address": null,
  "meta_data": null
}

Request

curl "https://capi.storyblok.com/v1/customer_accounts/7218" -d '{"current_password":"123456789","password":"NEW123456789","meta_data":{"factory":"NEW"}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=117fe1d3110cb3c1c83093b9128af29e" \
	-H "Cookie: _storeblok_cky=eVdNamR0b1JzeEg3NjVxbGNRbGt4QUJZZDVZNHBOdFFWaXlBblM3NDJQcHlHOW5EQUR2ZFhqNE9iSWpDSkJMWUVyTEw1c0MzdXVHTWRSZHduRFZmZ096R091NFJOZFlnY0pQZDNiMStGamV5NklDSWd1L2s0N3hxRWNTNGc1NUY2dVlUWmJobk1LQS9pcmlsT1FIbC94SU1wTGhyaVcvQVBIeHZHcVhjTWVITUZXaGZFcGFKdWl1SzZWempYZG40LS1qditTOTlhY3BDWS91ejh6ZUMvbkp3PT0%3D--29607532efa560ad8a64f47801b9232a1c617d04" \
	-H "Host: example.org"

Response

{
  "id": 7218,
  "email": "1530723411.4795678@delooks.at",
  "company": "",
  "firstname": "",
  "lastname": "",
  "phone": "",
  "mobile": "",
  "sex": false,
  "email_subscribe": null,
  "birthday": null,
  "active": true,
  "group_id": 1,
  "confirmed": false,
  "company_alt": "",
  "company_registration": "",
  "company_registration_alt": "",
  "subscribed": false,
  "job": "",
  "company_description": "",
  "origin_id": null,
  "euid": null,
  "default_billing_address": null,
  "default_shipping_address": null,
  "meta_data": {
    "factory": "NEW"
  }
}