POST api/AddOrUpdateCommodity_V1

Add/Replace User/Client Commodity

Request Information

URI Parameters

None.

Body Parameters

The request is presented below!

WS_Repository.Models.Requests.Lists.AddCommodityRequest
NameDescriptionTypeAdditional information
WS_Key

(Mandatory) Client Or User Webservice Key provided by 2ship support - the type of the ws_key should be set by WSKeyLevel field

string

None.

WSKeyLevel

(Mandatory) Specify the WS_Key type ( User or Client)

WS_Repository.Models.Common.WSKeyLevelType

None.

Commodity

(Mandatory) Commodity to add or update

WS_Repository.Models.Requests.Lists.CommodityToAdd

None.

Request Formats

application/json, text/json

Sample:
{
  "WS_Key": "sample string 1",
  "WSKeyLevel": 0,
  "Commodity": {
    "ID": "sample string 1",
    "Description": "sample string 2",
    "MadeInCountryCode": "sample string 3",
    "QuantityUnitOfMeasure": "sample string 4",
    "UnitValue": 5.0,
    "ItemWeight": 6.0,
    "ItemLength": 7.0,
    "ItemWidth": 8.0,
    "ItemHeight": 9.0,
    "ItemMeasurementsType": 0,
    "HarmonizedCode": "sample string 10",
    "Canada_HarmonizedCode": "sample string 11",
    "USA_HarmonizedCode": "sample string 12",
    "PartNumber": "sample string 13",
    "MarksOrNumbers": "sample string 14",
    "SKUOrItemOrUPC": "sample string 15",
    "ExportLicense": "sample string 16",
    "LicenseExpireDate": "2022-07-06T01:02:40.3957272-04:00",
    "NAFTA": true,
    "NAFTACommodityDetails": {
      "PreferenceCriterion": 0,
      "ProducerDetermination": 0,
      "NaftaNetCost": 0,
      "NetCostBeginDate": "2022-07-06T01:02:40.3957272-04:00",
      "NetCostEndDate": "2022-07-06T01:02:40.3957272-04:00"
    },
    "FDA": true,
    "FCC": true,
    "SenderIsProducer": true,
    "Textile": true,
    "TextileInformation": "sample string 22",
    "FCCEntryNumber": "sample string 23",
    "FCCPortOfEntry": "sample string 24",
    "FCCDeviceModel": "sample string 25",
    "FCCTradeName": "sample string 26",
    "FCCID": "sample string 27",
    "FCCDescribeRadioFrequency": "sample string 28",
    "IsDutiable": true,
    "Manufacturer": {
      "Id": "sample string 1",
      "PersonName": "sample string 2",
      "CompanyName": "sample string 3",
      "Country": "sample string 4",
      "State": "sample string 5",
      "City": "sample string 6",
      "PostalCode": "sample string 7",
      "Address1": "sample string 8",
      "Address2": "sample string 9",
      "Telephone": "sample string 10",
      "Email": "sample string 11",
      "TaxID": "sample string 12"
    },
    "ItemsPerBox": 1.0,
    "AccessionNumber": "sample string 30",
    "DangerousGoods": true,
    "DangerousGoodsInfo": {
      "Accessible": true,
      "RegulationSet": 0,
      "RegulationLevelCode": 0,
      "UN": "sample string 1",
      "Class": "sample string 2",
      "PackingGroup": 0,
      "Authorization": "sample string 3",
      "AdditionalHandlingInformation": "sample string 4",
      "TechnicalName": "sample string 5",
      "AdditionalDescription": "sample string 6",
      "PackagingContainerType": "sample string 7",
      "PackagingType": "sample string 8",
      "SignatureName": "sample string 9",
      "SignaturePlace": "sample string 10",
      "SignatureDate": "sample string 11",
      "SignatureTitle": "sample string 12",
      "TransportType": 0,
      "DGPackingType": 0,
      "Radioactive": true,
      "EmergencyPhone": "sample string 13",
      "EmergencyContact": "sample string 14",
      "AllPackedInOne": true,
      "OverPacked": true,
      "QValue": "sample string 15",
      "ChemicalRecord": "sample string 16",
      "HazardLabelRequired": "sample string 17",
      "SubRiskClass": "sample string 18",
      "TunelRestriction": true,
      "AirportDeparture": "sample string 19",
      "AirportDestination": "sample string 20",
      "ProperShippingName": "sample string 21"
    },
    "LTLClassId": "sample string 32",
    "NMFCItem": "sample string 33",
    "NMFCSub": "sample string 34",
    "MID": "sample string 35",
    "ShipAsItsOwnPackage": true,
    "ShipInAnyPackage": true,
    "PlantArticle": true,
    "PlantArticleGenus": "sample string 39",
    "PlantArticleSpecies": "sample string 40",
    "PlantArticleQuantity": "sample string 41",
    "PlantArticlePercentRecycled": "sample string 42",
    "SerialNumber": "sample string 43",
    "ECCN": "sample string 44"
  }
}

