POST api/cart

This method will create a new shopping cart for a property and specific product

Request Information

URI Parameters

None.

Body Parameters

Instance of

CreateCartBindingModel
NameDescriptionTypeAdditional information
Items

Collection of CartItemBindingModel

Required

UserId

integer

None.

IsContingent

boolean

None.

Request Formats

application/json, text/json

Sample:
{
  "items": [
    {
      "productBundleId": 1,
      "propertyAddressId": 1,
      "discountCode": "sample string 2",
      "taxYear": 1,
      "secondaryProductBundleId": 1,
      "agencyId": 1,
      "primaryAppealTypeId": 1,
      "secondaryAppealTypeId": 1,
      "quantity": 1,
      "isContingent": true
    },
    {
      "productBundleId": 1,
      "propertyAddressId": 1,
      "discountCode": "sample string 2",
      "taxYear": 1,
      "secondaryProductBundleId": 1,
      "agencyId": 1,
      "primaryAppealTypeId": 1,
      "secondaryAppealTypeId": 1,
      "quantity": 1,
      "isContingent": true
    }
  ],
  "userId": 1,
  "isContingent": true
}

text/html

Sample:
{"items":[{"productBundleId":1,"propertyAddressId":1,"discountCode":"sample string 2","taxYear":1,"secondaryProductBundleId":1,"agencyId":1,"primaryAppealTypeId":1,"secondaryAppealTypeId":1,"quantity":1,"isContingent":true},{"productBundleId":1,"propertyAddressId":1,"discountCode":"sample string 2","taxYear":1,"secondaryProductBundleId":1,"agencyId":1,"primaryAppealTypeId":1,"secondaryAppealTypeId":1,"quantity":1,"isContingent":true}],"userId":1,"isContingent":true}

application/xml, text/xml

Sample:
<CreateCartBindingModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Ptd.Model.WebModels.OrderProcessing">
  <IsContingent>true</IsContingent>
  <Items xmlns:d2p1="http://schemas.datacontract.org/2004/07/Ptd.Model.Entities.Payments">
    <d2p1:CartItemBindingModel>
      <d2p1:AgencyId>1</d2p1:AgencyId>
      <d2p1:DiscountCode>sample string 2</d2p1:DiscountCode>
      <d2p1:PrimaryAppealTypeId>1</d2p1:PrimaryAppealTypeId>
      <d2p1:ProductBundleId>1</d2p1:ProductBundleId>
      <d2p1:PropertyAddressId>1</d2p1:PropertyAddressId>
      <d2p1:Quantity>1</d2p1:Quantity>
      <d2p1:SecondaryAppealTypeId>1</d2p1:SecondaryAppealTypeId>
      <d2p1:SecondaryProductBundleId>1</d2p1:SecondaryProductBundleId>
      <d2p1:TaxYear>1</d2p1:TaxYear>
      <d2p1:isContingent>true</d2p1:isContingent>
    </d2p1:CartItemBindingModel>
    <d2p1:CartItemBindingModel>
      <d2p1:AgencyId>1</d2p1:AgencyId>
      <d2p1:DiscountCode>sample string 2</d2p1:DiscountCode>
      <d2p1:PrimaryAppealTypeId>1</d2p1:PrimaryAppealTypeId>
      <d2p1:ProductBundleId>1</d2p1:ProductBundleId>
      <d2p1:PropertyAddressId>1</d2p1:PropertyAddressId>
      <d2p1:Quantity>1</d2p1:Quantity>
      <d2p1:SecondaryAppealTypeId>1</d2p1:SecondaryAppealTypeId>
      <d2p1:SecondaryProductBundleId>1</d2p1:SecondaryProductBundleId>
      <d2p1:TaxYear>1</d2p1:TaxYear>
      <d2p1:isContingent>true</d2p1:isContingent>
    </d2p1:CartItemBindingModel>
  </Items>
  <UserId>1</UserId>
</CreateCartBindingModel>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'CreateCartBindingModel'.

Response Information

Resource Description

Instance of

CartModel
NameDescriptionTypeAdditional 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>