POST PurchaseContract/PostPurchaseContract
Create a purchase contract
Request Information
URI Parameters
Body Parameters
ClsGrPurConAdd| Name | Description | Type | Additional Information |
|---|---|---|---|
| ContractID |
ID of the purchase contract |
string |
Max length: 15 |
| LocationID |
ID of the delivery location for the contract |
string |
Required Max length: 6 |
| CustomerID |
ID of the customer on the contract |
string |
Required Max length: 6 |
| CommodityID |
ID of the commodity on the contract |
string |
Required Max length: 6 |
| DateEstablished |
Date the contract was established |
string |
Required Format must be MM/dd/yyyy |
| ContractType |
Type of contract |
PurchaseContractType |
Required |
| ContractStatus |
Current status of the contract |
PurchaseContractStatus |
Required |
| CashPrice |
Cash price established for the contract |
decimal number |
Max of 5 decimal places |
| ContractQuantity |
Contracted quantity of the commodity |
decimal number |
Required Cannot be negative |
| BasisPrice |
Difference between the futures price and cash price |
decimal number |
Max of 5 decimal places |
| FuturesMonthID |
ID of the futures month used for the futures price |
string |
Max length: 10 |
| ExchangeID |
ID of the exchange used to establish the price |
string |
Max length: 10 |
| StrikePrice |
Price at which a futures contract can be bought or sold |
decimal number |
Max of 5 decimal places |
| ExpireDate |
Expiration date of the contract |
string |
Format must be MM/dd/yyyy |
| FuturesPrice |
Futures price established for the contract |
decimal number |
Max of 5 decimal places |
| ContractSigned |
Indicates whether or not the contract has been signed |
boolean | |
| BidCriteriaID |
ID for the terms of the bid |
string |
Max length: 20 |
| ShippingDestinationID |
ID of the shipping destination to apply to the contract |
string |
Max length: 6 |
| SalespersonID |
ID of the salesperson associated with the contract |
string |
Max length: 15 |
| PricingNotes |
Note related to pricing for the contract |
string |
Max length: 50 |
| PriceByDate |
Date by which the contract should be priced or rolled |
string |
Format must be MM/dd/yyyy |
| FreightOnBoard |
Indicates whether or not the contract includes freight in the established price |
boolean | |
| ExternalContractID |
Reference ID from another source to be stored with the contract |
string |
Max length: 50 |
| ContractFormat |
The format used to create the physical contract to sign. NOTE: This is required when the database column exists and no defaults are set in Agvance. |
string |
Max length: 50 |
| DirectShipped |
Flag that indicates if the purchase contract is to be treated as direct shipped |
boolean | |
| AgvanceUserIdToAssignBuyerSignatureFrom |
The Agvance user id to use to assign the buyer signature |
string | |
| BuyerSignatureDateSignedToPrint |
The date the buyer's signature was applied to the contract (Only used with a valid AgvanceUserIdToAssignBuyerSignatureFrom set) |
date | |
| BuyerSignatureDateTimeSignedUtc |
The date and time the buyer's signature was captured in UTC (Only used with a valid AgvanceUserIdToAssignBuyerSignatureFrom set) |
date | |
| SpotContract |
Setting to determine if the purchase contract is a "Spot" type, Priced contract |
boolean | |
| FarmId |
Farm ID for the contract - free text field |
string |
Max length: 8 |
| MOTGuid |
The Method of Transportation Guid |
globally unique identifier | |
| SellerSignatureDateSignedToPrint |
The date the seller signed the contract. Only valid when ContractSiigned is true. Only the date portion is used. |
date | |
| PurchaseContractComments |
List of comments associated with the contract |
Collection of ClsGrPurConCommAdd | |
| PurchaseContractDeliveryDates |
List of delivery dates for the contract |
Collection of ClsGrPurConDdAdd | |
| PurchaseContractSchedules |
List of Premium Discount schedules attached to the contract |
Collection of ClsGrPurConGfAdd | |
| PurchaseContractMinimumPriceInfo |
List of minimum price roll records |
Collection of ClsGrPurConRollAdd |
Request Formats
application/json, text/json
{
"ContractID": "sample string 1",
"LocationID": "sample string 2",
"CustomerID": "sample string 3",
"CommodityID": "sample string 4",
"DateEstablished": "sample string 5",
"ContractType": 1,
"ContractStatus": 1,
"CashPrice": 6.1,
"ContractQuantity": 7.1,
"BasisPrice": 8.1,
"FuturesMonthID": "sample string 9",
"ExchangeID": "sample string 10",
"StrikePrice": 11.1,
"ExpireDate": "sample string 12",
"FuturesPrice": 13.1,
"ContractSigned": true,
"BidCriteriaID": "sample string 15",
"ShippingDestinationID": "sample string 16",
"SalespersonID": "sample string 17",
"PricingNotes": "sample string 18",
"PriceByDate": "sample string 19",
"FreightOnBoard": true,
"ExternalContractID": "sample string 21",
"ContractFormat": "sample string 22",
"DirectShipped": true,
"AgvanceUserIdToAssignBuyerSignatureFrom": "sample string 24",
"BuyerSignatureDateSignedToPrint": "2025-11-04T21:17:04.5548205+00:00",
"BuyerSignatureDateTimeSignedUtc": "2025-11-04T21:17:04.5548205+00:00",
"SpotContract": true,
"FarmId": "sample string 26",
"MOTGuid": "8ef4d406-4301-40dc-bd37-ff521617aa85",
"SellerSignatureDateSignedToPrint": "2025-11-04T21:17:04.5548205+00:00",
"PurchaseContractComments": [
{
"Comment": "sample string 1"
},
{
"Comment": "sample string 1"
}
],
"PurchaseContractDeliveryDates": [
{
"StartDate": "sample string 1",
"CompleteDate": "sample string 2",
"Quantity": 3.1
},
{
"StartDate": "sample string 1",
"CompleteDate": "sample string 2",
"Quantity": 3.1
}
],
"PurchaseContractSchedules": [
{
"PremiumDiscountGuid": "6c810502-0b2c-4c3d-9f47-3a8997c29464",
"GradFactorId": "sample string 1",
"ScheduleId": "sample string 2"
},
{
"PremiumDiscountGuid": "6c810502-0b2c-4c3d-9f47-3a8997c29464",
"GradFactorId": "sample string 1",
"ScheduleId": "sample string 2"
}
],
"PurchaseContractMinimumPriceInfo": [
{
"FuturesPrice": 1.1,
"BasisPrice": 2.1,
"BuyOptionPrice": 3.1,
"BuyOptionMonth": "sample string 4",
"BuyOptionPorC": "sample string 5",
"BuyOptionStrike": 6.1,
"SellOptionPrice": 7.1,
"SellOptionMonth": "sample string 8",
"SellOptionPorC": "sample string 9",
"SellOptionStrike": 10.1,
"Storage": 11.1,
"ServiceCharge": 12.1,
"MinimumPrice": 13.1,
"ExpirationDate": "2025-11-04T21:17:04.5560489+00:00",
"Comments": "sample string 14"
},
{
"FuturesPrice": 1.1,
"BasisPrice": 2.1,
"BuyOptionPrice": 3.1,
"BuyOptionMonth": "sample string 4",
"BuyOptionPorC": "sample string 5",
"BuyOptionStrike": 6.1,
"SellOptionPrice": 7.1,
"SellOptionMonth": "sample string 8",
"SellOptionPorC": "sample string 9",
"SellOptionStrike": 10.1,
"Storage": 11.1,
"ServiceCharge": 12.1,
"MinimumPrice": 13.1,
"ExpirationDate": "2025-11-04T21:17:04.5560489+00:00",
"Comments": "sample string 14"
}
]
}
application/xml, text/xml
<ClsGrPurCon.ClsGrPurConAdd xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SKY.Core.Grain">
<AgvanceUserIdToAssignBuyerSignatureFrom>sample string 24</AgvanceUserIdToAssignBuyerSignatureFrom>
<BasisPrice>8.1</BasisPrice>
<BidCriteriaID>sample string 15</BidCriteriaID>
<BuyerSignatureDateSignedToPrint>2025-11-04T21:17:04.5548205+00:00</BuyerSignatureDateSignedToPrint>
<BuyerSignatureDateTimeSignedUtc>2025-11-04T21:17:04.5548205+00:00</BuyerSignatureDateTimeSignedUtc>
<CashPrice>6.1</CashPrice>
<CommodityID>sample string 4</CommodityID>
<ContractFormat>sample string 22</ContractFormat>
<ContractID>sample string 1</ContractID>
<ContractQuantity>7.1</ContractQuantity>
<ContractSigned>true</ContractSigned>
<ContractStatus>Open</ContractStatus>
<ContractType>Priced</ContractType>
<CustomerID>sample string 3</CustomerID>
<DateEstablished>sample string 5</DateEstablished>
<DirectShipped>true</DirectShipped>
<ExchangeID>sample string 10</ExchangeID>
<ExpireDate>sample string 12</ExpireDate>
<ExternalContractID>sample string 21</ExternalContractID>
<FarmId>sample string 26</FarmId>
<FreightOnBoard>true</FreightOnBoard>
<FuturesMonthID>sample string 9</FuturesMonthID>
<FuturesPrice>13.1</FuturesPrice>
<LocationID>sample string 2</LocationID>
<MOTGuid>8ef4d406-4301-40dc-bd37-ff521617aa85</MOTGuid>
<PriceByDate>sample string 19</PriceByDate>
<PricingNotes>sample string 18</PricingNotes>
<PurchaseContractComments>
<ClsGrPurCon.ClsGrPurConAdd.ClsGrPurConCommAdd>
<Comment>sample string 1</Comment>
</ClsGrPurCon.ClsGrPurConAdd.ClsGrPurConCommAdd>
<ClsGrPurCon.ClsGrPurConAdd.ClsGrPurConCommAdd>
<Comment>sample string 1</Comment>
</ClsGrPurCon.ClsGrPurConAdd.ClsGrPurConCommAdd>
</PurchaseContractComments>
<PurchaseContractDeliveryDates>
<ClsGrPurCon.ClsGrPurConAdd.ClsGrPurConDdAdd>
<CompleteDate>sample string 2</CompleteDate>
<Quantity>3.1</Quantity>
<StartDate>sample string 1</StartDate>
</ClsGrPurCon.ClsGrPurConAdd.ClsGrPurConDdAdd>
<ClsGrPurCon.ClsGrPurConAdd.ClsGrPurConDdAdd>
<CompleteDate>sample string 2</CompleteDate>
<Quantity>3.1</Quantity>
<StartDate>sample string 1</StartDate>
</ClsGrPurCon.ClsGrPurConAdd.ClsGrPurConDdAdd>
</PurchaseContractDeliveryDates>
<PurchaseContractMinimumPriceInfo>
<ClsGrPurCon.ClsGrPurConAdd.ClsGrPurConRollAdd>
<BasisPrice>2.1</BasisPrice>
<BuyOptionMonth>sample string 4</BuyOptionMonth>
<BuyOptionPorC>sample string 5</BuyOptionPorC>
<BuyOptionPrice>3.1</BuyOptionPrice>
<BuyOptionStrike>6.1</BuyOptionStrike>
<Comments>sample string 14</Comments>
<ExpirationDate>2025-11-04T21:17:04.5560489+00:00</ExpirationDate>
<FuturesPrice>1.1</FuturesPrice>
<MinimumPrice>13.1</MinimumPrice>
<SellOptionMonth>sample string 8</SellOptionMonth>
<SellOptionPorC>sample string 9</SellOptionPorC>
<SellOptionPrice>7.1</SellOptionPrice>
<SellOptionStrike>10.1</SellOptionStrike>
<ServiceCharge>12.1</ServiceCharge>
<Storage>11.1</Storage>
</ClsGrPurCon.ClsGrPurConAdd.ClsGrPurConRollAdd>
<ClsGrPurCon.ClsGrPurConAdd.ClsGrPurConRollAdd>
<BasisPrice>2.1</BasisPrice>
<BuyOptionMonth>sample string 4</BuyOptionMonth>
<BuyOptionPorC>sample string 5</BuyOptionPorC>
<BuyOptionPrice>3.1</BuyOptionPrice>
<BuyOptionStrike>6.1</BuyOptionStrike>
<Comments>sample string 14</Comments>
<ExpirationDate>2025-11-04T21:17:04.5560489+00:00</ExpirationDate>
<FuturesPrice>1.1</FuturesPrice>
<MinimumPrice>13.1</MinimumPrice>
<SellOptionMonth>sample string 8</SellOptionMonth>
<SellOptionPorC>sample string 9</SellOptionPorC>
<SellOptionPrice>7.1</SellOptionPrice>
<SellOptionStrike>10.1</SellOptionStrike>
<ServiceCharge>12.1</ServiceCharge>
<Storage>11.1</Storage>
</ClsGrPurCon.ClsGrPurConAdd.ClsGrPurConRollAdd>
</PurchaseContractMinimumPriceInfo>
<PurchaseContractSchedules>
<ClsGrPurCon.ClsGrPurConAdd.ClsGrPurConGfAdd>
<GradFactorId>sample string 1</GradFactorId>
<PremiumDiscountGuid>6c810502-0b2c-4c3d-9f47-3a8997c29464</PremiumDiscountGuid>
<ScheduleId>sample string 2</ScheduleId>
</ClsGrPurCon.ClsGrPurConAdd.ClsGrPurConGfAdd>
<ClsGrPurCon.ClsGrPurConAdd.ClsGrPurConGfAdd>
<GradFactorId>sample string 1</GradFactorId>
<PremiumDiscountGuid>6c810502-0b2c-4c3d-9f47-3a8997c29464</PremiumDiscountGuid>
<ScheduleId>sample string 2</ScheduleId>
</ClsGrPurCon.ClsGrPurConAdd.ClsGrPurConGfAdd>
</PurchaseContractSchedules>
<SalespersonID>sample string 17</SalespersonID>
<SellerSignatureDateSignedToPrint>2025-11-04T21:17:04.5548205+00:00</SellerSignatureDateSignedToPrint>
<ShippingDestinationID>sample string 16</ShippingDestinationID>
<SpotContract>true</SpotContract>
<StrikePrice>11.1</StrikePrice>
</ClsGrPurCon.ClsGrPurConAdd>
application/x-www-form-urlencoded
Response Information
Resource Description
Create a purchase contract
AgvPurchaseContractDetails| Name | Description | Type | Additional Information |
|---|---|---|---|
| Status |
0 - Success; 1 - An error occurred; 2 - An error occurred; 3 - Descriptive message, process was successful |
string | |
| Message |
Informational message that corresponds to the Status returned; 0 - Message will be "OK"; 1 - Detailed message returned to give user an indication of what went wrong; 2 - Less detailed message returned that may not mean anything to the user but that the application might use to take a corrective action; 3 - Not an error but something the user might need to know |
string | |
| Count |
The number of results returned. |
string | |
| PurchaseContract | ClsGrPurCon |
Response Formats
application/json, text/json
{
"Status": "sample string 1",
"Message": "sample string 2",
"Count": "1",
"PurchaseContract": {
"Contract": "sample string 1",
"CustID": "sample string 2",
"Location": "sample string 5",
"Commodity": "sample string 6",
"Dateest": "sample string 7",
"ExpireDate": "sample string 8",
"ContractStatus": "sample string 9",
"ContractType": "sample string 10",
"CashPrice": 11.1,
"ContractQuantity": 12.1,
"QuantityRecvd": 13.1,
"Basisprice": 14.1,
"FuturesMonth": "sample string 15",
"Exchange": "sample string 17",
"StrikePrice": 18.1,
"Futuresprice": 19.1,
"ContractSigned": true,
"BidCriteria": "sample string 21",
"ShipDestination": "sample string 22",
"OriginContract": "sample string 23",
"OriginLocation": "sample string 24",
"SalesmanID": "sample string 25",
"PricingNotes": "sample string 26",
"IsSpot": true,
"originalContractQuantity": 28.1,
"PurchaseContractGuid": "3a58b122-914b-41e0-978c-5c07fe16e6d0",
"SellerSignatureDateSignedToPrint": "2025-11-04T21:17:04.5835905+00:00",
"ContractFormat": "sample string 37",
"DirectShipped": true,
"LastModifiedUTC": "2025-11-04T21:17:04.5835905+00:00",
"PurchaseContractDeliveryDates": [
{
"Contract": "sample string 1",
"Location": "sample string 2",
"Lineitem": "3",
"StartDate": "sample string 4",
"Quantity": "5.1",
"CompleteDate": "sample string 6"
},
{
"Contract": "sample string 1",
"Location": "sample string 2",
"Lineitem": "3",
"StartDate": "sample string 4",
"Quantity": "5.1",
"CompleteDate": "sample string 6"
}
],
"PurchaseContractGradeFactors": [
{
"Contract": "sample string 1",
"Location": "sample string 2",
"Lineitem": "3",
"GradFact": "sample string 4",
"Schedule": "sample string 5",
"Commodity": "sample string 6"
},
{
"Contract": "sample string 1",
"Location": "sample string 2",
"Lineitem": "3",
"GradFact": "sample string 4",
"Schedule": "sample string 5",
"Commodity": "sample string 6"
}
],
"PurchaseContractComments": [
{
"CommentDate": "sample string 4",
"Comment": "sample string 5"
},
{
"CommentDate": "sample string 4",
"Comment": "sample string 5"
}
]
}
}