Requires write_customers access scope.
For more info , refer to:
POST https://{handle}.myshopline.com/admin/openapi/v20230301/customers.json
handle : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is open001.myshopline.com , the store handle is open001 .
add customer
Request Headers
  • Content-Type required
    The value of this field is fixed to application/json; charset=utf-8
  • Authorization string required
    The access token for the API. Please refer to App authorization to obtain the access token, and then put the obtained access token into the API request header in Bearer Token.
    Example:
    Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
Request Body
  • customerobject
    Customer information
  • accepts_marketing boolean
    Subscription to the mailbox , user mailbox required when modifying the subscription status
    Example: true
  • addressesobject[]
    Number of customer address lists limited to : 50
  • address1 string
    Address 1 length limited to : 255 required
    Example: 7720 Cherokee Road
  • address2 string
    Address 2 length limited to : 255
    Example: Apartment 2
  • city string
    City length limited to : 64
    Example: Hagerman
  • company string
    Company length limited to : 255
    Example: Joy
  • country string
    Country length limited to : 64
    Example: United States
  • country_code string
    National code length limited to : 50
    Example: US
  • country_name string
    User's standardized country name
    Example: United States
  • default boolean
    Default address or not
    Example: true
  • first_name string
    First Name length limited to : 128
    Example: Bob
  • last_name string
    Last Name length limited to : 128
    Example: Norman
  • name string
    User nickname
    Example: NormanBob
  • phone string
    Phone number length limited to : 16
    Example: 008615834564475
  • province string
    Length saving limited to : 64
    Example: Kentucky
  • province_code string
    Provincial code length limited to : 50
    Example: KY
  • zip string
    Zip code length limited to : 10
    Example: 40202
  • birthday string
    User birthday , format yyyyMMdd
    Example: 19970102
  • email string
    Mailbox length limited to : 50
    Example: 123@qq.com
  • first_name string
    First Name Length Limit: 128
    Example: Bob
  • gender integer
    Gender , 0 : unknown / not set , 1 : male , 2 : female , 3 : confidential / not open
  • last_name string
    Last Name length limited to : 128
    Example: Norman
  • note string
    Memo length limited to : 1000
    Example: Placed an order that had a fraud warning
  • phone string
    Phone number length limited to : 20
    Example: 008615834564475
  • tags string
    Tag, Different tags are separated by commas. A single tag is limited to 100 characters, the number of tags is limited to 100, and the total length of this field is limited to 1000 characters
    Example: loyal
Response
For more information about status codes, see Http status code.

Response Headers
  • traceId
    traceId
Response Body
  • customerobject
    Customer information
  • accepts_marketing boolean
    Mail subscription or not
    Example: true
  • accepts_marketing_updated_at string
    Email subscription time (see IOS8601 for the format)
    Example: 2022-05-31T15:32:46+08:00
  • accepts_mobile_marketing boolean
    Accept telemarketing or not
    Example: true
  • accepts_mobile_marketing_updated_at string
    Telephone subscription time (see IOS8601 for the format)
    Example: 2022-05-31T15:32:46+08:00
  • addressesobject[]
    Customer address list
  • address1 string
    Address 1
    Example: 7720 Cherokee Road
  • address2 string
    Address 2
    Example: Apartment 2
  • city string
    City
    Example: Hagerman
  • company string
    Company
    Example: Joy
  • country string
    Country
    Example: United States
  • country_code string
    Country code
    Example: US
  • customer_id string
    customer id
    Example: 4201825054
  • default boolean
    Default address or not
    Example: true
  • first_name string
    Name
    Example: Bob
  • id string
    Address ID
    Example: 207119551
  • last_name string
    Last name
    Example: Norman
  • phone string
    Telephone number
    Example: 008615834564475
  • province string
    Save
    Example: Kentucky
  • province_code string
    Provincial encoding
    Example: KY
  • zip string
    Zip code
  • asid string
    FB login ID
  • birthday string
    Customer birthday Format: YYYYMMDD
  • created_at string
    Creation time (see IOS8601 for the format)
  • currency string
    Currency
    Example: USD
  • default_addressobject
    Default address
  • address1 string
    Address 1
    Example: 7720 Cherokee Road
  • address2 string
    Address 2
    Example: Apartment 2
  • city string
    City
    Example: Hagerman
  • company string
    Company
    Example: Joy
  • country string
    Country
    Example: United States
  • country_code string
    Country code
    Example: US
  • customer_id string
    customer id
    Example: 4201825054
  • default boolean
    Default address or not
    Example: true
  • first_name string
    name
    Example: Bob
  • id string
    Address ID
    Example: 207119551
  • last_name string
    Last name
    Example: Norman
  • phone string
    Telephone number
    Example: 008615834564475
  • province string
    Province
    Example: Kentucky
  • province_code string
    Provincial encoding
    Example: KY
  • zip string
    Zip code
    Example: 40202
  • email string
    Mailbox
    Example: 123@qq.com
  • email_subscribe_flag integer
    Mailbox subscription status 0 : cancelled subscription , 1 : already available , 2 : not available
    Example: 1
  • first_name string
    Name
    Example: Bob
  • gender string
    Gender : male / female / others/secret
    Example: female
  • id string
    Example: 4201825054
  • language string
    Customer language
    Example: en
  • last_name string
    Last name
    Example: Norman
  • last_order_id string
    Recent order number
    Example: 2005473211984312275741
  • mobile_subscribe_flag integer
    Mobile phone subscription status 0 : cancelled subscription , 1 : already available , 2 : not available
  • note string
    Customer notes
    Example: Placed an order that had a fraud warning
  • orders_count long
    Order quantity
    Example: 12
  • phone string
    Phone number
    Example: 008615834564475
  • social_customer array
    Social media user ID
    Example: [6612273988815231]
  • state integer
    Customer status [ 0 : disabled account , 1 : to enable account , 2 : invited account , 3 : valid account ]
    Example: 2
  • tags string
    Customer tag
    Example: loyal
  • total_spent string
    Total cost amount
    Example: 100
  • updated_at string
    Update time (see IOS8601 for the format)
    Example: 2022-09-07T10:53:31+08:00
  • verified_email boolean
    Verify if e-mail or not
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20230301

