Goldmine
Contracts

Create a contract

POST
/contracts.v1.Contracts/CreateContract

Creates a new buying or selling contract in the workspace. A new contract starts as a draft and is activated separately once it has a valuation.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/contracts.v1.Contracts/CreateContract" \  -H "Content-Type: application/json" \  -d '{    "name": "AK-47 Redline under $50",    "description": "Buy AK-47 Redline in Field-Tested or better below $50 on CSFloat.",    "type": "CONTRACT_TYPE_BUYING",    "predicate": {      "group": {        "condition": "PREDICATE_CONDITION_AND",        "rules": [          {            "rule": {              "field": "PREDICATE_FIELD_WEAPON",              "operator": "PREDICATE_OPERATOR_EQ",              "value": {                "stringValue": "AK-47"              }            }          },          {            "rule": {              "field": "PREDICATE_FIELD_PAINT",              "operator": "PREDICATE_OPERATOR_EQ",              "value": {                "stringValue": "Redline"              }            }          },          {            "rule": {              "field": "PREDICATE_FIELD_MAX_WEAR",              "operator": "PREDICATE_OPERATOR_LTE",              "value": {                "numberValue": 0.38              }            }          },          {            "rule": {              "valueField": "PREDICATE_VALUE_FIELD_COMPUTED_PRICE",              "operator": "PREDICATE_OPERATOR_LTE",              "value": {                "numberValue": 5000              }            }          }        ]      }    },    "valuation": {      "references": [        {          "source": "buff163",          "metric": "sell_min"        }      ],      "strategy": "VALUATION_STRATEGY_MIN"    },    "strategies": [      {        "csfloatBuyOrder": {          "maxOrders": 3,          "maxPriceCents": 5000        }      }    ],    "accountGroupId": "oKCgoAQFBgcICQoLDA0ODw==",    "limits": {      "maxOwnedPerItem": 2,      "purchaseWindow": {        "count": 10,        "days": 7      },      "spendWindow": {        "amountCents": "50000",        "days": 7      }    }  }'
{
  "contract": {
    "id": "MDEyMzQ1Njc4OTo7PD0+Pw==",
    "workspaceId": "AAECAwQFBgcICQoLDA0ODw==",
    "name": "AK-47 Redline under $50",
    "description": "Buy AK-47 Redline in Field-Tested or better below $50 on CSFloat.",
    "status": "CONTRACT_STATUS_DRAFT",
    "type": "CONTRACT_TYPE_BUYING",
    "createdAt": "2026-06-29T10:00:00Z",
    "updatedAt": "2026-06-29T10:00:00Z",
    "version": "1",
    "predicate": {
      "group": {
        "condition": "PREDICATE_CONDITION_AND",
        "rules": [
          {
            "rule": {
              "field": "PREDICATE_FIELD_WEAPON",
              "operator": "PREDICATE_OPERATOR_EQ",
              "value": {
                "stringValue": "AK-47"
              }
            }
          },
          {
            "rule": {
              "field": "PREDICATE_FIELD_PAINT",
              "operator": "PREDICATE_OPERATOR_EQ",
              "value": {
                "stringValue": "Redline"
              }
            }
          },
          {
            "rule": {
              "field": "PREDICATE_FIELD_MAX_WEAR",
              "operator": "PREDICATE_OPERATOR_LTE",
              "value": {
                "numberValue": 0.38
              }
            }
          },
          {
            "rule": {
              "valueField": "PREDICATE_VALUE_FIELD_COMPUTED_PRICE",
              "operator": "PREDICATE_OPERATOR_LTE",
              "value": {
                "numberValue": 5000
              }
            }
          }
        ]
      }
    },
    "valuation": {
      "references": [
        {
          "source": "buff163",
          "metric": "sell_min"
        }
      ],
      "strategy": "VALUATION_STRATEGY_MIN"
    },
    "strategies": [
      {
        "csfloatBuyOrder": {
          "maxOrders": 3,
          "maxPriceCents": 5000
        }
      }
    ],
    "accountGroupId": "oKCgoAQFBgcICQoLDA0ODw==",
    "limits": {
      "maxOwnedPerItem": 2,
      "purchaseWindow": {
        "count": 10,
        "days": 7
      },
      "spendWindow": {
        "amountCents": "50000",
        "days": 7
      }
    }
  }
}
{
  "code": "invalid_argument",
  "message": "The request was malformed, such as a missing required field or an unparseable cursor."
}
{
  "code": "unauthenticated",
  "message": "The request lacks a valid API key in the Authorization header."
}
{
  "code": "permission_denied",
  "message": "The API key is not allowed to perform this action on this workspace."
}
{
  "code": "resource_exhausted",
  "message": "The request was rate limited. Slow down and retry later."
}
{
  "code": "internal",
  "message": "An internal server error occurred."
}