Customer

Is represented by array filled with information related to customer.


Customer properties

accept_newsletter "accept_newsletter": 0

Indicates whether or not the customer accept newsletter or not. Valid values are 0 and 1.
bank_account "bank_account": ""

Seller bank account number where customer transfer money after purchase. It only works on Shoplo Payments.
city "city": "Warszawa"

Customer's city.
company_city "company_city": "Warszawa"

Customer's billing city.
company_region "company_region": "Mazowieckie"

The name for the region of the customer billing address.
company_country "company_country": "pl"

The two-letter code for the country of the customer billing address.
company_nip "company_nip": "900-800-11-54"

Billing address tax identifier.
company_name "company_name": "Gall Deco"

Billing company name.
company_number "number": "1231"

Number of the street in billing customer address.
company_street "company_street": "Anonimowa"

Street of the billing customer address.
company_zip_code "company_zip_code": "34-223"

Zip or postal code of the billing customer address.
country "country": "pl"

The two-letter code for the country of the customer.
created_at "created_at": "2016-11-02 17:43:32"

Date and time when the customer was created in format YYYY-MM-DD HH:ii:ss.
discount_value "discount_value": 15

Customer percentage discount on all products.
email "email": "[email protected]"

Customer's email address.
id "id": 4

Unique numeric identifier for the customer.
uuid "uuid": "9b757878-eda7-4a05-b427-edbd1ccb259f"

Unique customer identifier. Main object identifier in the future API.
last_name "last_name": "Anonim"

Customer's last name.
last_order_date "last_order_date": "2013-11-21 23:32:12"

Date when the customer last time do purchase.
last_order_id "last_order_id": 242

Last order number identifier which were purchase by this customer.
number "number": "29/31"

Number of the main customer address.
orders_count "orders_count": 44

Number of orders made by this customer in a shop.
orders_price_sum "orders_price_sum": 378707

Total amount of money spent by this customer in a shop.
phone "phone": "++34 532 234 2342"

Customer's phone number.
shipping_address "shipping_address": "{
    "id" : 12,
    "company" : "ACME",
    "name" : "Jan Kowalski",
    "phone" : "599 155 053",
    "street" : "Biskupa",
    "number" : "97",
    "zip_code" : "25-122",
    "city" : "Kielce",
    "region" : "Świętokrzyskie",
    "country" : "pl",
}"


This is the address to where the order will be shipped. If the all items not required shipping this address will be empty. It has the following properties:
  • id - Unique numeric address identifier.
  • company - name for company at the shipping address.
  • name - First name and last name of a customer.
  • phone - The phone number at the shipping address.
  • street - The street address of the shipping address.
  • number - The number address of the shipping address.
  • zip_code - The zip or postal code of the shipping address.
  • city - The city of the shipping address.
  • region - The name for the region of the shipping address.
  • country - The two-letter code for the country of the shipping address.
state "state": "enabled"

State indicating if the customer is enabled and can buy in a store or is blocked. Possible values are: "enabled" and "disabled".
street "street": "Wybrana"

Street of the main customer address.
tags "tags": "vip,return-client"

Comma separeted list of customer tags. Commonly used for filtering and searching.
updated_at "updated_at": "2016-11-02 17:43:32"

Date and time when the customer was updated in format YYYY-MM-DD HH:ii:ss.
zip_code "zip_code": "34-223"

Zip or postal code of the main customer address.


Receive a list of all Customers

Query parameters:
  • fields - list of fields returning in response
  • limit - number of returned customers (default: 50)
  • page - currently displayed page (default: 1)
  • email - filter with given e-mail
  • since_id - restrict customers to greater identifiers than specified id
  • created_at_min - shows customers, which creation date was later than specified (format: 2011-06-19 13:18:50)
  • created_at_max - shows customers, which creation date was earlier than specified (format: 2011-06-19 13:18:50)
  • updated_at_min - shows customers, which modification date was later than specified (format: 2011-06-19 13:18:50)
  • updated_at_max - shows customers, which modification date was earlier than specified (format: 2011-06-19 13:18:50)
GET /services/customers

Returns all customers

