latestSwagger 2.0ShopBase Dev 1.02026-08-10153268547.4 KB

353ccde6240d

Customer

Updates a customer.

put/admin/customers/{id:\\d+}.json

Request body

accepts_marketingboolean

Whether the customer has consented to receive marketing material via email.

average_spentnumber

The average amount of money that the customer has spent across their order history.

created_atstring date-time

The date and time (ISO 8601 format) when the customer was created.

currencystring

The three-letter code (ISO 4217 format) for the currency that the customer used when they paid for their last order. Defaults to the shop currency. Returns the shop currency for test orders.

emailstring

The unique email address of the customer. Attempting to assign the same email address to multiple customers returns an error.

first_namestring

The customer's first name.

idinteger

A unique identifier for the customer.

last_namestring

The customer's last name.

last_order_atstring date-time

The date and time (ISO 8601 format) when the customer purchase a last order

last_order_idinteger

The ID of the customer's last order.

last_order_namestring

The name of the customer's last order. This is directly related to the name field on the Order resource.

last_sent_abandoned_email_atstring date-time

The date and time (ISO 8601 format) when the last abandoned checkout email was sent to this customer

notestring

A note about the customer.

orders_countinteger

The number of orders associated with this customer.

phonestring

The unique phone number (E.164 format) for this customer. Attempting to assign the same phone number to multiple customers returns an error. The property can be set using different formats, but each format must represent a number that can be dialed from anywhere in the world. The following formats are all valid:

  • 6135551212
  • +16135551212
  • (613)555-1212
  • +1 613-555-1212
statestring

The state of the customer's account with a shop. Default value: disabled. Valid values:

  • disabled: The customer doesn't have an active account. Customer acounts can be disabled from the ShopBase admin at any time.
  • invited: The customer has received an emailed invite to create an account.
  • enabled: The customer has created an account.
  • declined: The customer declined the email invite to create an account.
tagsstring

Tags that the shop owner has attached to the customer, formatted as a string of comma-separated values.

tax_exemptboolean

Whether the customer is exempt from paying taxes on their order. If true, then taxes won't be applied to an order at checkout. If false, then taxes will be applied at checkout.

total_spentnumber

The total amount of money that the customer has spent across their order history.

updated_atstring date-time

The date and time (ISO 8601 format) when the customer information was last updated.

verified_emailboolean

Whether the customer has verified their email address.

Example request

{
  "accepts_marketing": true,
  "addresses": [
    {
      "address1": "123 Fake Street",
      "city": "Fakecity",
      "country": "Vietnam",
      "country_code": "VN",
      "country_name": "Viet nam",
      "cpf_or_cnpj_number": "CPF: 231.234.234-23, CNPJ: 23.123.423/4234-24",
      "first_name": "John",
      "last_name": "Smith",
      "name": "example name",
      "province": "Ontario",
      "zip": "K2P 1L4"
    }
  ],
  "average_spent": 37.96,
  "created_at": "2012-08-24T14:01:46-04:00",
  "currency": "USD",
  "default_address": {
    "address1": "123 Fake Street",
    "city": "Fakecity",
    "country": "Vietnam",
    "country_code": "VN",
    "country_name": "Viet nam",
    "cpf_or_cnpj_number": "CPF: 231.234.234-23, CNPJ: 23.123.423/4234-24",
    "first_name": "John",
    "last_name": "Smith",
    "name": "example name",
    "province": "Ontario",
    "zip": "K2P 1L4"
  },
  "email": "test@shopbase.com",
  "first_name": "John",
  "id": 107333978,
  "last_name": "English",
  "last_order_at": "2012-08-24T14:01:46-04:00",
  "last_order_id": 234132602919,
  "last_order_name": "#1169",
  "last_sent_abandoned_email_at": "2012-08-24T14:01:46-04:00",
  "note": "Placed an order that had a fraud warning",
  "orders_count": 6,
  "phone": "+16135551111",
  "state": "disabled",
  "tags": "loyal",
  "tax_exempt": true,
  "total_spent": 37.96,
  "updated_at": "2012-08-24T14:01:46-04:00",
  "verified_email": true
}

Response

OK

Example response

{
  "customer": {
    "accepts_marketing": true,
    "addresses": [
      {
        "address1": "123 Fake Street",
        "city": "Fakecity",
        "country": "Vietnam",
        "country_code": "VN",
        "country_name": "Viet nam",
        "cpf_or_cnpj_number": "CPF: 231.234.234-23, CNPJ: 23.123.423/4234-24",
        "first_name": "John",
        "last_name": "Smith",
        "name": "example name",
        "province": "Ontario",
        "zip": "K2P 1L4"
      }
    ],
    "average_spent": 37.96,
    "created_at": "2012-08-24T14:01:46-04:00",
    "currency": "USD",
    "default_address": {
      "address1": "123 Fake Street",
      "city": "Fakecity",
      "country": "Vietnam",
      "country_code": "VN",
      "country_name": "Viet nam",
      "cpf_or_cnpj_number": "CPF: 231.234.234-23, CNPJ: 23.123.423/4234-24",
      "first_name": "John",
      "last_name": "Smith",
      "name": "example name",
      "province": "Ontario",
      "zip": "K2P 1L4"
    },
    "email": "test@shopbase.com",
    "first_name": "John",
    "id": 107333978,
    "last_name": "English",
    "last_order_at": "2012-08-24T14:01:46-04:00",
    "last_order_id": 234132602919,
    "last_order_name": "#1169",
    "last_sent_abandoned_email_at": "2012-08-24T14:01:46-04:00",
    "note": "Placed an order that had a fraud warning",
    "orders_count": 6,
    "phone": "+16135551111",
    "state": "disabled",
    "tags": "loyal",
    "tax_exempt": true,
    "total_spent": 37.96,
    "updated_at": "2012-08-24T14:01:46-04:00",
    "verified_email": true
  }
}