Precious Metals Buy/Sell
Fortress APIs allow trades of Gold and Silver
Overview
The general workflow for trades will look like the following:
- Pull the market price for the metal your end user is looking to buy/sell from our API.
- Give the end user the ability to confirm a trade after looking at the market price.
- Call the Fortress API to initiate a trade
- Monitor the webhooks sent for a change in the status of a trade.
Lets review each step a bit more
- Pull the market price
GET /api/trust/v1/precious-metals/price/{metalType}
//Sample Response
{
"buy": 1969.702,
"sell": 1968.692
}
- Allow the end user to confirm that they want the trade after presenting them the market price. Pricing spreads can be added to any trade. Either SpreadBasisPoints for basis points markup or SpreadBasisPoints for a dollar markup.
- Initiate a trade using the API
POST /api/trust/v1/trades
//Sample Request
{
"accountId": "A3CA08AB-3058-4C3C-81E7-51DA24B171FF",
"type": "market", //only "market" is available at this time
"from": {
"asset": "usd",
"amount": 100
},
"to": {
"asset": "gold"
},
"spreadBasisPoints": 0,
"spreadFiatPerUnit": 50,
"comment": "Any Comment Here"
}
OR
POST /api/trust/v1/trades
// Sample Request
{
"accountId": "A3CA08AB-3058-4C3C-81E7-51DA24B171FF",
"type": "market", //only "market" is availbable at this time
"from": {
"asset": "Silver",
"amount": 100
},
"to": {
"asset": "usd"
},
"spreadBasisPoints": 0, //or
"spreadFiatPerUnit": 50,
"comment": "Any Comment Here"
}
All in one
The
trades
endpoint facilitates both buys and sells by designating thefrom
andto
fields.
- Monitor Webhooks
An integrator will receive one webhook when the buy/sell transaction is moved to the Processing
status and another webhook when the settlement process is completed. Here are a list of the status's available for the trades
endpoint:
-
Pending (the buy/sell request is created)
-
InProgress (the buy/sell request is in progress and has executed at a particular price, pending incoming transaction is displayed in an account balance)
-
Completed (settlement process is completed)
-
Aborted (processing of the buy/sell request is failed
Updated 10 months ago