Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Latest commit

 

History

History
165 lines (91 loc) · 5.22 KB

ContractsApi.md

File metadata and controls

165 lines (91 loc) · 5.22 KB

\ContractsApi

All URIs are relative to https://api.spacetraders.io/v2

Method HTTP request Description
accept_contract POST /my/contracts/{contractId}/accept Accept Contract
deliver_contract POST /my/contracts/{contractId}/deliver Deliver Cargo to Contract
fulfill_contract POST /my/contracts/{contractId}/fulfill Fulfill Contract
get_contract GET /my/contracts/{contractId} Get Contract
get_contracts GET /my/contracts List Contracts

accept_contract

crate::models::AcceptContract200Response accept_contract(contract_id) Accept Contract

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.

Parameters

Name Type Description Required Notes
contract_id String The contract ID to accept. [required]

Return type

crate::models::AcceptContract200Response

Authorization

AgentToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deliver_contract

crate::models::DeliverContract200Response deliver_contract(contract_id, deliver_contract_request) Deliver Cargo to Contract

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.

Parameters

Name Type Description Required Notes
contract_id String The ID of the contract. [required]
deliver_contract_request Option<DeliverContractRequest>

Return type

crate::models::DeliverContract200Response

Authorization

AgentToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

fulfill_contract

crate::models::FulfillContract200Response fulfill_contract(contract_id) Fulfill Contract

Fulfill a contract. Can only be used on contracts that have all of their delivery terms fulfilled.

Parameters

Name Type Description Required Notes
contract_id String The ID of the contract to fulfill. [required]

Return type

crate::models::FulfillContract200Response

Authorization

AgentToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_contract

crate::models::GetContract200Response get_contract(contract_id) Get Contract

Get the details of a contract by ID.

Parameters

Name Type Description Required Notes
contract_id String The contract ID [required]

Return type

crate::models::GetContract200Response

Authorization

AgentToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_contracts

crate::models::GetContracts200Response get_contracts(page, limit) List Contracts

Return a paginated list of all your contracts.

Parameters

Name Type Description Required Notes
page Option<i32> What entry offset to request [default to 1]
limit Option<i32> How many entries to return per page [default to 10]

Return type

crate::models::GetContracts200Response

Authorization

AgentToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]