API Reference / Contracts
Fetch a contract's limits with their usage
Returns each configured buying limit of a contract beside how much of it is used now, counted by the same rules buying enforces: copies held per item across the workspace, and this contract's purchases and spend in its rolling windows with when room frees up. Whether holdings can be confirmed at all is GetOwnershipCoverage.
/ contracts. v1. Contracts/ GetContractLimitUsageRequest body
application/jsonRequired
Request for the configured limits of one contract in the caller's workspace, each with its current usage.
contractIdstringContract identifier.
Format"byte" base64
Response body
application/json
Success
usages?array<ContractLimitUsage>One entry per configured limit, in kind order.
Show attributes
contractId?stringThe contract the limit belongs to.
Format"byte" base64
kind?stringWhich limit this is.
Value in"CONTRACT_"CONTRACT_"CONTRACT_
limit?stringThe configured limit: copies per item, purchases in the window, or cents in the window.
Format"int64"
remaining?stringFor a window, how much is left before it blocks buying (never negative). For max owned per item, how many of the contract's items are still under the limit.
Format"int64"
scope?stringWhat the limit counts across: the whole workspace for max owned per item, this contract alone for the two windows.
Value in"CONTRACT_"CONTRACT_
used?stringFor a window, the purchases or cents counted in it now. For max owned per item, how many of the contract's items the workspace already holds at or over the limit, which buying skips.
Format"int64"
windowResetsAt?stringFor a window with counted purchases, when the oldest of them leaves the window and frees room. Unset for max owned per item and for an empty window.
Format"date-time"
application/json
The request was malformed, such as a missing required field or an unparseable cursor.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
The request lacks a valid API key in the Authorization header.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
The API key is not allowed to perform this action on this workspace.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
The requested resource does not exist in this workspace.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
An internal server error occurred.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
curl -X POST "https://api.goldmine.to/contracts.v1.Contracts/GetContractLimitUsage" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contractId": "EBESExQVFhcYGRobHB0eHw=="
}'const res = await fetch("https://api.goldmine.to/contracts.v1.Contracts/GetContractLimitUsage", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"contractId": "EBESExQVFhcYGRobHB0eHw=="
}),
});
const data = await res.json();body := strings.NewReader(`{
"contractId": "EBESExQVFhcYGRobHB0eHw=="
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/contracts.v1.Contracts/GetContractLimitUsage", body)
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CSTRADER_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)import os, requests
res = requests.post(
"https://api.goldmine.to/contracts.v1.Contracts/GetContractLimitUsage",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"contractId": "EBESExQVFhcYGRobHB0eHw=="
},
)
data = res.json(){
"usages": [
{
"contractId": "EBESExQVFhcYGRobHB0eHw==",
"kind": "CONTRACT_LIMIT_KIND_PURCHASE_WINDOW",
"scope": "CONTRACT_LIMIT_SCOPE_CONTRACT",
"limit": "10",
"used": "3",
"remaining": "7",
"windowResetsAt": "2026-11-10T09:00:00Z"
}
]
}{
"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": "not_found",
"message": "The requested resource does not exist in this workspace."
}{
"code": "internal",
"message": "An internal server error occurred."
}