Customer service API (1.0.0-customer)

Download OpenAPI specification:

Customer related service API

customer

Customer service

Get customer by id

Authorizations:
api_key
path Parameters
customerId
required
string

Customer ID

query Parameters
siteKey
string

The site key

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Update customer profile by id

Update profile fields for a customer identified by ID

Authorizations:
api_key
path Parameters
customerId
required
string <uuid> ^[0-9a-fA-F-]{36}$

Customer ID

query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

marketKey
required
string

The market key

Request Body schema: application/json
required

Partial profile update payload

title
string
firstName
string
lastName
string
dateOfBirth
string <date>
phoneNumber
string
email
string <email>

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "firstName": "string",
  • "lastName": "string",
  • "dateOfBirth": "2019-08-24",
  • "phoneNumber": "string",
  • "email": "user@example.com"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Update customer email by id

Update the email address for a customer identified by ID

Authorizations:
api_key
path Parameters
customerId
required
string

Customer ID

query Parameters
siteKey
required
string

The site key

Request Body schema: application/json
required

Email update payload

email
required
string <email>

The new email address

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Add customer activity

Add an activity log entry for a customer (colleague route)

Authorizations:
api_key
path Parameters
customerId
required
string

Customer ID

query Parameters
siteKey
required
string

The site key

header Parameters
idempotency-key
required
string

Ensures idempotency

Request Body schema: application/json
required

Activity payload

detail
required
string

Activity detail text

channel
string
Enum: "online" "instore" "customer-service"

The channel where the activity occurred

Responses

Request samples

