(Contracts)
Contracts
- GetContracts - List Contracts
- GetContract - Get Contract
- AcceptContract - Accept Contract
- DeliverContract - Deliver Cargo to Contract
- FulfillContract - Fulfill Contract
Return a paginated list of all your contracts.
using Openapi;
using Openapi.Models.Requests;
var sdk = new SeUnitySDK();
using(var res = await sdk.Contracts.GetContractsAsync(
"<YOUR_BEARER_TOKEN_HERE>",
page: 907785,
limit: 306163))
{
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
security |
Openapi.Models.Requests.GetContractsSecurity | ✔️ | The security requirements to use for the request. |
Page |
long | ➖ | What entry offset to request |
Limit |
long | ➖ | How many entries to return per page |
Get the details of a contract by ID.
using Openapi;
using Openapi.Models.Requests;
var sdk = new SeUnitySDK();
using(var res = await sdk.Contracts.GetContractAsync(
"<YOUR_BEARER_TOKEN_HERE>",
contractId: "<value>"))
{
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
security |
Openapi.Models.Requests.GetContractSecurity | ✔️ | The security requirements to use for the request. |
ContractId |
string | ✔️ | The contract ID |
Accept a contract by ID.
You can only accept contracts that were offered to you, were not accepted yet, and whose deadlines has not passed yet.
using Openapi;
using Openapi.Models.Requests;
var sdk = new SeUnitySDK();
using(var res = await sdk.Contracts.AcceptContractAsync(
"<YOUR_BEARER_TOKEN_HERE>",
contractId: "<value>"))
{
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
security |
Openapi.Models.Requests.AcceptContractSecurity | ✔️ | The security requirements to use for the request. |
ContractId |
string | ✔️ | The contract ID to accept. |
Deliver cargo to a contract.
In order to use this API, a ship must be at the delivery location (denoted in the delivery terms as destinationSymbol
of a contract) and must have a number of units of a good required by this contract in its cargo.
Cargo that was delivered will be removed from the ship's cargo.
using Openapi;
using Openapi.Models.Requests;
var sdk = new SeUnitySDK();
using(var res = await sdk.Contracts.DeliverContractAsync(
"<YOUR_BEARER_TOKEN_HERE>",
contractId: "<value>",
requestBody: new DeliverContractRequestBody() {
ShipSymbol = "<value>",
TradeSymbol = "<value>",
Units = 800350,
}))
{
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
security |
Openapi.Models.Requests.DeliverContractSecurity | ✔️ | The security requirements to use for the request. |
ContractId |
string | ✔️ | The ID of the contract. |
RequestBody |
DeliverContractRequestBody | ➖ | N/A |
Fulfill a contract. Can only be used on contracts that have all of their delivery terms fulfilled.
using Openapi;
using Openapi.Models.Requests;
var sdk = new SeUnitySDK();
using(var res = await sdk.Contracts.FulfillContractAsync(
"<YOUR_BEARER_TOKEN_HERE>",
contractId: "<value>"))
{
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
security |
Openapi.Models.Requests.FulfillContractSecurity | ✔️ | The security requirements to use for the request. |
ContractId |
string | ✔️ | The ID of the contract to fulfill. |