Skip to main content

Error Codes

All errors follow this format:
{
  "requestId": "...",
  "success": false,
  "error": {
    "code": 1001,
    "key": "VALIDATION_FAILED",
    "message": "Invalid request data"
  }
}

Trading Errors

These codes are returned when deposit or withdrawal requests fail.
CodeKeyHTTPDescription
1EXTERNAL_ID_EXISTS409External ID already exists for this merchant
2MISSING_ITEMS400No items were provided in the request
3INVENTORY_FETCH_FAILED500Couldn’t load the user’s Steam inventory
4NO_OFFER_FOUND400No valid offer exists for this item
5TRADE_OFFER_FAILED500Failed to send the Steam trade offer
6TOO_MANY_ACTIVE_TRADES429User has too many pending trades
7USER_NOT_TRADEABLE400User’s Steam account can’t trade
8TOO_MANY_ITEMS400Too many items in a single request
9ITEMS_UNAVAILABLE400Selected items not found or no longer available
10ITEMS_NOT_ACCEPTED400Items are not accepted for deposit
11PRICE_CHANGED409Price has changed since you last fetched it
12MERCHANT_BALANCE_LOW400Merchant balance is too low for this withdrawal
14INVALID_TRADEURL400Invalid or inaccessible trade URL
15LISTING_NOT_FOUND404Marketplace listing not found
16LISTING_PRICE_INVALID400Listing has an invalid or missing price
17INVALID_LISTING_ID400Invalid listing ID format
18DATABASE_ERROR500Database error occurred
19INSUFFICIENT_ITEM_AMOUNT400Requested amount exceeds available quantity
20EXCEEDS_MAX_AMOUNT400Requested amount exceeds the maximum allowed
21DEPOSIT_IN_PROGRESS429A deposit is already processing for this user

General Errors

CodeKeyHTTPDescription
1000SERVER_ERROR500Internal server error
1001VALIDATION_FAILED400Request body or query params failed validation
1002UNAUTHORIZED401Authentication required
1003FORBIDDEN403Permission denied
1004NOT_FOUND404Resource not found
1005CONFLICT409State conflict
1006UNPROCESSABLE422Request cannot be processed
1007RATE_LIMITED429Too many requests
1008SERVICE_UNAVAILABLE503Service temporarily unavailable
1009SYSTEM_MAINTENANCE503System is in maintenance mode

Authentication Errors

CodeKeyHTTPDescription
1220MISSING_BEARER401No authorization token provided
1222INVALID_TOKEN401Token is invalid or expired

API Key Errors

CodeKeyHTTPDescription
1400MISSING_API_KEY401No api-key header provided
1401INVALID_API_KEY401API key not found or invalid
1402API_KEY_REVOKED403API key has been revoked
1403API_KEY_SCOPE_DENIED403API key doesn’t have the required scope
1404API_KEY_IP_DENIED403Request IP is not in the key’s whitelist

Handling Errors

Check success first, then handle based on the error code or key:
const response = await fetch('https://api.assetpay.co/client/trading/deposit', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': clientToken
  },
  body: JSON.stringify(depositPayload)
});

const result = await response.json();

if (!result.success) {
  switch (result.error.key) {
    case 'PRICE_CHANGED':
      // Refetch inventory and show updated prices
      break;
    case 'ITEMS_UNAVAILABLE':
      // Remove unavailable items from selection
      break;
    case 'DEPOSIT_IN_PROGRESS':
      // Tell user to wait for current deposit to finish
      break;
    case 'MERCHANT_BALANCE_LOW':
      // Withdrawal can't proceed, notify user
      break;
    default:
      // Log the error for debugging
      console.error(`Trade error: ${result.error.key} (${result.error.code})`);
  }
}
When contacting support about an error, include the requestId from the response. It helps us trace the exact request in our logs.