ParamOptions

— header required

Body

required
{
  "customer": {
    "accepts_marketing": true,
    "addresses": [
      {
        "address1": "7720 Cherokee Road",
        "address2": "Apartment 2",
        "city": "Hagerman",
        "company": "Joy",
        "country": "United States",
        "country_code": "US",
        "country_name": "United States",
        "default": true,
        "first_name": "Bob",
        "last_name": "Norman",
        "name": "NormanBob",
        "phone": "008615834564475",
        "province": "Kentucky",
        "province_code": "KY",
        "zip": "40202"
      }
    ],
    "birthday": "19970102",
    "email": "123@qq.com",
    "first_name": "Bob",
    "gender": 0,
    "last_name": "Norman",
    "note": "Placed an order that had a fraud warning",
    "phone": "008615834564475",
    "tags": "loyal"
  }
}

Language

curl --request POST \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20230301/customers.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json'
Examples
Create users
Request
{
"customer": {
"addresses": [
{
"address1": "address1",
"address2": "address2",
"city": "Louisville",
"company": "company",
"country": "UnitedStates",
"country_code": "US",
"country_name": "UnitedStates",
"customer_id": 207119551,
"default": false,
"first_name": "first_name",
"id": 207119551,
"last_name": "last_name",
"name": "namename",
"phone": "555-625-1199",
"province": "Kentucky",
"province_code": "KY",
"zip": "403210"
}
],
"birthday": "19990304",
"email": "hqh0315@test.com",
"first_name": "创建",
"gender": 3,
"last_name": "用户0315",
"note": "Placedanorderthathadafraudwarning",
"phone": "0015834564475",
"tags": "loyal"
}
}
Response
{
"customer": {
"accepts_marketing": false,
"accepts_mobile_marketing": false,
"addresses": [
{
"address1": "address1",
"address2": "address2",
"city": "Louisville",
"company": "company",
"country": "UnitedStates",
"country_code": "US",
"customer_id": "4211465524",
"default": true,
"first_name": "first_name",
"id": "SL201UA5702515980125086505",
"last_name": "last_name",
"phone": "5556251199",
"province": "Kentucky",
"province_code": "4200021",
"zip": "403210"
}
],
"birthday": "19990304",
"created_at": "2022-12-05T15:15:47+08:00",
"currency": "USD",
"default_address": {
"address1": "address1",
"address2": "address2",
"city": "Louisville",
"company": "company",
"country": "UnitedStates",
"country_code": "US",
"customer_id": "4211465524",
"default": true,
"first_name": "first_name",
"id": "SL201UA5702515980125086505",
"last_name": "last_name",
"phone": "5556251199",
"province": "Kentucky",
"province_code": "4200021",
"zip": "403210"
},
"email": "hqh0315@test.com",
"email_subscribe_flag": 2,
"first_name": "创建",
"gender": "secret",
"id": "4211465524",
"last_name": "用户0315",
"mobile_subscribe_flag": 2,
"note": "Placedanorderthathadafraudwarning",
"phone": "0015834564475",
"tags": "loyal",
"total_spent": "0",
"updated_at": "2022-12-05T15:15:48+08:00"
}
}
Was this article helpful to you?

Error loading component.

Error loading component.