POST SalesContract/PostSalesContract

Creates a Sales Contract

Request Information

URI Parameters

Body Parameters

ClsSalesConAdd
NameDescriptionTypeAdditional Information
ContractID

ID of the sales contract

string

Required

Max length: 15

LocationID

ID of the delivery location of the sales contract

string

Required

Max length: 6

CustomerID

ID of the customer on the sales contract

string

Required

Max length: 6

BuyersReference

Represents the contract number of the terminal/processor. If blank, the grain elevator is using the ContractNumber to represent the contract number of the terminal/processor.

string

Max length: 15

CommodityID

ID of the commodity on the sales contract

string

Required

Max length: 6

DateEstablished

Date the contract was established

string

Required

Format must be MM/dd/yyyy

ContractType

Type of contract

SalesContractType

Required

ContractStatus

Current status of contract

SalesContractStatus

Required

CashPrice

FOB price for the established conract

decimal number

Max of 4 decimal places

ContractQuantity

Quantity of the sales contract

decimal number

Required

Cannot be negative

Max of 4 decimal places

DelPrice

Price the terminal/processor will pay the grain elevator for the grain when delivered

decimal number

Max of 4 decimal places

BasisPrice

Basis price of the sales contract

decimal number

Max of 4 decimal places

FuturesMonthID

Futures month of the sales contract

string

Max length: 10

ShippingDestinationID

ID of the shipping destination on the contract

string

Max length: 6

ExpireDate

Expiration date of the contract

string

Format must be MM/dd/yyyy

FuturesPrice

Futures price established for the contract

decimal number

Max of 4 decimal places

ExchangeID

ID of the exchange used to establish the price

string

Max length: 10

PricingNotes

Pricing notes on a contract

string

Max length: 50

BidCriteriaID

ID for the terms of the bid

string

Max length: 20

TransportationMethodGuid

Method of transportation for the sales contract

globally unique identifier
DocumentFormatGuid

Format Guid of a Sales Contract

globally unique identifier
SalesContractDeliveryDates

List of delivery dates for the sales contract

Collection of ClsGrSalesConDdAdd
SalesContractGradeFactorsAndSchedules

List of grade factors and schedules for the sales contract

Collection of ClsGrSalesConGfAdd
SalesContractComments

List of comments for the Sales contract

Collection of ClsGrSalesConCommAdd
GrSalesConPurConAdd

List of sales contracts linked to purchase contracts

Collection of ClsGrSalesConPurConAdd

Request Formats

application/json, text/json

Sample:
{
  "ContractID": "sample string 1",
  "LocationID": "sample string 2",
  "CustomerID": "sample string 3",
  "BuyersReference": "sample string 4",
  "CommodityID": "sample string 5",
  "DateEstablished": "sample string 6",
  "ContractType": 1,
  "ContractStatus": 1,
  "CashPrice": 7.1,
  "ContractQuantity": 8.1,
  "DelPrice": 9.1,
  "BasisPrice": 10.1,
  "FuturesMonthID": "sample string 11",
  "ShippingDestinationID": "sample string 12",
  "ExpireDate": "sample string 13",
  "FuturesPrice": 14.1,
  "ExchangeID": "sample string 15",
  "PricingNotes": "sample string 17",
  "BidCriteriaID": "sample string 18",
  "TransportationMethodGuid": "c6ddca3a-a770-4312-bbc8-d05d3057d72d",
  "DocumentFormatGuid": "a03121fc-07f9-43ff-889d-4265b9eec195",
  "SalesContractDeliveryDates": [
    {
      "StartDate": "sample string 1",
      "Quantity": 2.1,
      "CompleteDate": "sample string 3"
    },
    {
      "StartDate": "sample string 1",
      "Quantity": 2.1,
      "CompleteDate": "sample string 3"
    }
  ],
  "SalesContractGradeFactorsAndSchedules": [
    {
      "PremiumDiscountGuid": "90b99264-4045-4b66-9054-05cc78e09a53",
      "GradFactorId": "sample string 1",
      "ScheduleId": "sample string 2"
    },
    {
      "PremiumDiscountGuid": "90b99264-4045-4b66-9054-05cc78e09a53",
      "GradFactorId": "sample string 1",
      "ScheduleId": "sample string 2"
    }
  ],
  "SalesContractComments": [
    {
      "CommmentDate": "sample string 1",
      "Comment": "sample string 2"
    },
    {
      "CommmentDate": "sample string 1",
      "Comment": "sample string 2"
    }
  ],
  "GrSalesConPurConAdd": [
    {
      "PurchaseConNumber": "sample string 1",
      "PurchaseConLocation": "sample string 2",
      "PurchaseConGuid": "d5183106-c9e0-4870-b6a8-39fbb70e3049",
      "LinkedUnits": 3.1
    },
    {
      "PurchaseConNumber": "sample string 1",
      "PurchaseConLocation": "sample string 2",
      "PurchaseConGuid": "d5183106-c9e0-4870-b6a8-39fbb70e3049",
      "LinkedUnits": 3.1
    }
  ]
}

