PUT api/cart/{cartId}/items
This method will add a new product to a cart for a property with a specified discount code if known upfront
Requires Authorization!
Request Information
URI Parameters
| Name | Description | Type | Additional information |
|---|---|---|---|
| cartId |
Existing cart id |
integer |
Required |
Body Parameters
Instance of
CartItemBindingModel| Name | Description | Type | Additional information |
|---|---|---|---|
| ProductBundleId | integer |
None. |
|
| PropertyAddressId | integer |
None. |
|
| DiscountCode | string |
None. |
|
| TaxYear | integer |
None. |
|
| SecondaryProductBundleId | integer |
None. |
|
| AgencyId | integer |
None. |
|
| PrimaryAppealTypeId | integer |
None. |
|
| SecondaryAppealTypeId | integer |
None. |
|
| Quantity | integer |
None. |
|
| isContingent | boolean |
None. |
Request Formats
application/json, text/json
Sample:
{
"productBundleId": 1,
"propertyAddressId": 1,
"discountCode": "sample string 2",
"taxYear": 1,
"secondaryProductBundleId": 1,
"agencyId": 1,
"primaryAppealTypeId": 1,
"secondaryAppealTypeId": 1,
"quantity": 1,
"isContingent": true
}
text/html
Sample:
{"productBundleId":1,"propertyAddressId":1,"discountCode":"sample string 2","taxYear":1,"secondaryProductBundleId":1,"agencyId":1,"primaryAppealTypeId":1,"secondaryAppealTypeId":1,"quantity":1,"isContingent":true}
application/xml, text/xml
Sample:
<CartItemBindingModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Ptd.Model.Entities.Payments"> <AgencyId>1</AgencyId> <DiscountCode>sample string 2</DiscountCode> <PrimaryAppealTypeId>1</PrimaryAppealTypeId> <ProductBundleId>1</ProductBundleId> <PropertyAddressId>1</PropertyAddressId> <Quantity>1</Quantity> <SecondaryAppealTypeId>1</SecondaryAppealTypeId> <SecondaryProductBundleId>1</SecondaryProductBundleId> <TaxYear>1</TaxYear> <isContingent>true</isContingent> </CartItemBindingModel>
application/x-www-form-urlencoded
Sample:
Response Information
Resource Description
Instance of
CartModel| Name | Description | Type | Additional information |
|---|---|---|---|
| Id | integer |
None. |
|
| UserId | integer |
None. |
|
| Items | Collection of CartItemModel |
None. |
|
| SubTotalAmount | decimal number |
None. |
|
| TotalDiscountAmount | decimal number |
None. |
|
| FinalChargeAmount | decimal number |
None. |
Response Formats
application/json, text/json
Sample:
{
"id": 1,
"userId": 1,
"items": [
{
"id": 1,
"cartId": 2,
"productBundleId": 3,
"name": "sample string 4",
"description": "sample string 5",
"previewImageUrl": "sample string 6",
"discountCode": "sample string 7",
"discountPercent": 8.0,
"bundlePrice": 9.0,
"quantity": 10,
"propertyAddressId": 1,
"pin": "sample string 11",
"addressLine1": "sample string 12",
"addressLastLine": "sample string 13",
"townshipName": "sample string 14",
"countyName": "sample string 15",
"secondaryProductBundleId": 1,
"agencyId": 1,
"secondaryProduct": "sample string 16",
"secondaryProductDescription": "sample string 17",
"secondaryProductPreviewImageUrl": "sample string 18",
"agency": "sample string 19",
"primaryAppealTypeId": 1,
"secondaryAppealTypeId": 1,
"isContingent": true,
"contingencyFee": 1.0,
"processingFee": 1.0
},
{
"id": 1,
"cartId": 2,
"productBundleId": 3,
"name": "sample string 4",
"description": "sample string 5",
"previewImageUrl": "sample string 6",
"discountCode": "sample string 7",
"discountPercent": 8.0,
"bundlePrice": 9.0,
"quantity": 10,
"propertyAddressId": 1,
"pin": "sample string 11",
"addressLine1": "sample string 12",
"addressLastLine": "sample string 13",
"townshipName": "sample string 14",
"countyName": "sample string 15",
"secondaryProductBundleId": 1,
"agencyId": 1,
"secondaryProduct": "sample string 16",
"secondaryProductDescription": "sample string 17",
"secondaryProductPreviewImageUrl": "sample string 18",
"agency": "sample string 19",
"primaryAppealTypeId": 1,
"secondaryAppealTypeId": 1,
"isContingent": true,
"contingencyFee": 1.0,
"processingFee": 1.0
}
],
"subTotalAmount": 18.0,
"totalDiscountAmount": 144.0,
"finalChargeAmount": -126.0
}
text/html
Sample:
{"id":1,"userId":1,"items":[{"id":1,"cartId":2,"productBundleId":3,"name":"sample string 4","description":"sample string 5","previewImageUrl":"sample string 6","discountCode":"sample string 7","discountPercent":8.0,"bundlePrice":9.0,"quantity":10,"propertyAddressId":1,"pin":"sample string 11","addressLine1":"sample string 12","addressLastLine":"sample string 13","townshipName":"sample string 14","countyName":"sample string 15","secondaryProductBundleId":1,"agencyId":1,"secondaryProduct":"sample string 16","secondaryProductDescription":"sample string 17","secondaryProductPreviewImageUrl":"sample string 18","agency":"sample string 19","primaryAppealTypeId":1,"secondaryAppealTypeId":1,"isContingent":true,"contingencyFee":1.0,"processingFee":1.0},{"id":1,"cartId":2,"productBundleId":3,"name":"sample string 4","description":"sample string 5","previewImageUrl":"sample string 6","discountCode":"sample string 7","discountPercent":8.0,"bundlePrice":9.0,"quantity":10,"propertyAddressId":1,"pin":"sample string 11","addressLine1":"sample string 12","addressLastLine":"sample string 13","townshipName":"sample string 14","countyName":"sample string 15","secondaryProductBundleId":1,"agencyId":1,"secondaryProduct":"sample string 16","secondaryProductDescription":"sample string 17","secondaryProductPreviewImageUrl":"sample string 18","agency":"sample string 19","primaryAppealTypeId":1,"secondaryAppealTypeId":1,"isContingent":true,"contingencyFee":1.0,"processingFee":1.0}],"subTotalAmount":18.0,"totalDiscountAmount":144.0,"finalChargeAmount":-126.0}
application/xml, text/xml
Sample:
<CartModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Ptd.Model.WebModels.OrderProcessing">
<FinalChargeAmount>-126</FinalChargeAmount>
<Id>1</Id>
<Items>
<CartItemModel>
<AddressLastLine>sample string 13</AddressLastLine>
<AddressLine1>sample string 12</AddressLine1>
<Agency>sample string 19</Agency>
<AgencyId>1</AgencyId>
<BundlePrice>9</BundlePrice>
<CartId>2</CartId>
<ContingencyFee>1</ContingencyFee>
<CountyName>sample string 15</CountyName>
<Description>sample string 5</Description>
<DiscountCode>sample string 7</DiscountCode>
<DiscountPercent>8</DiscountPercent>
<Id>1</Id>
<IsContingent>true</IsContingent>
<Name>sample string 4</Name>
<Pin>sample string 11</Pin>
<PreviewImageUrl>sample string 6</PreviewImageUrl>
<PrimaryAppealTypeId>1</PrimaryAppealTypeId>
<ProcessingFee>1</ProcessingFee>
<ProductBundleId>3</ProductBundleId>
<PropertyAddressId>1</PropertyAddressId>
<Quantity>10</Quantity>
<SecondaryAppealTypeId>1</SecondaryAppealTypeId>
<SecondaryProduct>sample string 16</SecondaryProduct>
<SecondaryProductBundleId>1</SecondaryProductBundleId>
<SecondaryProductDescription>sample string 17</SecondaryProductDescription>
<SecondaryProductPreviewImageUrl>sample string 18</SecondaryProductPreviewImageUrl>
<TownshipName>sample string 14</TownshipName>
</CartItemModel>
<CartItemModel>
<AddressLastLine>sample string 13</AddressLastLine>
<AddressLine1>sample string 12</AddressLine1>
<Agency>sample string 19</Agency>
<AgencyId>1</AgencyId>
<BundlePrice>9</BundlePrice>
<CartId>2</CartId>
<ContingencyFee>1</ContingencyFee>
<CountyName>sample string 15</CountyName>
<Description>sample string 5</Description>
<DiscountCode>sample string 7</DiscountCode>
<DiscountPercent>8</DiscountPercent>
<Id>1</Id>
<IsContingent>true</IsContingent>
<Name>sample string 4</Name>
<Pin>sample string 11</Pin>
<PreviewImageUrl>sample string 6</PreviewImageUrl>
<PrimaryAppealTypeId>1</PrimaryAppealTypeId>
<ProcessingFee>1</ProcessingFee>
<ProductBundleId>3</ProductBundleId>
<PropertyAddressId>1</PropertyAddressId>
<Quantity>10</Quantity>
<SecondaryAppealTypeId>1</SecondaryAppealTypeId>
<SecondaryProduct>sample string 16</SecondaryProduct>
<SecondaryProductBundleId>1</SecondaryProductBundleId>
<SecondaryProductDescription>sample string 17</SecondaryProductDescription>
<SecondaryProductPreviewImageUrl>sample string 18</SecondaryProductPreviewImageUrl>
<TownshipName>sample string 14</TownshipName>
</CartItemModel>
</Items>
<SubTotalAmount>18</SubTotalAmount>
<TotalDiscountAmount>144</TotalDiscountAmount>
<UserId>1</UserId>
</CartModel>