Customers

Creating a Customer

Endpoint

POST /v1/customers

Parameters

Name Description
email required Email
password required Password
firstname Firstname
lastname Lastname
email_subscribe Newsletter Email
phone Phone
company Company name
default_billing_address Billing address ID
default_shipping_address Shipping address ID
ship_to_bill_address Ship to bill address
active Active
group_id Group id
confirmed Confirmed
sex Gender
birthday Birthday
mobile Mobile
company_alt Company alternative name 1
company_registration Company alternative name 2
company_registration_alt Company alternative name 3
subscribed Subscribed to newsletter
job Job position
company_description Company description
origin_id Origin id

Request

curl "https://capi.storyblok.com/v1/customers" -d '{"email":"shira@marvinroberts.name","password":"8g6xg27paAQ3Sd1B","email_subscribe":true,"origin_id":1169}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=IxAUUYO34nKMTEj7TU9fzwtt" \

Response

{
  "id": 7230,
  "email": "shira@marvinroberts.name",
  "company": null,
  "firstname": null,
  "lastname": null,
  "phone": null,
  "mobile": null,
  "sex": false,
  "email_subscribe": true,
  "birthday": null,
  "active": true,
  "group_id": 1,
  "confirmed": false,
  "company_alt": null,
  "company_registration": null,
  "company_registration_alt": null,
  "subscribed": false,
  "job": null,
  "company_description": "",
  "origin_id": 1169,
  "euid": null,
  "default_billing_address": null,
  "default_shipping_address": null,
  "meta_data": null
}

Deleting a Customer

Endpoint

DELETE /v1/customers/:id

Request

curl "https://capi.storyblok.com/v1/customers/7232" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=gYaijLNNXW3BoJNXzxmXOQtt" \

Getting a Customer

Endpoint

GET /v1/customers/:id

Request

Query Parameters

page=0
curl "https://capi.storyblok.com/v1/customers/7229?page=0" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=KbNHeuE5FDH4Lf6QEsGfpwtt" \

Response

{
  "id": 7229,
  "email": "roseann.hane@kerluke.biz",
  "company": "",
  "firstname": "",
  "lastname": "",
  "phone": "",
  "mobile": "",
  "sex": true,
  "email_subscribe": null,
  "birthday": null,
  "active": true,
  "group_id": 41870,
  "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
}

Getting a list of customers

Endpoint

GET /v1/customers

Parameters

Name Description
page Current page of customers
per_page Nr. of records per page
as_csv As CSV

Request

Query Parameters

as_csv=true
curl "https://capi.storyblok.com/v1/customers?as_csv=true" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=1KURKZlU5zqpbQelnroz5Qtt" \

Response

{
  "csv": "created_at;firstname;lastname;company;company_description;email;country;phone;mobile;sex;email_subscribe;birthday;euid;group_id;company_alt;company_registration;company_registration_alt;active;job;meta_data;origin_id\r\n"
}