application/xml, text/xml

Sample:
<ClsGrSalesCon.ClsSalesConAdd xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SKY.Core.Grain">
  <BasisPrice>10.1</BasisPrice>
  <BidCriteriaID>sample string 18</BidCriteriaID>
  <BuyersReference>sample string 4</BuyersReference>
  <CashPrice>7.1</CashPrice>
  <CommodityID>sample string 5</CommodityID>
  <ContractID>sample string 1</ContractID>
  <ContractQuantity>8.1</ContractQuantity>
  <ContractStatus>Open</ContractStatus>
  <ContractType>Priced</ContractType>
  <CustomerID>sample string 3</CustomerID>
  <DateEstablished>sample string 6</DateEstablished>
  <DelPrice>9.1</DelPrice>
  <DocumentFormatGuid>a03121fc-07f9-43ff-889d-4265b9eec195</DocumentFormatGuid>
  <ExchangeID>sample string 15</ExchangeID>
  <ExpireDate>sample string 13</ExpireDate>
  <FuturesMonthID>sample string 11</FuturesMonthID>
  <FuturesPrice>14.1</FuturesPrice>
  <GrSalesConPurConAdd>
    <ClsGrSalesCon.ClsSalesConAdd.ClsGrSalesConPurConAdd>
      <LinkedUnits>3.1</LinkedUnits>
      <PurchaseConGuid>d5183106-c9e0-4870-b6a8-39fbb70e3049</PurchaseConGuid>
      <PurchaseConLocation>sample string 2</PurchaseConLocation>
      <PurchaseConNumber>sample string 1</PurchaseConNumber>
    </ClsGrSalesCon.ClsSalesConAdd.ClsGrSalesConPurConAdd>
    <ClsGrSalesCon.ClsSalesConAdd.ClsGrSalesConPurConAdd>
      <LinkedUnits>3.1</LinkedUnits>
      <PurchaseConGuid>d5183106-c9e0-4870-b6a8-39fbb70e3049</PurchaseConGuid>
      <PurchaseConLocation>sample string 2</PurchaseConLocation>
      <PurchaseConNumber>sample string 1</PurchaseConNumber>
    </ClsGrSalesCon.ClsSalesConAdd.ClsGrSalesConPurConAdd>
  </GrSalesConPurConAdd>
  <LocationID>sample string 2</LocationID>
  <PricingNotes>sample string 17</PricingNotes>
  <SalesContractComments>
    <ClsGrSalesCon.ClsSalesConAdd.ClsGrSalesConCommAdd>
      <Comment>sample string 2</Comment>
      <CommmentDate>sample string 1</CommmentDate>
    </ClsGrSalesCon.ClsSalesConAdd.ClsGrSalesConCommAdd>
    <ClsGrSalesCon.ClsSalesConAdd.ClsGrSalesConCommAdd>
      <Comment>sample string 2</Comment>
      <CommmentDate>sample string 1</CommmentDate>
    </ClsGrSalesCon.ClsSalesConAdd.ClsGrSalesConCommAdd>
  </SalesContractComments>
  <SalesContractDeliveryDates>
    <ClsGrSalesCon.ClsSalesConAdd.ClsGrSalesConDdAdd>
      <CompleteDate>sample string 3</CompleteDate>
      <Quantity>2.1</Quantity>
      <StartDate>sample string 1</StartDate>
    </ClsGrSalesCon.ClsSalesConAdd.ClsGrSalesConDdAdd>
    <ClsGrSalesCon.ClsSalesConAdd.ClsGrSalesConDdAdd>
      <CompleteDate>sample string 3</CompleteDate>
      <Quantity>2.1</Quantity>
      <StartDate>sample string 1</StartDate>
    </ClsGrSalesCon.ClsSalesConAdd.ClsGrSalesConDdAdd>
  </SalesContractDeliveryDates>
  <SalesContractGradeFactorsAndSchedules>
    <ClsGrSalesCon.ClsSalesConAdd.ClsGrSalesConGfAdd>
      <GradFactorId>sample string 1</GradFactorId>
      <PremiumDiscountGuid>90b99264-4045-4b66-9054-05cc78e09a53</PremiumDiscountGuid>
      <ScheduleId>sample string 2</ScheduleId>
    </ClsGrSalesCon.ClsSalesConAdd.ClsGrSalesConGfAdd>
    <ClsGrSalesCon.ClsSalesConAdd.ClsGrSalesConGfAdd>
      <GradFactorId>sample string 1</GradFactorId>
      <PremiumDiscountGuid>90b99264-4045-4b66-9054-05cc78e09a53</PremiumDiscountGuid>
      <ScheduleId>sample string 2</ScheduleId>
    </ClsGrSalesCon.ClsSalesConAdd.ClsGrSalesConGfAdd>
  </SalesContractGradeFactorsAndSchedules>
  <ShippingDestinationID>sample string 12</ShippingDestinationID>
  <TransportationMethodGuid>c6ddca3a-a770-4312-bbc8-d05d3057d72d</TransportationMethodGuid>
