Requires write_customers access scope.
For more info , refer to:
PUT https://{handle}.myshopline.com/admin/openapi/v20220901/customers/:id.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 .
update customer
Path Parameters
  • id string required
    Customer id
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
    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
  • customer_id string
    Customer id
    Example: 4201825054
  • default boolean
    Default address or not
    Example: true
  • first_name string
    Name Length Limit: 128
    Example: Bob
  • id string
    Address ID
    Example: 207119551
  • 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
    Birthday . format : yyyyMMdd
    Example: 19970102
  • email string
    Mailbox length limited to : 50
    Example: 123@qq.com
  • first_name string
    Name Length Limit: 128
    Example: Bob
  • gender integer
    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 details
  • accepts_marketing boolean
    Mail subscription or not
  • accepts_marketing_updated_at string
    Email subscription time (see IOS8601 for the format)
  • accepts_mobile_marketing_updated_at string
    Telephone subscription time (see IOS8601 for the format)
  • accepts_phone_marketing boolean
    Accept telemarketing or not
  • addressesobject[]
    Address information list
  • address1 string
    Address 1
  • address2 string
    Address 2
  • city string
    City
  • company string
    Company
  • country string
    Country
  • country_code string
    Country code
  • customer_id string
    customer id
  • default boolean
    Default address or not
  • first_name string
    Name
  • id string
    Address ID
  • last_name string
    Last name
  • phone string
    Telephone number
  • province string
    Save
  • province_code string
    Provincial encoding
  • zip string
    Zip code
  • asid string
    FB login ID
  • created_at string
    Creation time (see IOS8601 for the format)
  • currency string
    Currency
  • default_addressobject
    Default address
  • address1 string
    Address 1
  • address2 string
    Address 2
  • city string
    City
  • company string
    Company
  • country string
    Country
  • country_code string
    Country code
  • customer_id string
    customer id
  • default boolean
    Default address or not
  • first_name string
    name
  • id string
    Address ID
  • last_name string
    Last name
  • phone string
    Telephone number
  • province string
    Province
  • province_code string
    Provincial encoding
  • zip string
    Zip code
  • email string
    E-mail
  • email_subscribe_flag integer
    Mailbox subscription status 0 : cancelled subscription , 1 : already available , 2 : not available
  • first_name string
    User nickname
  • id string
    Customer id
  • last_name string
  • last_order_id string
    Recent order number
  • mobile_subscribe_flag integer
    Mobile phone subscription status 0 : cancelled subscription , 1 : already available , 2 : not available
  • note string
    Notes
  • orders_count long
    Order quantity
  • phone string
    Phone number
  • state integer
    Customer status [ 0 : disabled account , 1 : to enable account , 2 : invited account , 3 : valid account ]
  • tags string
    Customer tag
  • total_spent string
    Total cost amount
  • updated_at string
    Update time (see IOS8601 for the format)
  • verified_email boolean
    Verify if e-mail or not
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20220901

ParamOptions

— path required
— 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",
        "customer_id": "4201825054",
        "default": true,
        "first_name": "Bob",
        "id": "207119551",
        "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 PUT \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20220901/customers/id.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json'
Examples
Update user name
Request
{
"customer": {
"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_phone_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"
}
],
"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": "修改",
"id": "4211465524",
"last_name": "用户0315",
"mobile_subscribe_flag": 2,
"note": "Placedanorderthathadafraudwarning",
"orders_count": 0,
"phone": "0015834564475",
"state": 1,
"tags": "loyal",
"total_spent": "0",
"updated_at": "2022-12-05T15:53:52+08:00",
"verified_email": false
}
}

Error loading component.

Error loading component.