POST v1/Customers/{customerId}/FavoriteItems

Add Favorite Item for a customer

URI template

v1/Customers/{customerId}/FavoriteItems

Request Information

URI Parameters

NameDescriptionTypeAdditional information
customerId

The customer id of the customer

globally unique identifier

Required

Body Parameters

Information about the item to be added as favorite

InAddFavoriteItem
NameDescriptionTypeAdditional information
SiteId

Site Id

integer

Required

OrderId

Order Id

integer

Required

LineId

Line item number of an order line item or group line id of a web sales group

integer

Required

FavoriteItemName

Name of favorite item

string

Required

Request Formats

application/json, text/json

Sample:
{
  "SiteId": 1,
  "OrderId": 2,
  "LineId": 3,
  "FavoriteItemName": "sample string 4"
}

application/xml, text/xml

Sample:
<InAddFavoriteItem xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/OnlineOrderingAPI.Inbound">
  <FavoriteItemName>sample string 4</FavoriteItemName>
  <LineId>3</LineId>
  <OrderId>2</OrderId>
  <SiteId>1</SiteId>
</InAddFavoriteItem>

Response Information

Resource Description

The favorite item id of the item just added. Known internal errors are NotFound and BadRequest

ResponseOfAddFavoriteItemResult
NameDescriptionTypeAdditional information
Verbose

string

None.

Message

string

None.

ErrorCode

integer

None.

Result

AddFavoriteItemResult

None.

Response Formats

application/json, text/json

Sample:
{
  "Verbose": "sample string 1",
  "Message": "sample string 2",
  "ErrorCode": 3,
  "Result": {
    "$id": "2",
    "FavoriteId": 4
  }
}

application/xml, text/xml

Sample:
<ResponseOfAddFavoriteItemResultrIMKuFPx xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/OnlineOrderingAPI.Models.v1">
  <ErrorCode>3</ErrorCode>
  <Message>sample string 2</Message>
  <Result xmlns:d2p1="http://schemas.datacontract.org/2004/07/OnlineOrderingAPI.Models.v1.Response">
    <d2p1:FavoriteId>4</d2p1:FavoriteId>
  </Result>
  <Verbose>sample string 1</Verbose>
</ResponseOfAddFavoriteItemResultrIMKuFPx>