# Customers

## GET /rest\_api/v1/customers

> List customers

```json
{"openapi":"3.0.0","info":{"title":"Joy Loyalty Program - API REST","version":"1.0.0"},"tags":[{"name":"Customers"}],"servers":[{"url":"https://dev-api.joy.so"}],"paths":{"/rest_api/v1/customers":{"get":{"tags":["Customers"],"summary":"List customers","parameters":[{"name":"X-Joy-Loyalty-App-Key","in":"header","schema":{"type":"string"},"description":"App ID of your shop which retrieved from the Settings page"},{"name":"X-Joy-Loyalty-Secret-Key","in":"header","schema":{"type":"string"},"description":"Secret Key of your shop which retrieved from the Settings page"}],"responses":{"200":{"description":"OK","headers":{"Connection":{"schema":{"type":"string"}},"Content-Length":{"schema":{"type":"integer"}},"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"type":"string"}},"Content-Type":{"schema":{"type":"string"}},"Function-Execution-Id":{"schema":{"type":"string"}},"Server":{"schema":{"type":"string"}},"Strict-Transport-Security":{"schema":{"type":"string"}},"X-Cloud-Trace-Context":{"schema":{"type":"string"}},"X-Country-Code":{"schema":{"type":"string"}},"Accept-Ranges":{"schema":{"type":"string"}},"Date":{"schema":{"type":"string"}},"X-Served-By":{"schema":{"type":"string"}},"X-Cache":{"schema":{"type":"string"}},"X-Cache-Hits":{"schema":{"type":"integer"}},"X-Timer":{"schema":{"type":"number"}},"Vary":{"schema":{"type":"string"}},"alt-svc":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"shopifyCustomerId":{"type":"number"},"email":{"type":"string"},"point":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"totalSpent":{"type":"number"},"orderCount":{"type":"number"},"acceptsMarketing":{"type":"boolean"},"name":{"type":"string"},"state":{"type":"string","enum":["enabled","disabled"]},"tierId":{"type":"string"},"tierPoint":{"type":"number"},"phone":{"type":"number"},"pointsRemain":{"type":"number"}}}},"pageInfo":{"type":"object","properties":{"hasPre":{"type":"boolean"},"hasNext":{"type":"boolean"}}},"count":{"type":"number"}}}}}}}}}}}
```

## GET /rest\_api/v1/customers/{customerId}

> Get a customer

```json
{"openapi":"3.0.0","info":{"title":"Joy Loyalty Program - API REST","version":"1.0.0"},"tags":[{"name":"Customers"}],"servers":[{"url":"https://dev-api.joy.so"}],"paths":{"/rest_api/v1/customers/{customerId}":{"get":{"tags":["Customers"],"summary":"Get a customer","parameters":[{"name":"X-Joy-Loyalty-App-Key","in":"header","schema":{"type":"string"},"description":"App ID of your shop which retrieved from the Settings page"},{"name":"X-Joy-Loyalty-Secret-Key","in":"header","schema":{"type":"string"},"description":"Secret of your shop which retrieved from /settings/managingKey"},{"name":"customerId","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"OK","headers":{"Connection":{"schema":{"type":"string"}},"Content-Length":{"schema":{"type":"integer"}},"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"type":"string"}},"Content-Type":{"schema":{"type":"string"}},"Function-Execution-Id":{"schema":{"type":"string"}},"Server":{"schema":{"type":"string"}},"Strict-Transport-Security":{"schema":{"type":"string"}},"X-Cloud-Trace-Context":{"schema":{"type":"string"}},"X-Country-Code":{"schema":{"type":"string"}},"Accept-Ranges":{"schema":{"type":"string"}},"Date":{"schema":{"type":"string"}},"X-Served-By":{"schema":{"type":"string"}},"X-Cache":{"schema":{"type":"string"}},"X-Cache-Hits":{"schema":{"type":"integer"}},"X-Timer":{"schema":{"type":"string"}},"Vary":{"schema":{"type":"string"}},"alt-svc":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"shopifyCustomerId":{"type":"number"},"email":{"type":"string"},"point":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"totalSpent":{"type":"number"},"orderCount":{"type":"number"},"acceptsMarketing":{"type":"boolean"},"name":{"type":"string"},"state":{"type":"string","enum":["enabled","disabled"]},"tierId":{"type":"string"},"tierPoint":{"type":"number"},"phone":{"type":"number"},"pointsRemain":{"type":"number"}}}}}}}}}}}}}
```

## Get customer by Shopify ID

> Retrieve customer information using Shopify customer ID<br>

```json
{"openapi":"3.0.0","info":{"title":"Joy Loyalty Program - API REST","version":"1.0.0"},"tags":[{"name":"Customers"}],"servers":[{"url":"https://dev-api.joy.so"}],"paths":{"/rest_api/v1/customers/shopify-id/{id}":{"get":{"tags":["Customers"],"summary":"Get customer by Shopify ID","description":"Retrieve customer information using Shopify customer ID\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"},"description":"Shopify customer ID"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"state":{"type":"string"},"orderCount":{"type":"integer"},"totalSpent":{"type":"number"},"shopifyCustomerId":{"type":"integer"},"acceptsMarketing":{"type":"boolean"},"phone":{"type":"string","nullable":true},"shopId":{"type":"string"},"insertedBigquery":{"type":"boolean"},"earnSignUp":{"type":"boolean"},"hasPoint":{"type":"boolean"},"like_facebook":{"type":"boolean"},"usedMilestoneEarnPoint":{"type":"array","items":{"type":"integer"}},"latestActivity":{"type":"string","format":"date-time"},"point":{"type":"integer"},"hasTier":{"type":"boolean"},"tierUpdatedAt":{"type":"string","format":"date-time"},"tierId":{"type":"string"},"tierPoint":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"id":{"type":"string"},"pointsRemain":{"type":"integer"},"tierName":{"type":"string"}}}}}}}}}}}}}
```