application/xml, text/xml

Sample:
<AddCommodityRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WS_Repository.Models.Requests.Lists">
  <Commodity>
    <AccessionNumber>sample string 30</AccessionNumber>
    <Canada_HarmonizedCode>sample string 11</Canada_HarmonizedCode>
    <DangerousGoods>true</DangerousGoods>
    <DangerousGoodsInfo>
      <Accessible>true</Accessible>
      <AdditionalDescription>sample string 6</AdditionalDescription>
      <AdditionalHandlingInformation>sample string 4</AdditionalHandlingInformation>
      <AirportDeparture>sample string 19</AirportDeparture>
      <AirportDestination>sample string 20</AirportDestination>
      <AllPackedInOne>true</AllPackedInOne>
      <Authorization>sample string 3</Authorization>
      <ChemicalRecord>sample string 16</ChemicalRecord>
      <Class>sample string 2</Class>
      <DGPackingType>OTHER</DGPackingType>
      <EmergencyContact>sample string 14</EmergencyContact>
      <EmergencyPhone>sample string 13</EmergencyPhone>
      <HazardLabelRequired>sample string 17</HazardLabelRequired>
      <OverPacked>true</OverPacked>
      <PackagingContainerType>sample string 7</PackagingContainerType>
      <PackagingType>sample string 8</PackagingType>
      <PackingGroup>NONE</PackingGroup>
      <ProperShippingName>sample string 21</ProperShippingName>
      <QValue>sample string 15</QValue>
      <Radioactive>true</Radioactive>
      <RegulationLevelCode>FullyRegulated</RegulationLevelCode>
      <RegulationSet>CFR</RegulationSet>
      <SignatureDate>sample string 11</SignatureDate>
      <SignatureName>sample string 9</SignatureName>
      <SignaturePlace>sample string 10</SignaturePlace>
      <SignatureTitle>sample string 12</SignatureTitle>
      <SubRiskClass>sample string 18</SubRiskClass>
      <TechnicalName>sample string 5</TechnicalName>
      <TransportType>PassengerAndCargoAircraft</TransportType>
      <TunelRestriction>true</TunelRestriction>
      <UN>sample string 1</UN>
    </DangerousGoodsInfo>
    <Description>sample string 2</Description>
    <ECCN>sample string 44</ECCN>
    <ExportLicense>sample string 16</ExportLicense>
    <FCC>true</FCC>
    <FCCDescribeRadioFrequency>sample string 28</FCCDescribeRadioFrequency>
    <FCCDeviceModel>sample string 25</FCCDeviceModel>
    <FCCEntryNumber>sample string 23</FCCEntryNumber>
    <FCCID>sample string 27</FCCID>
    <FCCPortOfEntry>sample string 24</FCCPortOfEntry>
    <FCCTradeName>sample string 26</FCCTradeName>
    <FDA>true</FDA>
    <HarmonizedCode>sample string 10</HarmonizedCode>
    <ID>sample string 1</ID>
    <IsDutiable>true</IsDutiable>
    <ItemHeight>9</ItemHeight>
    <ItemLength>7</ItemLength>
    <ItemMeasurementsType>Imperial</ItemMeasurementsType>
    <ItemWeight>6</ItemWeight>
    <ItemWidth>8</ItemWidth>
    <ItemsPerBox>1</ItemsPerBox>
    <LTLClassId>sample string 32</LTLClassId>
    <LicenseExpireDate>2022-07-06T01:02:40.3957272-04:00</LicenseExpireDate>
    <MID>sample string 35</MID>
    <MadeInCountryCode>sample string 3</MadeInCountryCode>
    <Manufacturer>
      <Address1>sample string 8</Address1>
      <Address2>sample string 9</Address2>
      <City>sample string 6</City>
      <CompanyName>sample string 3</CompanyName>
      <Country>sample string 4</Country>
      <Email>sample string 11</Email>
      <Id>sample string 1</Id>
      <PersonName>sample string 2</PersonName>
      <PostalCode>sample string 7</PostalCode>
      <State>sample string 5</State>
      <TaxID>sample string 12</TaxID>
      <Telephone>sample string 10</Telephone>
    </Manufacturer>
    <MarksOrNumbers>sample string 14</MarksOrNumbers>
    <NAFTA>true</NAFTA>
    <NAFTACommodityDetails>
      <NaftaNetCost>NC</NaftaNetCost>
      <NetCostBeginDate>2022-07-06T01:02:40.3957272-04:00</NetCostBeginDate>
      <NetCostEndDate>2022-07-06T01:02:40.3957272-04:00</NetCostEndDate>
      <PreferenceCriterion>A</PreferenceCriterion>
      <ProducerDetermination>YES</ProducerDetermination>
    </NAFTACommodityDetails>
    <NMFCItem>sample string 33</NMFCItem>
    <NMFCSub>sample string 34</NMFCSub>
    <PartNumber>sample string 13</PartNumber>
    <PlantArticle>true</PlantArticle>
    <PlantArticleGenus>sample string 39</PlantArticleGenus>
    <PlantArticlePercentRecycled>sample string 42</PlantArticlePercentRecycled>
    <PlantArticleQuantity>sample string 41</PlantArticleQuantity>
    <PlantArticleSpecies>sample string 40</PlantArticleSpecies>
    <QuantityUnitOfMeasure>sample string 4</QuantityUnitOfMeasure>
    <SKUOrItemOrUPC>sample string 15</SKUOrItemOrUPC>
    <SenderIsProducer>true</SenderIsProducer>
    <SerialNumber>sample string 43</SerialNumber>
    <ShipAsItsOwnPackage>true</ShipAsItsOwnPackage>
    <ShipInAnyPackage>true</ShipInAnyPackage>
    <Textile>true</Textile>
    <TextileInformation>sample string 22</TextileInformation>
    <USA_HarmonizedCode>sample string 12</USA_HarmonizedCode>
    <UnitValue>5</UnitValue>
  </Commodity>
  <WSKeyLevel>User</WSKeyLevel>
  <WS_Key>sample string 1</WS_Key>
</AddCommodityRequest>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'System.Web.Http.ModelBinding.JQueryMvcFormUrlEncodedFormatter' to write type 'WS_Repository.Models.Requests.Lists.AddCommodityRequest'.

Response Information

Resource Description

WS_Repository.Models.Responses.Lists.AddCommodityResponse
NameDescriptionTypeAdditional information
Success

Specify if the import was successfully done

boolean

None.

ErrorMessage

The error message if the import get an error

string

None.

Response Formats

application/json, text/json

Sample:
{
  "Success": true,
  "ErrorMessage": "sample string 2"
}

application/xml, text/xml

Sample:
<AddCommodityResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WS_Repository.Models.Responses.Lists">
  <ErrorMessage>sample string 2</ErrorMessage>
  <Success>true</Success>
</AddCommodityResponse>