API Reference / Purchases
Find purchases and inventory items by part of their id
Returns at most 3 purchases and 3 inventory items in the workspace whose id contains the given hex fragment, ids ending in the fragment first, then newest first. A whole id is served the same way.
/ contracts. v1. Contracts/ GetRecordReferencesByIDFragmentRequest body
application/jsonRequired
Request for the purchases and inventory items in the caller's workspace whose id contains a hex fragment.
idFragment?string4 to 32 hexadecimal characters, case-insensitive, dashes ignored. Anything else is rejected with invalid_argument.
objectTypes?array<string>Kinds to search: OBJECT_TYPE_CONTRACTS_PURCHASE and OBJECT_TYPE_CONTRACTS_INVENTORY_ITEM. Empty searches both. Any other value is rejected with invalid_argument.
Value in"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_
Response body
application/json
Success
records?array<RecordReference>Purchases first, then inventory items. Within a kind, ids ending in the fragment first, then newest first.
Show attributes
id?stringThe record's full 16-byte id.
Format"byte" base64
inventoryItemStatus?stringAn inventory item's status, so a sold item opens as a sale. Unset for a purchase.
Value in"INVENTORY_"INVENTORY_"INVENTORY_"INVENTORY_"INVENTORY_
marketHashName?stringThe record's item name, for the label.
objectType?stringThe record's kind: OBJECT_TYPE_CONTRACTS_PURCHASE or OBJECT_TYPE_CONTRACTS_INVENTORY_ITEM.
Value in"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_"OBJECT_
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 request was rate limited. Slow down and retry later.
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/GetRecordReferencesByIDFragment" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"idFragment": "3f9a0c21"
}'const res = await fetch("https://api.goldmine.to/contracts.v1.Contracts/GetRecordReferencesByIDFragment", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"idFragment": "3f9a0c21"
}),
});
const data = await res.json();body := strings.NewReader(`{
"idFragment": "3f9a0c21"
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/contracts.v1.Contracts/GetRecordReferencesByIDFragment", 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/GetRecordReferencesByIDFragment",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"idFragment": "3f9a0c21"
},
)
data = res.json(){
"records": [
{
"objectType": "OBJECT_TYPE_CONTRACTS_PURCHASE",
"id": "MDEyMzQ1Njc4OTo7PD0+Pw==",
"marketHashName": "AK-47 | Redline (Field-Tested)"
}
]
}{
"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."
}