</ClsGrSalesCon.ClsSalesConAdd>

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 'ClsSalesConAdd'.

Response Information

Resource Description

Creates a Sales Contract

AgvSalesContract
NameDescriptionTypeAdditional Information
Status

Status of the API call.

string
Message

Message of the API call.

string
Count

Count of how many Sales Contracts.

string
ErrorList

List of error messages of the API call.

Collection of string
WarningList

List of warning messages of the API call.

Collection of string
SalesContracts

Collection of clsGRSalesCon

Response Formats

application/json, text/json

Sample:
{
  "Status": "sample string 1",
  "Message": "sample string 2",
  "Count": "2",
  "ErrorList": [
    "sample string 1",
    "sample string 2"
  ],
  "WarningList": [
    "sample string 1",
    "sample string 2"
  ],
  "SalesContracts": [
    {
      "CustomerID": "sample string 22",
      "BuyersReference": "sample string 23",
      "ContractNumber": "sample string 24",
      "Location": "sample string 25",
      "Commodity": "sample string 26",
      "DeliveredPrice": 27.1,
      "ShippingDestination": "sample string 28",
      "DateEstablished": "sample string 29",
      "ContractType": "sample string 31",
      "ContractStatus": "sample string 32",
      "CashPrice": 33.1,
      "BasisPrice": 37.1,
      "FuturesMonth": "sample string 38",
      "FuturesPrice": 39.1,
      "BidCriteria": "sample string 43",
      "OriginalQuantity": 44.1,
      "SalesContractGUID": "d167037d-205e-4793-925f-ecf72f493b6e",
      "QuantityRemaining": 45.1,
      "DeliveryDates": [
        {
          "StartDeliveryDate": "sample string 5",
          "Quantity": 6.1,
          "CompleteDeliveryDate": "sample string 7"
        },
        {
          "StartDeliveryDate": "sample string 5",
          "Quantity": 6.1,
          "CompleteDeliveryDate": "sample string 7"
        }
      ]
    },
    {
      "CustomerID": "sample string 22",
      "BuyersReference": "sample string 23",
      "ContractNumber": "sample string 24",
      "Location": "sample string 25",
      "Commodity": "sample string 26",
      "DeliveredPrice": 27.1,
      "ShippingDestination": "sample string 28",
      "DateEstablished": "sample string 29",
      "ContractType": "sample string 31",
      "ContractStatus": "sample string 32",
      "CashPrice": 33.1,
      "BasisPrice": 37.1,
      "FuturesMonth": "sample string 38",
      "FuturesPrice": 39.1,
      "BidCriteria": "sample string 43",
      "OriginalQuantity": 44.1,
      "SalesContractGUID": "d167037d-205e-4793-925f-ecf72f493b6e",
      "QuantityRemaining": 45.1,
      "DeliveryDates": [
        {
          "StartDeliveryDate": "sample string 5",
          "Quantity": 6.1,
          "CompleteDeliveryDate": "sample string 7"
        },
        {
          "StartDeliveryDate": "sample string 5",
          "Quantity": 6.1,
          "CompleteDeliveryDate": "sample string 7"
        }
      ]
    }
  ]
}

application/xml, text/xml

