Order service API (1.0.0-order)

Download OpenAPI specification:

Order service API

Cart, order and payment related service API

cart

Carts related operations

Get cart with given id

Returns the shopping cart.

Authorizations:
api_key
path Parameters
id
required
string

The resource id

query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

Responses

Response samples

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

Get current shopping cart

Return the cart that is associated with the JWT token

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Responses

Response samples

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

Submit the order

Submit the order for the customer's current shopping cart

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Request Body schema: application/json
required

Get the cart for cart id

cartId
string

The id of the shopping cart that was submitted as an order

Responses

Request samples

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

Response samples

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

Adds address(es) to the cart

Adds one address to the cart and uses it as a billing address, shipping address or both

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

idempotency-key
required
string

Ensures idempotency

Request Body schema: application/json
required

An object containing the addresses to add. Either delivery or billing address must be provided.

If billingSameAsDeliveryAddress is true then delivery address must be specified.

object (order-address)
object (order-address)
billingSameAsDeliveryAddress
boolean

Responses

Request samples

Content type
application/json
{
  • "deliveryAddress": {
    },
  • "billingAddress": {
    },
  • "billingSameAsDeliveryAddress": true
}

Response samples

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

Adds billing address to the cart

Adds a billing address to the cart

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

idempotency-key
required
string

Ensures idempotency

Request Body schema: application/json
required

An object containing the billing address.

object (order-address)

Responses

Request samples

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

Response samples

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

Remove billing address from cart

Remove a billing address from cart

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Responses

Response samples

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

Adds delivery address to the cart

Adds a shipping/delivery address to the cart and optionally uses it as a billing address.

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

idempotency-key
required
string

Ensures idempotency

Request Body schema: application/json
required

An object containing the delivery address.

If billingSameAsDeliveryAddress is true then delivery address also populates billing address.

object (order-address)
billingSameAsDeliveryAddress
boolean

Responses

Request samples

Content type
application/json
{
  • "deliveryAddress": {
    },
  • "billingSameAsDeliveryAddress": true
}

Response samples

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

Remove delivery address from cart

Remove a delivery address from cart

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Responses

Response samples

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

Sets the delivery method for the current cart of a customer

Sets the delivery method for the current cart of a customer

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Request Body schema: application/json
required

The delivery method to add, containing the method and either the delivery, collection or digital delivery details.

deliveryMethod
required
string
Enum: "Home" "Collection" "Digital"
object (order-delivery-method)
object
object

Responses

Request samples

Content type
application/json
{
  • "deliveryMethod": "Home",
  • "homeDelivery": {
    },
  • "collection": {
    },
  • "digitalDelivery": {
    }
}

Response samples

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

Adds a discount code to the cart

Adds a discount code (coupon code) to the cart and recalculates the price.

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Request Body schema: application/json
required

The discount code to add to the cart.

code
required
string

Responses

Request samples

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

Response samples

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

Removes a discount code from the cart

Removes a discount code from the cart and recalculates the price.

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Request Body schema: application/json
required

The discount code to add to the cart.

code
required
string

Responses

Request samples

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

Response samples

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

Remove group from cart

Remove a cart product group (frame, contact-lens or other)

Authorizations:
api_key
path Parameters
id
required
string

The resource id

query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Request Body schema: application/json
groupId
number

Responses

Request samples

Content type
application/json
{
  • "groupId": 0
}

Response samples

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

Add contact lens product group to cart

Add left and right contact lens skus to the cart

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

idempotency-key
required
string

Ensures idempotency

Request Body schema: application/json
object

Responses

Request samples

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

Response samples

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

Update contacts lens product group

Update the left and right skus within the cart

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

idempotency-key
required
string

Ensures idempotency

Request Body schema: application/json
object

Responses

Request samples

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

Response samples

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

Add frame product group to cart

Add frame group details to the cart

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

idempotency-key
required
string

Ensures idempotency

Request Body schema: application/json

Todo: Update frame object when details are known

frame
object
talonOneData
string
prescription
string

Responses

Request samples