Content type
application/json
{
  • "detail": "string",
  • "channel": "online"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Update customer payment method

Update a customer's payment method by ID (colleague route)

Authorizations:
api_key
path Parameters
customerId
required
string

Customer ID

paymentMethodId
required
string

Payment method id

query Parameters
siteKey
required
string

The site key

header Parameters
idempotency-key
required
string

Ensures idempotency

Request Body schema: application/json
required

Payment method update payload

holderName
required
string

Cardholder name

object (address-draft)

Responses

Request samples

Content type
application/json
{
  • "holderName": "string",
  • "address": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Remove customer payment method

Remove a customer's payment method by ID (colleague route)

Authorizations:
api_key
path Parameters
customerId
required
string

Customer ID

paymentMethodId
required
string

Payment method id

query Parameters
siteKey
required
string

The site key

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Add delivery address to customer

Add a delivery address to a customer (colleague route)

Authorizations:
api_key
path Parameters
customerId
required
string <uuid> ^[0-9a-fA-F-]{36}$

Customer ID

query Parameters
siteKey
required
string

The site key

header Parameters
idempotency-key
required
string

Ensures idempotency

Request Body schema: application/json
required

Delivery address payload

isDefault
required
boolean

Whether this should be the default delivery address

required
object (address-draft)

Responses

Request samples

Content type
application/json
{
  • "isDefault": true,
  • "address": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Edit delivery address

Edit a customer's delivery address (colleague route)

Authorizations:
api_key
path Parameters
customerId
required
string <uuid> ^[0-9a-fA-F-]{36}$

Customer ID

addressId
required
string

Address id

query Parameters
siteKey
required
string

The site key

header Parameters
idempotency-key
required
string

Ensures idempotency

Request Body schema: application/json
required

Delivery address update payload

isDefault
required
boolean

Whether this should be the default delivery address

required
object (address-draft)

Responses

Request samples

Content type
application/json
{
  • "isDefault": true,
  • "address": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Remove delivery address

Remove a customer's delivery address (colleague route)

Authorizations:
api_key
path Parameters
customerId
required
string

Customer ID

addressId
required
string

Address id

query Parameters
siteKey
required
string

The site key

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Set default delivery address

Set a delivery address as the default for a customer (colleague route)

Authorizations:
api_key
path Parameters
customerId
required
string

Customer ID

addressId
required
string

Address id

query Parameters
siteKey
required
string

The site key

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Returns customer for the given parameters

The customer details are returned matching the provided customer token and site key

Authorizations:
api_key
query Parameters
marketKey
required
string

The market key

header Parameters
specsavers-customer-auth
required
string

The customer token

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Updates the customer's profile

Update the current customer's profile fields

Authorizations:
api_key
query Parameters
marketKey
required
string

The market key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The customer token

Request Body schema: application/json
required

The payload schema describes the information required to update the customer's profile

title
string

The title being set

firstName
required
string

The first name being set

lastName
required
string

The last name being set

nationalHealthId
string

The national health ID being set

dateOfBirth
string

The data of birth being set

gender
string

The gender being set

phoneNumber
string

The telephone number being set

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "firstName": "string",
  • "lastName": "string",
  • "nationalHealthId": "string",
  • "dateOfBirth": "string",
  • "gender": "string",
  • "phoneNumber": "string"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Add address for current customer

Add a new address to the current customer's profile

Authorizations:
api_key
query Parameters
marketKey
required
string

The market key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The customer token

idempotency-key
required
string

Ensures idempotency

Request Body schema: application/json
required

The payload schema describes the information required to add an address to the customer's profile

required
object (address-draft)

The address being set

isBilling
boolean

Indicates the address should be used for billing

isDelivery
boolean

Indicates the address should be used for delivery

isDefaultBilling
boolean

Indicates the address should be used as the default for billing

isDefaultDelivery
boolean

Indicates the address should be used as the default for delivery

Responses

Request samples

Content type
application/json
{
  • "address": {
    },
  • "isBilling": true,
  • "isDelivery": true,
  • "isDefaultBilling": true,
  • "isDefaultDelivery": true
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "context": {
    },
  • "metrics": {
    }
}

Edit address for current customer

Edit an existing address in the current customer's profile

Authorizations:
api_key
path Parameters
addressId
required
string

The ID of the address to edit

query Parameters
marketKey
required
string

The market key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The customer token

idempotency-key
required
string

Ensures idempotency

Request Body schema: application/json
required

The payload schema describes the information required to edit an address in the customer's profile

addressId
required
string

The ID of the address being edited

required
object (address-draft)

The address being edited

isBilling
boolean

Indicates the address should be used for billing

isDelivery
boolean

Indicates the address should be used for delivery

isDefaultBilling
boolean

Indicates the address should be used as the default for billing

isDefaultDelivery
boolean

Indicates the address should be used as the default for delivery

Responses

Request samples

Content type
application/json
{
  • "addressId": "string",
  • "address": {
    },
  • "isBilling": true,
  • "isDelivery": true,
  • "isDefaultBilling": true,
  • "isDefaultDelivery": true
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Remove address for current customer

Remove an address from the current customer's profile

Authorizations:
api_key
path Parameters
addressId
required
string

The ID of the address to remove

query Parameters
marketKey
required
string

The market key

locale
required
string

The ISO locale code

isBilling
boolean

Remove as billing address

isDelivery
boolean

Remove as delivery address

header Parameters
specsavers-customer-auth
required
string

The customer token

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Set default address for current customer

Set an address as the default billing and/or delivery address

Authorizations:
api_key
path Parameters
addressId
required
string

The ID of the address to set as default

query Parameters
marketKey
required
string

The market key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The customer token

Request Body schema: application/json
required

Default address options

isDefaultDelivery
boolean

Set as default delivery address

isDefaultBilling
boolean

Set as default billing address

Responses

Request samples

Content type
application/json
{
  • "isDefaultDelivery": true,
  • "isDefaultBilling": true
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Update last order id for current customer

Update the last glasses or contact lenses order ID for the customer

Authorizations:
api_key
query Parameters
marketKey
required
string

The market key

header Parameters
specsavers-customer-auth
required
string

The customer token

Request Body schema: application/json
required

Last order id payload - at least one ID must be provided

lastContactLensesOrderId
string

ID of the last contact lenses order

lastGlassesOrderId
string

ID of the last glasses order

Responses

Request samples

Content type
application/json
{
  • "lastContactLensesOrderId": "string",
  • "lastGlassesOrderId": "string"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Add payment method for current customer

Add a new payment method to the current customer's wallet

Authorizations:
api_key
query Parameters
marketKey
required
string

The market key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The customer token

Request Body schema: application/json
required

Payment method payload

required
object (address-draft)
adyenPaymentMethod
required
object

Adyen payment method details

object

Responses

Request samples

Content type
application/json
{
  • "address": {
    },
  • "adyenPaymentMethod": { },
  • "amount": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Update payment method for current customer

Update an existing payment method in the customer's wallet

Authorizations:
api_key
path Parameters
paymentMethodId
required
string

The ID of the payment method to update

query Parameters
marketKey
required
string

The market key

header Parameters
specsavers-customer-auth
required
string

The customer token

Request Body schema: application/json
required

Payment method update payload

holderName
string

Cardholder name

expiryMonth
integer

Expiry month (1-12)

expiryYear
integer

Expiry year

object (address-draft)
lastUsedAt
string <date-time>

Last time the payment method was used

Responses

Request samples

Content type
application/json
{
  • "holderName": "string",
  • "expiryMonth": 0,
  • "expiryYear": 0,
  • "address": {
    },
  • "lastUsedAt": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Remove payment method for current customer

Remove a payment method from the customer's wallet

Authorizations:
api_key
path Parameters
paymentMethodId
required
string

The ID of the payment method to remove

query Parameters
marketKey
required
string

The market key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The customer token

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Set default payment method for current customer

Set a payment method as the default for the customer

Authorizations:
api_key
path Parameters
paymentMethodId
required
string

The ID of the payment method to set as default

query Parameters
marketKey
required
string

The market key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The customer token

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Updates the customer's email address

Update the current customer's email address

Authorizations:
api_key
query Parameters
marketKey
required
string

The market key

header Parameters
specsavers-customer-auth
required
string

The customer token

Request Body schema: application/json
required

The payload schema describes the information required to update the customer's email address

email
required
string

The email address being set

Responses

Request samples

Content type
application/json
{
  • "email": "string"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Sets the customer's default aftercare store

Sets the customer's default aftercare store

Authorizations:
api_key
query Parameters
marketKey
required
string

The market key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The customer token

Request Body schema: application/json
required

The payload schema describes the information required to update the customer's default aftercare store.

aftercareStoreId
string

The aftercare store id of the store to set as default on the customer's account

Responses

Request samples

Content type
application/json
{
  • "aftercareStoreId": "string"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Register partial customer

Register a new partial customer account

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

Request Body schema: application/json
required

Customer registration payload

title
string
firstName
string
lastName
string
dateOfBirth
string <date>
phoneNumber
string
email
required
string <email>
marketingOptIn
boolean
Default: false
idpId
string

Identity provider ID

anonymousId
string

Anonymous session ID

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "firstName": "string",
  • "lastName": "string",
  • "dateOfBirth": "2019-08-24",
  • "phoneNumber": "string",
  • "email": "user@example.com",
  • "marketingOptIn": false,
  • "idpId": "string",
  • "anonymousId": "string"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Get cloud customer by id

Authorizations:
api_key
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{ }

Trigger password reset

Handle password reset event from identity provider

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

Request Body schema: application/json
required

Password reset event payload

token
required
string

Password reset token

commercetoolsId
string

Customer's Commercetools ID (optional)

email
required
string <email>

Customer's email address

Responses

Request samples

Content type
application/json
{
  • "token": "string",
  • "commercetoolsId": "string",
  • "email": "user@example.com"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Handle OTP event

Handle OTP verification event from identity provider

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

Request Body schema: application/json
required

OTP event payload

commercetoolsId
string

Customer's commercetools ID (optional)

email
required
string <email>

Customer's email address

otpCode
required
string

One-time password code

Responses

Request samples

Content type
application/json
{
  • "commercetoolsId": "string",
  • "email": "user@example.com",
  • "otpCode": "string"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "metrics": {
    },
  • "context": {
    }
}

Health check information for a service

The health endpoint.

Authorizations:
api_key

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}