API Reference / Trade offers
Accept a trade offer
Accept an incoming trade offer received by the account. The offer must still be active to be accepted.
/ steam. v1. Steam/ AcceptTradeOfferRequest body
application/jsonRequired
Request to accept an active incoming trade offer received by one of the workspace's accounts.
accountNamestringSteam account the offer was received on.
deadlineAt?stringWhen the market stops waiting for this accept. Pending accepts with an origin are worked earliest deadline first and retried more often as it nears. Absent when the market named none.
Format"date-time"
expectedItems?array<ExpectedTradeItem>Items the offer must give, for an accept with an origin: it is accepted only when it takes nothing and carries every one of them. Extra items are allowed. Empty checks only that the offer takes nothing.
Show attributes
appId?integerThe Steam app the asset belongs to, compared with the asset id. 730 (Counter-Strike 2) when unset.
Format"int32"
assetId?stringThe item's Steam asset id in the giver's inventory, when the market named it.
classId?stringThe item's class id, compared when set.
contextId?stringThe inventory context the asset belongs to, compared with the asset id. 2 when unset.
floatDecimalPlaces?integerThe number of decimal places the market cuts or rounds float_value to, for float_printing TRUNCATED or ROUNDED (Market.CSGO truncates to 14).
Format"int32"
floatPrinting?stringHow the market printed float_value, so it is compared with the wear Steam shows at the market's own precision. Unspecified reads as FULL.
Value in"FLOAT_"FLOAT_"FLOAT_
floatValue?numberThe item's float (wear), when it has one and the market shows it. An expected item with a float and no asset id is matched only against an offered item whose float, paint seed and market hash name Steam has shown for it, never by name alone.
Format"double"
instanceId?stringThe item's instance id, compared when set.
marketHashName?stringThe item's market hash name, compared when set and no asset id is given.
marketReference?MarketReferenceThe purchase's own id on the market, as the market writes it into the Steam offer's message (CSFloat's trade id). When the offer's message carries a reference of a known market, it must be one of the expected items' market references or the accept is refused with REFERENCE_MISMATCH. A message with no known reference leaves the accept to the items. Unset: the market gives no reference to compare.
Show attributes
market?stringThe market whose reference it is.
Value in"TRADE_
reference?stringThe purchase's id on that market (CSFloat: the trade id).
paintSeed?stringThe item's paint seed (pattern), compared with the float.
Format"int64"
purchaseReference?stringThe caller's reference for the purchase this item is. Carried onto the received item record the accept creates, which pairs the item with what it became in the account after the accept, since Steam no longer reports the item's new asset id.
offerIdstringTrade offer identifier to accept.
origin?TradeOfferOriginWhat the offer is for, recorded once the accept succeeds so the offer reads as handled automatically. Absent leaves the origin as observed.
Show attributes
contractId?stringThe buying or selling contract behind the purchase or sale, when known.
Format"byte" base64
handledAutomatically?booleanWhether the platform itself accepted or sent the offer. False for a manual trade and for an offer classified after the fact.
kind?stringWhat the offer is for. MANUAL for a trade the platform did not tie to a purchase or a sale.
Value in"TRADE_"TRADE_"TRADE_
purchaseId?stringThe purchase the offer delivers. Set only for PURCHASE_DELIVERY.
Format"byte" base64
saleId?stringThe sale the offer delivers. Set only for SALE_DELIVERY.
Format"byte" base64
setAt?stringWhen the origin was recorded. Unset for a manual trade.
Format"date-time"
Response body
application/json
Success
No fields.
application/json
The request was malformed, such as a missing required field or an unparseable cursor. The request cannot be carried out in the current system state.
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
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/steam.v1.Steam/AcceptTradeOffer" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"accountName": "trader_bot_01",
"offerId": "6483920184"
}'const res = await fetch("https://api.goldmine.to/steam.v1.Steam/AcceptTradeOffer", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"accountName": "trader_bot_01",
"offerId": "6483920184"
}),
});
const data = await res.json();body := strings.NewReader(`{
"accountName": "trader_bot_01",
"offerId": "6483920184"
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/steam.v1.Steam/AcceptTradeOffer", 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/steam.v1.Steam/AcceptTradeOffer",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"accountName": "trader_bot_01",
"offerId": "6483920184"
},
)
data = res.json(){}{
"code": "failed_precondition",
"message": "The request cannot be carried out in the current system state."
}{
"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": "resource_exhausted",
"message": "The request was rate limited. Slow down and retry later."
}{
"code": "internal",
"message": "An internal server error occurred."
}