Content type
application/json
{
  • "frame": { },
  • "talonOneData": "string",
  • "prescription": "string"
}

Response samples

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

Update frame product group

Update the frame product group details within the cart

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

idempotency-key
required
string

Ensures idempotency

Request Body schema: application/json

Todo: Update frame object when details are known

frame
object
talonOneData
string
prescription
string

Responses

Request samples

Content type
application/json
{
  • "frame": { },
  • "talonOneData": "string",
  • "prescription": "string"
}

Response samples

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

Initiates a payment session with Adyen for the customer's current shopping cart

Initiates a payment session with Adyen for the customer's current shopping cart

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

idempotency-key
required
string

Ensures idempotency

Request Body schema: application/json
required

The payment session parameter(s).

object (money)

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "id": "string",
  • "amount": {
    },
  • "sessionData": "string"
}

Creates an Adyen payment for the customer's current shopping cart

Creates an Adyen payment, returning the payment details required for integration with Adyen Web Components.

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

idempotency-key
required
string

Ensures idempotency

Request Body schema: application/json
required

Payload for creating an Adyen payment.

required
object (money)
required
object

Payment method details as provided by Adyen.

required
object

Browser information required for the payment process.

Responses

Request samples

Content type
application/json
{
  • "amount": {
    },
  • "paymentMethod": { },
  • "browserInfo": { }
}

Response samples

Content type
application/json
{
  • "paymentId": "string",
  • "amount": {
    },
  • "resultCode": "AuthenticationFinished",
  • "action": {
    },
  • "paymentMethod": { }
}

Fetches the available payment methods Adyen provides for the customer's current shopping cart

Fetches the available payment methods Adyen provides for the customer's current shopping cart

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

idempotency-key
required
string

Ensures idempotency

Responses

Response samples

Content type
application/json
{
  • "paymentMethods": [
    ],
  • "responseString": "string"
}

Initiates a payment session with HICAPS y for the customer's current shopping cart

Initiates a payment session with HICAPS for the customer's current shopping cart

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Request Body schema: application/json
required

The payment session parameter(s).

fund
required
string

The payment method to use

memberNumber
required
string

Responses

Request samples

Content type
application/json
{
  • "fund": "string",
  • "memberNumber": "string"
}

Response samples

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

Sets the aftercare store for the customer's current cart and updates the customer's default aftercare store

Sets the aftercare store for the customer's current cart and updates the customer's default aftercare store

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

marketKey
required
string

The market key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Request Body schema: application/json
required

The payload schema describes the information required to set the aftercare store on the customer's cart.

aftercareStoreId
required
string

The aftercare store id of the store to set on the customer's cart

Responses

Request samples

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

Response samples

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

order

Orders related operations

Cancel the active cart

Cancel the active cart

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

idempotency-key
required
string

Ensures idempotency

Responses

Response samples

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

Creates an express re-order cart

Creates an express re-order cart from a previous order

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

idempotency-key
required
string

Ensures idempotency

Request Body schema: application/json
required

The id of the order to be used for express re-order

orderId
string

Responses

Request samples

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

Response samples

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

Health check information for the carts service

Health check information for the carts service

Authorizations:
api_key

Responses

Response samples

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

Get orders by ids

Get orders by ids

Authorizations:
api_key
query Parameters
ids
required
string

A comma-separated list of order IDs to retrieve

Responses

Response samples

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

Get an order by id

Get an order by id

Authorizations:
api_key
path Parameters
id
required
string

The resource id

Responses

Response samples

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

Create a return

Create a new return for an order

Authorizations:
api_key
path Parameters
id
required
string

The resource id

query Parameters
siteKey
required
string

The site key for the order

locale
required
string

The locale for the request

header Parameters
idempotency-key
required
string

Idempotency key to ensure the request is processed only once

Request Body schema: application/json
required
required
object

The details of the items to return

Responses

Request samples

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

Response samples

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

Create an appeasement

Creates an appeasement for an order. An appeasement is a refund without requiring physical items to be returned.

Authorizations:
api_key
path Parameters
id
required
string

The resource id