Sample:
<AgvSalesContract xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AgvWebAPICSharp.Models.Sales_Contract">
  <ErrorList xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </ErrorList>
  <Message>sample string 2</Message>
  <SalesContracts xmlns:d2p1="http://schemas.datacontract.org/2004/07/SSI">
    <d2p1:clsGRSalesCon>
      <d2p1:BasisPrice>37.1</d2p1:BasisPrice>
      <d2p1:BidCriteria>sample string 43</d2p1:BidCriteria>
      <d2p1:BuyersReference>sample string 23</d2p1:BuyersReference>
      <d2p1:CashPrice>33.1</d2p1:CashPrice>
      <d2p1:Commodity>sample string 26</d2p1:Commodity>
      <d2p1:ContractNumber>sample string 24</d2p1:ContractNumber>
      <d2p1:ContractStatus>sample string 32</d2p1:ContractStatus>
      <d2p1:ContractType>sample string 31</d2p1:ContractType>
      <d2p1:CustomerID>sample string 22</d2p1:CustomerID>
      <d2p1:DateEstablished>sample string 29</d2p1:DateEstablished>
      <d2p1:DeliveredPrice>27.1</d2p1:DeliveredPrice>
      <d2p1:DeliveryDates>
        <d2p1:clsGRSalesConDD>
          <d2p1:CompleteDeliveryDate>sample string 7</d2p1:CompleteDeliveryDate>
          <d2p1:Quantity>6.1</d2p1:Quantity>
          <d2p1:StartDeliveryDate>sample string 5</d2p1:StartDeliveryDate>
        </d2p1:clsGRSalesConDD>
        <d2p1:clsGRSalesConDD>
          <d2p1:CompleteDeliveryDate>sample string 7</d2p1:CompleteDeliveryDate>
          <d2p1:Quantity>6.1</d2p1:Quantity>
          <d2p1:StartDeliveryDate>sample string 5</d2p1:StartDeliveryDate>
        </d2p1:clsGRSalesConDD>
      </d2p1:DeliveryDates>
      <d2p1:FuturesMonth>sample string 38</d2p1:FuturesMonth>
      <d2p1:FuturesPrice>39.1</d2p1:FuturesPrice>
      <d2p1:Location>sample string 25</d2p1:Location>
      <d2p1:OriginalQuantity>44.1</d2p1:OriginalQuantity>
      <d2p1:QuantityRemaining>45.1</d2p1:QuantityRemaining>
      <d2p1:SalesContractGUID>d167037d-205e-4793-925f-ecf72f493b6e</d2p1:SalesContractGUID>
      <d2p1:ShippingDestination>sample string 28</d2p1:ShippingDestination>
    </d2p1:clsGRSalesCon>
    <d2p1:clsGRSalesCon>
      <d2p1:BasisPrice>37.1</d2p1:BasisPrice>
      <d2p1:BidCriteria>sample string 43</d2p1:BidCriteria>
      <d2p1:BuyersReference>sample string 23</d2p1:BuyersReference>
      <d2p1:CashPrice>33.1</d2p1:CashPrice>
      <d2p1:Commodity>sample string 26</d2p1:Commodity>
      <d2p1:ContractNumber>sample string 24</d2p1:ContractNumber>
      <d2p1:ContractStatus>sample string 32</d2p1:ContractStatus>
      <d2p1:ContractType>sample string 31</d2p1:ContractType>
      <d2p1:CustomerID>sample string 22</d2p1:CustomerID>
      <d2p1:DateEstablished>sample string 29</d2p1:DateEstablished>
      <d2p1:DeliveredPrice>27.1</d2p1:DeliveredPrice>
      <d2p1:DeliveryDates>
        <d2p1:clsGRSalesConDD>
          <d2p1:CompleteDeliveryDate>sample string 7</d2p1:CompleteDeliveryDate>
          <d2p1:Quantity>6.1</d2p1:Quantity>
          <d2p1:StartDeliveryDate>sample string 5</d2p1:StartDeliveryDate>
        </d2p1:clsGRSalesConDD>
        <d2p1:clsGRSalesConDD>
          <d2p1:CompleteDeliveryDate>sample string 7</d2p1:CompleteDeliveryDate>
          <d2p1:Quantity>6.1</d2p1:Quantity>
          <d2p1:StartDeliveryDate>sample string 5</d2p1:StartDeliveryDate>
        </d2p1:clsGRSalesConDD>
      </d2p1:DeliveryDates>
      <d2p1:FuturesMonth>sample string 38</d2p1:FuturesMonth>
      <d2p1:FuturesPrice>39.1</d2p1:FuturesPrice>
      <d2p1:Location>sample string 25</d2p1:Location>
      <d2p1:OriginalQuantity>44.1</d2p1:OriginalQuantity>
      <d2p1:QuantityRemaining>45.1</d2p1:QuantityRemaining>
      <d2p1:SalesContractGUID>d167037d-205e-4793-925f-ecf72f493b6e</d2p1:SalesContractGUID>
      <d2p1:ShippingDestination>sample string 28</d2p1:ShippingDestination>
    </d2p1:clsGRSalesCon>
  </SalesContracts>
  <Status>sample string 1</Status>
  <WarningList xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </WarningList>
</AgvSalesContract>