HTTP/1.1 200 OK
{
	"customers": [
		{
			"id" : "4",
			"name" : "Grzegorz",
			"last_name" : "Anonim",
			"email" : "[email protected]",
			"phone" : "532 234 2342",
			"city" : "Warszawa",
			"country" : "pl",
			"orders_count" : "44",
			"orders_price_sum" : "378707",
			"accept_newsletter" : "0",
			"state" : "enabled",
			"street" : "Wybrana",
			"number" : "29/31",
			"zip_code" : "34-223",
			"discount_value" : 15,
			"bank_account" : "",
			"last_order_id" : 232,
			"last_order_date" : "2013-11-21 23:32:12",
			"company_name" : "Gall Deco",
			"company_street" : "Anonimowa",
			"company_number" : "1231",
			"company_zip_code" : "01-234",
			"company_city" : "Warszawa",
			"company_country" : "pl",
			"company_nip" : "900-800-11-54",
			"tags": "nowy, mazowieckie",
			"shipping_address": {
				"company": "ACME",
				"first_name": "Grzegorz",
				"last_name": "Anonim",
				"street": "Inflancka",
				"number": "4C",
				"zip_code": "00-189",
				"region": "Mazowieckie",
				"city": "Warszawa",
				"country": "pl"
			}
		},
		{
			"id" : "5",
			"name" : "Dominik",
			"last_name" : "Kowalski",
			"email" : "[email protected]",
			"phone" : "632 734 2342",
			"city" : "Warszawa",
			"country" : "pl",
			"orders_count" : "67",
			"orders_price_sum" : "478707",
			"accept_newsletter" : "0",
			"street" : "Nieznana",
			"state" : "disabled",
			"number" : "36/32",
			"zip_code" : "02-578",
			"discount_value" : 0,
			"bank_account" : "",
			"last_order_id" : 12,
			"last_order_date" : "2013-12-01 13:34:22",
			"company_name" : "Dominik Technologies",
			"company_street" : "Fajna",
			"company_number" : "1931",
			"company_zip_code" : "02-434",
			"company_city" : "Warszawa",
			"company_country" : "pl",
			"company_nip" : "900-900-11-54",
			"tags": null,
			"shipping_address": {
				"company": "ACME",
				"first_name": "Dominik",
				"last_name": "Kowalski",
				"street": "Kolejowa",
				"number": "5/7",
				"zip_code": "01-217",
				"city": "Warszawa",
				"region": "Mazowieckie",
				"country": "pl"
			}
		},
	]
}

Receive a count of all Customers

Query parameters:
  • since_id - restrict customers to greater identifiers than specified id
  • created_at_min - counts customers, which creation date was later than specified (format: 2011-06-19 13:18:50)
  • created_at_max - counts customers, which creation date was earlier than specified (format: 2011-06-19 13:18:50)
  • updated_at_min - counts customers, which modification date was later than specified (format: 2011-06-19 13:18:50)
  • updated_at_max - counts customers, which modification date was earlier than specified (format: 2011-06-19 13:18:50)
GET /services/customers/count

Receive a count of all Customers

HTTP/1.1 200 OK
{
	"count": 5
}

Receive a single Customer

Query parameters:
  • fields - list of fields returning in response
GET services/customers/{id}

Receive a single Customer

Response
HTTP/1.1 200 OK
{
	"customer": {
		"id" : "4",
		"name" : "Grzegorz",
		"last_name" : "Anonim",
		"email" : "[email protected]",
		"phone" : "532 234 2342",
		"city" : "Warszawa",
		"country" : "pl",
		"orders_count" : "44",
		"orders_price_sum" : "378707",
		"accept_newsletter" : "0",
		"state" : "enabled",
		"street" : "Wybrana",
		"number" : "29/31",
		"zip_code" : "34-223",
		"discount_value" : 15,
		"bank_account" : "",
		"last_order_id" : 232,
		"last_order_date" : "2013-11-21 23:32:12",
		"company_name" : "Gall Deco",
		"company_street" : "Anonimowa",
		"company_number" : "1231",
		"company_zip_code" : "01-234",
		"company_city" : "Warszawa",
		"company_country" : "pl",
		"company_nip" : "900-800-11-54",
 		"tags": "nowy, mazowieckie",
		"shipping_address": {
			"company": "Shoplo",
			"first_name": "Grzegorz",
			"last_name": "Anonim",
			"street": "Inflancka",
			"number": "4C",
			"zip_code": "00-189",
			"city": "Warszawa",
			"region": "Mazowieckie",
			"country": "pl"
		}
	},
}