query Parameters
siteKey
required
string

The site key for the order

locale
required
string

The locale for the request

header Parameters
idempotency-key
required
string

Idempotency key to ensure the request is processed only once

Request Body schema: application/json
required
required
object (appeasement-calculation-input)
reasonCode
required
string

The reason code for the appeasement

additionalInfo
string

Optional additional information about the appeasement

Responses

Request samples

Content type
application/json
{
  • "input": {
    },
  • "reasonCode": "string",
  • "additionalInfo": "string"
}

Response samples

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

Create a replacement

Create a new replacement for an order

Authorizations:
api_key
path Parameters
id
required
string

The resource id

query Parameters
marketKey
required
string

The market key for the order

siteKey
required
string

The site key for the order

locale
required
string

The locale for the request

header Parameters
idempotency-key
required
string

Idempotency key to ensure the request is processed only once

Request Body schema: application/json
required
required
object

The details of the items to replacement

Responses

Request samples

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

Response samples

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

Generate a return summary

Generate a summary for creating a new return

Authorizations:
api_key
path Parameters
id
required
string

The resource id

Responses

Response samples

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

Price a return summary

Price a summary for creating a new return

Authorizations:
api_key
path Parameters
id
required
string

The resource id

Request Body schema: application/json
required
required
object

The details of the items to price for a return refund

Responses

Request samples

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

Response samples

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

Get appeasement summary

Get a summary for creating a new appeasement

Authorizations:
api_key
path Parameters
id
required
string

The resource id

Request Body schema: application/json
type
required
string
Enum: "PERCENTAGE" "AMOUNT"
value
required
number
lineItemIds
required
Array of strings
includeShipping
required
boolean

Responses

Request samples

Content type
application/json
{
  • "type": "PERCENTAGE",
  • "value": 0,
  • "lineItemIds": [
    ],
  • "includeShipping": true
}

Response samples

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

Generate a replacement summary

Generate a summary for creating a new replacement

Authorizations:
api_key
path Parameters
id
required
string

The resource id

Responses

Response samples

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

Set a return as manually refunded

Sets a return as manually refunded by recording transaction details. This endpoint is used when a return has been refunded outside of the normal automated process and needs to be marked as such in the system.

Authorizations:
api_key
path Parameters
orderNumber
required
string

The order number

returnKey
required
string

The return key

query Parameters
siteKey
required
string

Site key

locale
required
string

Locale

Request Body schema: application/json
required
transactionRef
string

Optional reference to the external transaction

transactionNotes
required
string

Notes about the manual refund transaction

Responses

Request samples

Content type
application/json
{
  • "transactionRef": "string",
  • "transactionNotes": "string"
}

Response samples

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

Get returns by order number

Retrieves all returns associated with a specific order number. This endpoint allows filtering and retrieving return information for a given order.

Authorizations:
api_key
path Parameters
orderNumber
required
string

The order number to get returns for

Responses

Response samples

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

Get a specific return by order number and return key

Retrieves a specific return using the order number and return key. This endpoint provides detailed information about a single return associated with an order.

Authorizations:
api_key
path Parameters
orderNumber
required
string

The order number

returnKey
required
string

The return key

Responses

Response samples

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

Cancel an order by id

Cancel an order by id

Authorizations:
api_key
path Parameters
id
required
string

The resource id

query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

Request Body schema: application/json
required

Payload for cancelling an order by id

code
required
string

Reason code

detail
required
string

Details about the cancellation reason

Responses

Request samples

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

Response samples

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

Get an order by order number

Get an order by order number

Authorizations:
api_key
path Parameters
orderNumber
required
string

The order number

Responses

Response samples

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

Get my orders

Get a collection of the customer's orders.

Authorizations:
api_key
query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

page
required
string

The page of the orders to get starting from 0. Related to the page-size, for example with page-size set to 5, page 1 will get orders 6-10.

page-size
required
string

The page size of the returned data

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Responses

Response samples

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

Health check information for the orders service

Health check information for the orders service

Authorizations:
api_key

Responses

Response samples

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

return

