Developers

Gold Stack REST API

Automate resource purchases from a backend, a bot, or a dApp. Every response uses the same envelope: { "error": false, "message": "Success", "data": … }

Authentication

API key. Deposit USDT into your internal account — it is credited as GoldStack (GS) — and send the key on every request. Costs are deducted from the balance — no per-order on-chain fee.

# every authenticated call
apikey: YOUR_API_KEY

Signed transaction. Fully self-custody: sign a TRX transfer yourself and submit it with the order. No API key needed.

Platform wallet: TPKWueqW3PYtRQywp8SuZbnuLJJ8Auq4Hy · network MAINNET

Conventions

Base URLhttps://gulfbullionstack.tech/v2
Balance unitGS (1 GS = 1,000,000 minor)
Energy price unitSUN (TRON's own)
Price unitSUN per resource unit
Quoted fora 3-day rental
Rate limit15 req/s (sell: 3)
Interactive spec/openapi-docs

Quick start — buy Energy

# 1. What will it cost?
curl -X POST https://gulfbullionstack.tech/v2/estimate-buy-resource \
  -H 'Content-Type: application/json' \
  -d '{"resourceAmount": 131000, "durationSec": 3600, "unitPrice": "MEDIUM"}'

# -> {"data": {"unitPrice": 36, "estimateCost": 4716000, "availableResource": 131000}}

# 2. Place the order
curl -X POST https://gulfbullionstack.tech/v2/buy-resource \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
        "receiver": "TYOUR_TRON_ADDRESS_HERE",
        "resourceAmount": 131000,
        "durationSec": 3600,
        "unitPrice": "MEDIUM",
        "orderType": "NORMAL",
        "options": {"allowPartialFill": true}
      }'

# 3. Check on it
curl https://gulfbullionstack.tech/v2/order/<orderId> -H 'apikey: YOUR_API_KEY'

Endpoints

EndpointPurposeAuth
GET/v2/user-infoBalance, deposit address and memokey
GET/v2/ledgerEvery balance movementkey
POST/v2/estimate-buy-resourcePrice an order before placing it
POST/v2/buy-resourceCreate an orderkey / signed
GET/v2/order/{id}Order status and delegationskey
GET/v2/ordersOrder historykey
POST/v2/cancel-order/{id}Cancel and refund the remainderkey
POST/v2/extend-orderExtend a rental back to backkey
POST/v2/adviseSmart Sizing — what this address actually needs
GET/v2/price-radarIs now a cheap moment to buy?
GET/v2/order-bookLive supply and pricing
GET/v2/market-statsPlatform-wide numbers
GET/v2/price-historyOrder-book samples over time
POST/v2/claim-depositCredit a deposit by txidkey
POST/v2/stakeFreeze TRX into your poolkey
POST/v2/sell-resourceConfigure your selling poolkey
POST/v2/unstake/{id}Begin the unbonding periodkey
POST/v2/early-unstake/{id}Sell a stake at a discount, instantlykey
GET/v2/autobuyList Auto Buy ruleskey
POST/v2/autobuyCreate or update a rulekey
DEL/v2/autobuy/{id}Delete a rulekey
GET/v2/autopilotPool Autopilot state and earningskey
POST/v2/autopilotLet the platform re-price your poolkey
GET/v2/webhooksEndpoints and recent deliverieskey
POST/v2/webhooksRegister an endpoint (secret shown once)key
DEL/v2/webhooks/{id}Remove an endpointkey

Price tiers

SLOWCheapest level on the book. May fill slowly, or only in part.
MEDIUMDefault. The clearing price for your full amount.
FASTBiased to fill now: MEDIUM when the book covers you, +10 SUN on a partial book, SLOW +20 on an empty one.
80Any number is a fixed price in SUN — full control.

Order options

allowPartialFillAccept less than the full amount.
onlyCreateWhenFulfilledCreate only on a 100% instant fill.
maxPriceAcceptedReject above this SUN price.
minResourceDelegateRequiredAmountMinimum size from any single provider.
preventDuplicateIncompleteOrdersSkip if an identical order is still open.

Self-custody purchase (signed transaction)

Estimate the cost, sign a TRX transfer of that amount to the platform wallet, then submit the signed transaction with the order. Nothing is held on your behalf.

const est = await post('/v2/estimate-buy-resource', {
  resourceAmount: 131000, durationSec: 3600, unitPrice: 'MEDIUM',
});

// Sign a transfer of est.data.estimateCost SUN to the platform wallet
const tx = await tronWeb.transactionBuilder.sendTrx(
  'TPKWueqW3PYtRQywp8SuZbnuLJJ8Auq4Hy', est.data.estimateCost, myAddress,
);
const signedTx = await tronWeb.trx.sign(tx);

await post('/v2/buy-resource', {
  receiver: myAddress,
  resourceAmount: 131000,
  durationSec: 3600,
  unitPrice: est.data.unitPrice,
  signedTx,
});

Safe retries

A request that times out leaves you guessing whether the order was placed. Send an Idempotency-Key and a retry returns the original result instead of buying twice. Reusing a key with a different body is rejected with 409, so a key collision can never silently overwrite an order.

# Both calls return the same orderId; only one order exists.
curl -X POST https://gulfbullionstack.tech/v2/buy-resource   -H 'apikey: YOUR_API_KEY'   -H 'Idempotency-Key: order-2026-09-08-0001'   -H 'Content-Type: application/json'   -d '{"receiver":"TR7...","resourceAmount":131000,"durationSec":3600}'

Webhooks

Register an endpoint and stop polling. Events: order.created, order.filled, order.partially_filled, order.cancelled, order.expired, deposit.credited, pool.repriced. Events are queued in the same database transaction as the change they describe, so you never hear about something that was rolled back. Failures retry with exponential backoff over roughly six hours.

Every request is signed. Verify it before trusting the body:

# Header: X-GoldStack-Signature: t=<unix>,v1=<hex>
import hmac, hashlib, time

def verify(secret, body, header, tolerance=300):
    parts = dict(p.split('=', 1) for p in header.split(','))
    if abs(time.time() - int(parts['t'])) > tolerance:
        return False  # too old: someone is replaying it
    expected = hmac.new(
        secret.encode(), f"{parts['t']}.{body}".encode(), hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(expected, parts['v1'])

Compare the signature over the raw request body, before any JSON parsing — re-serialising changes the bytes and the digest will not match.

Error codes

HTTPCodeMeaning
400INVALID_PARAMSA field failed validation.
400INTERNAL_BALANCE_ACCOUNT_TOO_LOWNot enough balance for this order.
400CANNOT_FULFILLEDThe book cannot fill it. Allow a partial fill or rest a PENDING order.
400PRICE_EXCEED_MAX_PRICE_REQUIREDPrice is above your maxPriceAccepted.
400MUST_BE_WAIT_PREVIOUS_ORDER_FILLEDAn identical order is still incomplete.
400TXID_ALREADY_USEDThat deposit was already credited.
409IDEMPOTENCY_KEY_REUSEDThat key was already used with a different body.
401API_KEY_REQUIREDNo apikey header was sent.
401INVALID_API_KEYThe key is wrong or was rotated.
429RATE_LIMITBack off exponentially and retry.