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 |
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.
Name | Type | Description | Required | Notes |
---|---|---|---|---|
contract_id | String | The contract ID to accept. | [required] |
crate::models::AcceptContract200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
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.
Name | Type | Description | Required | Notes |
---|---|---|---|---|
contract_id | String | The ID of the contract. | [required] | |
deliver_contract_request | Option<DeliverContractRequest> |
crate::models::DeliverContract200Response
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
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.
Name | Type | Description | Required | Notes |
---|---|---|---|---|
contract_id | String | The ID of the contract to fulfill. | [required] |
crate::models::FulfillContract200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
crate::models::GetContract200Response get_contract(contract_id) Get Contract
Get the details of a contract by ID.
Name | Type | Description | Required | Notes |
---|---|---|---|---|
contract_id | String | The contract ID | [required] |
crate::models::GetContract200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
crate::models::GetContracts200Response get_contracts(page, limit) List Contracts
Return a paginated list of all your contracts.
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] |
crate::models::GetContracts200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]