Trades v1
Reference for the Trades v1 endpoints on Roblox.
Base URL: https://trades.roblox.com
Endpoints
Section titled “Endpoints”| Method | Path | Name |
|---|---|---|
GET | /v1/trades/:tradeId | getTradesTradeid |
POST | /v1/trades/:tradeId/accept | postTradesTradeidAccept |
POST | /v1/trades/:tradeId/counter | postTradesTradeidCounter |
POST | /v1/trades/:tradeId/decline | postTradesTradeidDecline |
GET | /v1/trades/:tradeStatusType | getTradesTradestatustype |
GET | /v1/trades/:tradeStatusType/count | getTradesTradestatustypeCount |
POST | /v1/trades/expire-outdated | postTradesExpireOutdated |
GET | /v1/trades/metadata | getTradesMetadata |
POST | /v1/trades/send | postTradesSend |
GET | /v1/users/:userId/can-trade-with | getUsersUseridCanTradeWith |
getTradesTradeid
Section titled “getTradesTradeid”GET /v1/trades/:tradeId
Gets detailed information about a trade.
Usage
import { fetchApi } from 'rozod';import { getTradesTradeid } from 'rozod/lib/endpoints/tradesv1';
const data = await fetchApi(getTradesTradeid, { tradeId: /* integer */});Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
tradeId | integer | Yes | The trade id. |
Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
offers | object[] | See below |
id | number | |
user | object | See below |
created | string | |
expiration | string | |
isActive | boolean | |
status | `“Unknown" | "Open" |
offers[] item fields:
| Field | Type | Description |
|---|---|---|
user | object | See below |
userAssets | object[] | See below |
robux | number |
user fields:
| Field | Type | Description |
|---|---|---|
id | number | |
name | string | |
displayName | string |
userAssets[] item fields:
| Field | Type | Description |
|---|---|---|
id | number | |
serialNumber | number | |
assetId | number | |
name | string | |
recentAveragePrice | number | |
originalPrice | number | |
assetStock | number | |
membershipType | `“None" | "BC" |
user fields:
| Field | Type | Description |
|---|---|---|
id | number | |
name | string | |
displayName | string |
Errors
Section titled “Errors”| Status | Description |
|---|---|
| 400 | 2: The trade cannot be found or you are not authorized to view it. |
| 401 | 0: Authorization has been denied for this request. 4: You are not authorized to modify this trade. |
| 404 | 2: The trade cannot be found or you are not authorized to view it. |
| 500 | 0: An unknown error occured. |
postTradesTradeidAccept
Section titled “postTradesTradeidAccept”POST /v1/trades/:tradeId/accept
Accepts a trade.
Usage
import { fetchApi } from 'rozod';import { postTradesTradeidAccept } from 'rozod/lib/endpoints/tradesv1';
const data = await fetchApi(postTradesTradeidAccept, { tradeId: /* integer */});Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
tradeId | integer | Yes | The trade id. |
Response
Section titled “Response”Type: unknown
Errors
Section titled “Errors”| Status | Description |
|---|---|
| 400 | 2: The trade cannot be found or you are not authorized to view it. 3: The trade is inactive. 4: You are not authorized to modify this trade. 6: Trade needs to be confirmed by the other party. 6: Trade needs to be confirmed by the other party. 7: The user cannot trade. See field for whether the user who cannot trade is the sender or receiver. 23: The trade reaches Two Step Verification thresholds and the user has not verified in the past time threshold. |
| 401 | 0: Authorization has been denied for this request. |
| 403 | 0: Token Validation Failed |
| 503 | 5: Trading system is unavailable |
postTradesTradeidCounter
Section titled “postTradesTradeidCounter”POST /v1/trades/:tradeId/counter
Counters a trade.
Usage
import { fetchApi } from 'rozod';import { postTradesTradeidCounter } from 'rozod/lib/endpoints/tradesv1';
const data = await fetchApi(postTradesTradeidCounter, { tradeId: /* integer */, body: { /* ... */ }});Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
tradeId | integer | Yes | The trade id. |
Request Body
Section titled “Request Body”| Field | Type | Description |
|---|---|---|
offers | object[] | See below |
offers[] item fields:
| Field | Type | Description |
|---|---|---|
userId | number | |
userAssetIds | number[] | |
robux | number |
Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
id | number |
Errors
Section titled “Errors”| Status | Description |
|---|---|
| 400 | 2: The trade cannot be found or you are not authorized to view it. 4: You are not authorized to modify this trade. 7: The user cannot trade. See field for whether the user who cannot trade is the sender or receiver. 8: The trade request should include offers. 9: Invalid number of trade offers. 10: Invalid trade partner. See field for whether the invalid partner is the sender or receiver. 11: Cannot add negative Robux amounts to a trade. 12: One or more userAssets are invalid. See fieldData for details. 13: Invalid number of userAssets in one side of the trade. 15: The trade is unbalanced. 16: Trade value ratio is not sufficient. 17: You have insufficient Robux to make this offer. 18: Too many Robux in one side of the offer. See field for whether the side is the sender or receiver. 19: Unknown error while processing the trade. 21: Cannot trade with yourself. 22: User’s privacy settings are too strict to allow trading. See field for whether the user is the sender or receiver. |
| 401 | 0: Authorization has been denied for this request. |
| 403 | 0: Token Validation Failed |
| 429 | 14: You are sending too many trade requests. Please slow down and try again later. |
| 502 | 0: An unknown error occured. |
| 503 | 5: Trading system is unavailable |
postTradesTradeidDecline
Section titled “postTradesTradeidDecline”POST /v1/trades/:tradeId/decline
Declines a trade.
Usage
import { fetchApi } from 'rozod';import { postTradesTradeidDecline } from 'rozod/lib/endpoints/tradesv1';
const data = await fetchApi(postTradesTradeidDecline, { tradeId: /* integer */});Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
tradeId | integer | Yes | The trade id. |
Response
Section titled “Response”Type: unknown
Errors
Section titled “Errors”| Status | Description |
|---|---|
| 400 | 2: The trade cannot be found or you are not authorized to view it. 3: The trade is inactive. 4: You are not authorized to modify this trade. 7: The user cannot trade. See field for whether the user who cannot trade is the sender or receiver. |
| 401 | 0: Authorization has been denied for this request. |
| 403 | 0: Token Validation Failed |
| 503 | 5: Trading system is unavailable |
getTradesTradestatustype
Section titled “getTradesTradestatustype”GET /v1/trades/:tradeStatusType
Fetches a list of the authenticated user’s trades.
Usage
import { fetchApi } from 'rozod';import { getTradesTradestatustype } from 'rozod/lib/endpoints/tradesv1';
const data = await fetchApi(getTradesTradestatustype, { tradeStatusType: /* unknown */, cursor: /* string? */, sortOrder: /* enum */});Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
tradeStatusType | unknown | Yes | The trade status type. |
cursor | string? | No | The paging cursor for the previous or next page. |
sortOrder | enum | Yes | Sorted by trade creation date |
Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
previousPageCursor | string | |
nextPageCursor | string | |
data | object[] | See below |
data[] item fields:
| Field | Type | Description |
|---|---|---|
id | number | |
user | object | See below |
created | string | |
expiration | string | |
isActive | boolean | |
status | `“Unknown" | "Open" |
user fields:
| Field | Type | Description |
|---|---|---|
id | number | |
name | string | |
displayName | string |
Errors
Section titled “Errors”| Status | Description |
|---|---|
| 400 | 1: Invalid trade status type. |
| 401 | 0: Authorization has been denied for this request. |
getTradesTradestatustypeCount
Section titled “getTradesTradestatustypeCount”GET /v1/trades/:tradeStatusType/count
Gets the total number of pending trades for the authenticated user.
Usage
import { fetchApi } from 'rozod';import { getTradesTradestatustypeCount } from 'rozod/lib/endpoints/tradesv1';
const data = await fetchApi(getTradesTradestatustypeCount, { tradeStatusType: /* unknown */});Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
tradeStatusType | unknown | Yes | The trade status type to fetch a total count for. |
Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
count | number |
Errors
Section titled “Errors”| Status | Description |
|---|---|
| 400 | 1: Invalid trade status type. |
| 401 | 0: Authorization has been denied for this request. |
postTradesExpireOutdated
Section titled “postTradesExpireOutdated”POST /v1/trades/expire-outdated
Deprecated. TradeSession are automatically set to expire while the inbound/outbound trades are fetched.
Usage
import { fetchApi } from 'rozod';import { postTradesExpireOutdated } from 'rozod/lib/endpoints/tradesv1';
const data = await fetchApi(postTradesExpireOutdated, undefined);Response
Section titled “Response”Type: unknown
Errors
Section titled “Errors”| Status | Description |
|---|---|
| 401 | 0: Authorization has been denied for this request. |
| 403 | 0: Token Validation Failed |
getTradesMetadata
Section titled “getTradesMetadata”GET /v1/trades/metadata
Gets metadata about the trade system.
Usage
import { fetchApi } from 'rozod';import { getTradesMetadata } from 'rozod/lib/endpoints/tradesv1';
const data = await fetchApi(getTradesMetadata, undefined);Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
maxItemsPerSide | number | |
minValueRatio | number | |
tradeSystemMaxRobuxPercent | number | |
tradeSystemRobuxFee | number |
Errors
Section titled “Errors”| Status | Description |
|---|---|
| 401 | 0: Authorization has been denied for this request. |
postTradesSend
Section titled “postTradesSend”POST /v1/trades/send
Sends a trade.
Usage
import { fetchApi } from 'rozod';import { postTradesSend } from 'rozod/lib/endpoints/tradesv1';
const data = await fetchApi(postTradesSend, { body: { /* ... */ }});Request Body
Section titled “Request Body”| Field | Type | Description |
|---|---|---|
offers | object[] | See below |
offers[] item fields:
| Field | Type | Description |
|---|---|---|
userId | number | |
userAssetIds | number[] | |
robux | number |
Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
id | number |
Errors
Section titled “Errors”| Status | Description |
|---|---|
| 400 | 7: The user cannot trade. See field for whether the user who cannot trade is the sender or receiver. 8: The trade request should include offers. 9: Invalid number of trade offers. 10: Invalid trade partner. See field for whether the invalid partner is the sender or receiver. 11: Cannot add negative Robux amounts to a trade. 12: One or more userAssets are invalid. See fieldData for details. 13: Invalid number of userAssets in one side of the trade. 15: The trade is unbalanced. 16: Trade value ratio is not sufficient. 17: You have insufficient Robux to make this offer. 18: Too many Robux in one side of the offer. See field for whether the side is the sender or receiver. 19: Unknown error while processing the trade. 21: Cannot trade with yourself. 22: User’s privacy settings are too strict to allow trading. See field for whether the user is the sender or receiver. 23: The trade reaches Two Step Verification thresholds and the user has not verified in the past time threshold. |
| 401 | 0: Authorization has been denied for this request. |
| 403 | 0: Token Validation Failed |
| 429 | 14: You are sending too many trade requests. Please slow down and try again later. |
| 502 | 0: An unknown error occured. |
| 503 | 5: Trading system is unavailable |
getUsersUseridCanTradeWith
Section titled “getUsersUseridCanTradeWith”GET /v1/users/:userId/can-trade-with
Returns whether you can trade with another user.
Usage
import { fetchApi } from 'rozod';import { getUsersUseridCanTradeWith } from 'rozod/lib/endpoints/tradesv1';
const data = await fetchApi(getUsersUseridCanTradeWith, { userId: /* integer */});Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
userId | integer | Yes | The other user’s id. |
Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
canTrade | boolean | |
status | `“Unknown" | "CanTrade" |
Errors
Section titled “Errors”| Status | Description |
|---|---|
| 400 | 10: Invalid trade partner. See field for whether the invalid partner is the sender or receiver. |
| 401 | 0: Authorization has been denied for this request. |