Create Customer
Function
To create a customer with open API
透過open API創建一筆新的顧客資料
URL
POST <<api_domain>>/v1/customers
Request Parameters
Parameter | Value | Description | Example |
|---|---|---|---|
name |
| Customer's Name |
|
email |
| Customer's Email
|
|
mobile_phone |
| Customer Mobile Phone
|
|
mobile_phone_country_calling_code |
| Country Code of Mobile Phone |
|
send_notification |
| Will send welcome email/sms if True |
|
phones |
| Customer's Phones
|
|
gender |
| Customer's Gender
|
|
birthday |
| Customer's Birthday
|
|
birth_year |
| Customer's birth year
|
|
birth_month |
| Customer's birth month
|
|
birth_day |
| Customer's birth day
|
|
is_member |
| Set as True for registered customer |
|
is_accept_marketing |
| Set as True for acceptance of marketing news. [Note] |
|
delivery_addresses |
| Customer's Delivery Addresss
| |
is_allow_welcome_credit |
| Set as True for sending welcome credit.
Default: false |
|
memo |
| Customer Memo |
Request Example
Create a Customer.
curl -X POST \
<<api_domain>>/v1/customers \
-H 'Accept: application/json' \
-H 'Authorization: Bearar access_token' \
-H 'Content-Type: application/json' \
-H 'User-Agent: shopline' \
-d '{
"name": "marry",
"email": "[email protected]",
"mobile_phone": "944384598",
"mobile_phone_country_calling_code": "886",
"send_notification": false,
"phones": "0910123456, 02-27423586, +886912345678",
"gender": "male",
"birthday": "2013-11-11",
"is_member": true,
"is_accept_marketing": true,
"delivery_addresses":[{
"city": "Taipei",
"postcode": "10560",
"address_1": "光復北路11巷44號14樓",
"address_2": "松山區",
"recipient_name": "marry",
"recipient_phone": "0227423966",
"recipient_phone_country_code": "886",
"country": "TW"
}],
"created_by": "openapi"
}'curl -X POST \
https://open.shoplineapp.com/v1/customers \
-H 'Accept: application/json' \
-H 'Authorization: Bearar access_token' \
-H 'Content-Type: application/json' \
-H 'User-Agent: shopline' \
-d '{
"name": "marry",
"email": "[email protected]",
"phones": "0910123456, 02-27423586, +886912345678",
"gender": "male",
"birthday": "2013-11-11",
"is_member": true,
"is_accept_marketing": true,
"delivery_addresses":[{
"city": "Taipei",
"postcode": "10560",
"address_1": "光復北路11巷44號14樓",
"address_2": "松山區",
"recipient_name": "marry",
"recipient_phone": "0227423966",
"country": "TW"
},{
"city": "Taipei",
"postcode": "103",
"address_1": "中山北路二段12號10樓",
"address_2": "中山區",
"recipient_name": "marry",
"recipient_phone": "0227423966",
"country": "TW"
}]
}'Response Example
Also same with Get Customer
{
"id": "5b70f619003252000900000c",
"name": "marry",
"email": "[email protected]",
"gender": "male",
"birthday": "2013-11-05",
"birth_year": 2013,
"birth_month": 11,
"birth_day": 5,
"phones": [
"0910123456",
"02-27423586",
"+886912345678"
],
"phone": "0910000123",
"mobile_phone": "0944384598",
"mobile_phone_verified": false,
"mobile_phone_country_calling_code": "886",
"locale_code": null,
"orders_total_sum": 0,
"is_member": true,
"is_blacklisted": false,
"credit_balance": 0,
"custom_data": [],
"membership_tier": null,
"delivery_addresses": [
{
"city": "Taipei",
"postcode": "10560",
"address_1": "光復北路11巷44號14樓",
"address_2": "松山區",
"recipient_name": "marry",
"recipient_phone": "0227423966",
"recipient_phone_country_code": "886",
"country": "TW"
}
],
"subscribed_email_types": [
"marketing.news"
],
"ref_user_id": null,
"updated_at": "2018-08-13T03:08:09.285+00:00",
"created_at": "2018-08-13T03:08:09.167+00:00",
"current_sign_in_at": null,
"last_sign_in_at": null,
"created_by": "openapi"
}Updated 13 days ago