Returns related operations

Create a return

Create a new return for an order

Authorizations:
api_key
path Parameters
id
required
string

The resource id

query Parameters
siteKey
required
string

The site key for the order

locale
required
string

The locale for the request

header Parameters
idempotency-key
required
string

Idempotency key to ensure the request is processed only once

Request Body schema: application/json
required
required
object

The details of the items to return

Responses

Request samples

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

Response samples

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

Generate a return summary

Generate a summary for creating a new return

Authorizations:
api_key
path Parameters
id
required
string

The resource id

Responses

Response samples

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

Price a return summary

Price a summary for creating a new return

Authorizations:
api_key
path Parameters
id
required
string

The resource id

Request Body schema: application/json
required
required
object

The details of the items to price for a return refund

Responses

Request samples

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

Response samples

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

Set a return as manually refunded

Sets a return as manually refunded by recording transaction details. This endpoint is used when a return has been refunded outside of the normal automated process and needs to be marked as such in the system.

Authorizations:
api_key
path Parameters
orderNumber
required
string

The order number

returnKey
required
string

The return key

query Parameters
siteKey
required
string

Site key

locale
required
string

Locale

Request Body schema: application/json
required
transactionRef
string

Optional reference to the external transaction

transactionNotes
required
string

Notes about the manual refund transaction

Responses

Request samples

Content type
application/json
{
  • "transactionRef": "string",
  • "transactionNotes": "string"
}

Response samples

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

Get returns by order number

Retrieves all returns associated with a specific order number. This endpoint allows filtering and retrieving return information for a given order.

Authorizations:
api_key
path Parameters
orderNumber
required
string

The order number to get returns for

Responses

Response samples

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

Get a specific return by order number and return key

Retrieves a specific return using the order number and return key. This endpoint provides detailed information about a single return associated with an order.

Authorizations:
api_key
path Parameters
orderNumber
required
string

The order number

returnKey
required
string

The return key

Responses

Response samples

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

replacement

Replacements related operations

Create a replacement

Create a new replacement for an order

Authorizations:
api_key
path Parameters
id
required
string

The resource id

query Parameters
marketKey
required
string

The market key for the order

siteKey
required
string

The site key for the order

locale
required
string

The locale for the request

header Parameters
idempotency-key
required
string

Idempotency key to ensure the request is processed only once

Request Body schema: application/json
required
required
object

The details of the items to replacement

Responses

Request samples

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

Response samples

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

Generate a replacement summary

Generate a summary for creating a new replacement

Authorizations:
api_key
path Parameters
id
required
string

The resource id

Responses

Response samples

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

appeasement

Appeasements related operations

Create an appeasement

Creates an appeasement for an order. An appeasement is a refund without requiring physical items to be returned.

Authorizations:
api_key
path Parameters
id
required
string

The resource id

query Parameters
siteKey
required
string

The site key for the order

locale
required
string

The locale for the request

header Parameters
idempotency-key
required
string

Idempotency key to ensure the request is processed only once

Request Body schema: application/json
required
required
object (appeasement-calculation-input)
reasonCode
required
string

The reason code for the appeasement

additionalInfo
string

Optional additional information about the appeasement

Responses

Request samples

Content type
application/json
{
  • "input": {
    },
  • "reasonCode": "string",
  • "additionalInfo": "string"
}

Response samples

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

Get appeasement summary

Get a summary for creating a new appeasement

Authorizations:
api_key
path Parameters
id
required
string

The resource id

Request Body schema: application/json
type
required
string
Enum: "PERCENTAGE" "AMOUNT"
value
required
number
lineItemIds
required
Array of strings
includeShipping
required
boolean

Responses

Request samples

Content type
application/json
{
  • "type": "PERCENTAGE",
  • "value": 0,
  • "lineItemIds": [
    ],
  • "includeShipping": true
}

Response samples

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

subscription

Get a subscription by id

Get a subscription by id

Authorizations:
api_key
path Parameters
subscriptionId
required
string

The ID of the subscription

Responses

Response samples

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

Update the subscription cart's recurrence_policy