Create a Customer

POST services/customers

Create customer with specified parameters

Request
{
	"customer": {
		"name" : "Patryk",
		"last_name" : "Nowak",
		"email" : "[email protected]",
		"password" : "new_password",
		"phone" : "639 204 1452",
		"city" : "Warszawa",
		"country" : "pl",
		"accept_newsletter" : "0",
		"street" : "Podana",
		"number" : "44",
		"zip_code" : "04-223",
		"company_name" : "Web Nowak",
		"company_street" : "Ukryta",
		"company_number" : "1235",
		"company_zip_code" : "02-234",
		"company_city" : "Warszawa",
		"company_country" : "pl",
		"company_nip" : "900-900-11-54",
		"tags": "nowy, mazowieckie",
		"shipping_address": {
			"company": "Shoplo",
			"first_name": "Grzegorz",
			"last_name": "Anonim",
			"street": "Inflancka",
			"number": "4C",
			"zip_code": "00-189",
			"city": "Warszawa",
			"region": "Mazowieckie",
			"country": "pl"
		}
	},
}
Response
HTTP/1.1 200 OK
{
	"customer": {
		"id" : "6",
		"name" : "Patryk",
		"last_name" : "Nowak",
		"email" : "[email protected]",
		"phone" : "639 204 1452",
		"city" : "Warszawa",
		"country" : "pl",
		"orders_count" : "0",
		"orders_price_sum" : "0",
		"accept_newsletter" : "0",
		"state" : "enabled",
		"street" : "Podana",
		"number" : "44",
		"zip_code" : "04-223",
		"discount_value" : 0,
		"bank_account" : "",
		"last_order_id" : 0,
		"last_order_date" : "0000-00-00 00:00:00",
		"company_name" : "Web Nowak",
		"company_street" : "Ukryta",
		"company_number" : "1235",
		"company_zip_code" : "02-234",
		"company_city" : "Warszawa",
		"company_country" : "pl",
		"company_nip" : "900-900-11-54",
		"tags": "nowy, mazowieckie",
		"shipping_address": {
			"company": "Shoplo",
			"first_name": "Grzegorz",
			"last_name": "Anonim",
			"street": "Inflancka",
			"number": "4C",
			"zip_code": "00-189",
			"city": "Warszawa",
			"region": "Mazowieckie",
			"country": "pl"
		}
	},
}

Update a Customer

POST services/customers/{id}

Update customer with specified parameters

Request
{
	"customer": {
		"name" : "Patryk",
		"last_name" : "Kowalski",
		"password" : "new_password",
		"password_confirmation" : "new_password"
	},
}
Response
HTTP/1.1 200 OK
{
	"customer": {
		"id" : "6",
		"name" : "Patryk",
		"last_name" : "Kowalski",
		"email" : "[email protected]",
		"phone" : "639 204 1452",
		"city" : "Warszawa",
		"country" : "pl",
		"orders_count" : "0",
		"orders_price_sum" : "0",
		"accept_newsletter" : "0",
		"state" : "enabled",
		"street" : "Podana",
		"number" : "44",
		"zip_code" : "04-223",
		"discount_value" : 0,
		"bank_account" : "",
		"last_order_id" : 0,
		"last_order_date" : "0000-00-00 00:00:00",
		"company_name" : "Web Nowak",
		"company_street" : "Ukryta",
		"company_number" : "1235",
		"company_zip_code" : "02-234",
		"company_city" : "Warszawa",
		"company_country" : "pl",
		"company_nip" : "900-900-11-54",
		"tags": "nowy, mazowieckie",
		"shipping_address": {
			"company": "Shoplo",
			"first_name": "Grzegorz",
			"last_name": "Anonim",
			"street": "Inflancka",
			"number": "4C",
			"zip_code": "00-189",
			"city": "Warszawa",
			"region": "Mazowieckie",
			"country": "pl"
		}
	},
}