Update the subscription cart's recurrence_policy

Authorizations:
api_key
path Parameters
subscriptionId
required
string

The ID of the subscription

query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Request Body schema: application/json
subscriptionId
string
subscriptionPlanType
string
Enum: "POSTPAY" "PREPAY" "RECURRING"
recurrencePolicyId
string
nextOrderAt
string

Responses

Request samples

Content type
application/json
{
  • "subscriptionId": "string",
  • "subscriptionPlanType": "POSTPAY",
  • "recurrencePolicyId": "string",
  • "nextOrderAt": "string"
}

Response samples

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

Remove a group from a customer's subscription's template cart

Remove a group from a customer's subscription's template cart

Authorizations:
api_key
path Parameters
subscriptionId
required
string

The ID of the subscription

groupId
required
string

The ID of a contact lens group in a cart

query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Responses

Response samples

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

Pause the subscription

Pause the subscription

Authorizations:
api_key
path Parameters
subscriptionId
required
string

The ID of the subscription

query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Responses

Response samples

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

Resume the subscription

Resume the subscription

Authorizations:
api_key
path Parameters
subscriptionId
required
string

The ID of the subscription

query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Responses

Response samples

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

Cancel the subscription

Cancel the subscription

Authorizations:
api_key
path Parameters
subscriptionId
required
string

The ID of the subscription

query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Request Body schema: application/json
required

Payload for cancelling a subscription by id.

code
required
string

Reason code

detail
required
string

Detail about the cancellation reason

paymentMethodId
string

Identifier of the payment method to settle outstanding balance

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "detail": "string",
  • "paymentMethodId": "string"
}

Response samples

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

Retry the subscription payment

Retry the subscription payment

Authorizations:
api_key
path Parameters
subscriptionId
required
string

The ID of the subscription

query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Responses

Response samples

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

Get my subscription

Get my subscription

Authorizations:
api_key
query Parameters
customerId
required
string

The id of the customer

siteKey
required
string

The site key

Responses

Response samples

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

Get my subscriptions

Get my subscriptions

Authorizations:
api_key
query Parameters
customerId
required
string

The id of the customer

siteKey
required
string

The site key

Responses

Response samples

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

Remove a group from a subscription's template cart

Remove a group from a subscription's template cart

Authorizations:
api_key
path Parameters
subscriptionId
required
string

The ID of the subscription

groupId
required
string

The ID of a contact lens group in a cart

query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Responses

Response samples

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

Pause the subscription

Pause the subscription

Authorizations:
api_key
path Parameters
subscriptionId
required
string

The ID of the subscription

query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Responses

Response samples

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

Resume the subscription

Resume the subscription

Authorizations:
api_key
path Parameters
subscriptionId
required
string

The ID of the subscription

query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Responses

Response samples

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

Cancel the subscription

Cancel the subscription

Authorizations:
api_key
path Parameters
subscriptionId
required
string

The ID of the subscription

query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Request Body schema: application/json
required

Payload for cancelling a subscription by id.

code
required
string

Reason code

detail
required
string

Detail about the cancellation reason

paymentMethodId
string

Identifier of the payment method to settle outstanding balance

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "detail": "string",
  • "paymentMethodId": "string"
}

Response samples

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

Retry the subscription payment

Retry the subscription payment

Authorizations:
api_key
path Parameters
subscriptionId
required
string

The ID of the subscription

query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Responses

Response samples

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

Update subscription's payment method

Update subscription's payment method

Authorizations:
api_key
path Parameters
subscriptionId
required
string

The ID of the subscription

query Parameters
siteKey
required
string

The site key

locale
required
string

The ISO locale code

header Parameters
specsavers-customer-auth
required
string

The JWT authorisation token known to commercetools for the customer session

Request Body schema: application/json
paymentMethodId
string

Responses

Request samples

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

Response samples

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

Update upcoming orders

Update upcoming orders

Authorizations:
api_key

Responses

Health check information for the subscriptions service

Health check information for the subscriptions service

Authorizations:
api_key

Responses

Response samples

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