The API for buying, delivering and storing physical precious metals
Run your gold and silver shop using our catalog and fulfillment
{ api.silvergoldbull.com }
- Trade product premiums
- Dropship capable with white label
- Submit bids - buy at your price, use algorithms
- PayPal and Bitcoin accepted
- 20+ Languages
- 100+ Countries
- 150+ Currencies
- 800+ Products
Getting Started
Email api@silvergoldbull.com with your existing customer ID in order to get an API key. Your API key will have access to the same store as your account. To enable the API in multiple countries and languages you can create an account in each store and then generate keys. Advanced services like white labelling and wholesale pricing require volume commitments, please contact us.
This is a JSON REST API. It makes full use of response codes.
It is recommended to use a content type header of text/json when posting a JSON body.
created_at
fields are always UTC.
Just like on our website, orders are binding once placed and guaranteed by your own account. You are making a promise to pay and honor your order commitment. We immediately hedge your order and will lock your order price no matter what happens.
Authentication
Authentication and identification to the Silver Gold Bull API is done by providing an API key in the X-API-KEY
header on every request.
The API requires that all communication is secured using HTTPS/TLS.
All keys are live. Declarations can be made if you want to test order placement.
Remember to treat your API Keys as passwords and keep them secret. They should not be included in public repositories, client side code, etc.
Rate Limiting
60 requests may be made per 60 second period.
Errors
In the event of a client or server error, the response will contain the standard 4xx or 5xx respectively, accompanied by a well-formed JSON body describing the issue, e.g., a required field was omitted.
Error Object
attribute | type | specification |
---|---|---|
message | string | Human readable description of the problem |
Common HTTP Status Codes
code | name | description |
---|---|---|
200 | OK | The request was successful |
201 | Created | The request was successful and one or more resources was created |
400 | Bad Request | Request not processed due to client error |
401 | Unauthorized | Authentication is required and has failed |
404 | Not Found | The requested resource could not be found |
405 | Method Not Allowed | A request method is not supported for the requested resource; for example, a GET request on a form which requires data to be presented via POST |
421 | Misdirected Request | The request was made to the wrong server |
422 | Unprocessable Entity | The request was well-formed but unable to process the contained instructions |
426 | Upgrade Required | The request must use HTTPS |
429 | Too Many Requests | Too many requests in a 60 second period |
500 | Internal Server Error | Something happened on our side, try again later |
API Clients
Perl client: SilverGoldBull::API
PHP client: silvergoldbull/php-silvergoldbull-api
Raku client: WWW::SilverGoldBull
Golang client: go-silvergoldbull-api
List of Currencies
GET /currencies
View available store currencies.
Request
GET https://api.silvergoldbull.com/v1/currencies
Response
Status: 200 OK
Content-type: application/json
[
{
"name" : "Canadian Dollar",
"id" : "CAD"
},
{
"name" : "US Dollar",
"id" : "USD"
},
{
"name" : "Euro",
"id" : "EUR"
}
]
List of Payment Methods
GET /payments/method
View available methods and requirements. Use these `method` values to specify the payment type in orders as `payment.method`.
Request
GET https://api.silvergoldbull.com/v1/payments/method
Response
Status: 200 OK
Content-type: application/json
[
{
"currency" : [
"CAD"
],
"order_maximum" : 1000,
"name" : "INTERAC E-Transfer",
"country" : [
"CA"
],
"clearing_days" : 2,
"id" : "interac-e-transfer"
},
{
"order_minimum" : 1000,
"name" : "Wire Transfer",
"currency" : [
"CAD",
"USD",
"EUR",
"GBP",
"AUD",
"CHF",
"DKK",
"HKD",
"JPY",
"NOK",
"NZD",
"SEK"
],
"clearing_days" : 1,
"id" : "wire-transfer"
},
{
"country"
--- shortened ---
List of Shipping Methods
GET /shipping/method
Use the id
for shipping_method
field in /create/quote
or /create/order
.
Request
GET https://api.silvergoldbull.com/v1/shipping/method
Response
Status: 200 OK
Content-type: application/json
[
{
"name" : "STORAGE 1 year, renewable",
"id" : "1YR_STORAGE"
},
{
"name" : "FASTEST insured, signed delivery",
"id" : "FASTEST_DELIVERY"
}
]
List of Products
GET /products
View entire product catalog. Use id
in /products
to get more detail like prices.
Request
GET https://api.silvergoldbull.com/v1/products
Response
Status: 200 OK
Content-type: application/json
[
{
"links" : {
"self" : {
"href" : "https://api.silvergoldbull.com/v1/products/4685"
}
},
"id" : "4685",
"name" : "1 oz 2009 Australian Kangaroo Gold Coin",
"in_stock" : false
},
{
"in_stock" : true,
"links" : {
"self" : {
"href" : "https://api.silvergoldbull.com/v1/products/4731"
}
},
"name" : "1 kg | kilo 2014 Lunar Year of the Horse Silver Proof Coin",
"id" : "4731"
},
{
"in_stock" : false,
"id" : "4732",
"name" : "5 oz 2017 America the Be
--- shortened ---
Product Pricing and Detail
GET /products/{id}
input param | type | example | info |
---|---|---|---|
id | text | 1234 | Required - use id from /products |
Request
GET https://api.silvergoldbull.com/v1/products/{id}
Response
Status: 200 OK
Content-type: application/json
{
"id" : "2544",
"metal_weight_troy_oz" : 1,
"reverse" : "Queen Elizabeth II",
"prices" : {
"currency" : "CAD",
"tiers" : [
{
"qty" : 1,
"price" : 2001.81
},
{
"qty" : 10,
"price" : 1997.84
},
{
"qty" : 50,
"price" : 1995.19
}
],
"cash_discount" : true,
"from" : 1995.19,
"to" : 2001.81
},
"description" : "The Canadian Gold Maple Leaf Coin, the official gold coin of Canada is produced by the Royal Canadian Mint (RCM). \r\nOne of the purest regular issue gold coins in the world, these random year coins will feature a gold content of either 999 or 9999 fineness (24 karats). \r\nYou will receive our choice of dates. \r\nThe gold used is sourced exclusively from Canadian mines.\r\n\r\nFirst issued in 1979, the gold content was measured at 999 until 1983. \r\nOffered in fractions of 1/20 oz, 1/10 oz, 1/4 oz, 1/2 oz and 1 oz, the weight and purity is guaranteed by the government of Canada. \r\nThe coins are legal tender denominated in Canadian Dollars ($1, $5, $10, $20, $50).\r\n\r\nEach of the coins maintain a similar, but not always identical, design on both the obverse and reverse. \r\nSome special issues feature colouring, privy marks and other unique attributes or designs.\r\n\r\nThis coin comes with a coin capsule.",
"material" : "Gold",
"total_weight_troy_oz" : 1.2487,
"shape" : "Coin",
"manufacturer" : "Royal Canadian Mint",
"days_since_new" : 4911,
"legal_tender" : "CAD 50",
"links" : {
"self" : {
"href" : "https://api.silvergoldbull.com/v1/products/2544"
}
},
"name" : "1 oz Random Year Canadian Maple Leaf Gold Coin",
"mintage" : null,
"qty" : 9999999,
"obverse" : "Maple Leaf",
"country" : "CA",
"image" : "https://d3avf09moqeia3.cloudfront.net/media/products/2544/tn-2544-m.png",
"purity" : "999",
"tax" : [],
"url" : "https://silvergoldbull.ca/1oz-canadian-gold-maple-leaf-coin",
"in_stock" : true
}
List of Recent Orders
GET /orders
Request
GET https://api.silvergoldbull.com/v1/orders
Response
Status: 200 OK
Content-type: application/json
[
{
"id" : "1397239432",
"created_at" : "2019-08-13 05:23:56",
"status" : "canceled",
"links" : {
"self" : {
"href" : "https://api.silvergoldbull.com/v1/orders/1397239432"
}
},
"grand_total" : 248.39,
"currency" : "CAD"
},
{
"grand_total" : 248.49,
"currency" : "CAD",
"id" : "1397239430",
"created_at" : "2019-08-13 05:22:31",
"status" : "canceled",
"links" : {
"self" : {
"href" : "https://api.silvergoldbull.com/v1/orders/1397239430"
}
}
},
--- shortened ---
Order Detail
GET /orders/{id}
View order detail.
input param | type | example | info |
---|---|---|---|
id | text | 123456789-1 | Required - use id from /orders |
Request
GET https://api.silvergoldbull.com/v1/orders/{id}
Response
Status: 200 OK
Content-type: application/json
{
"created_at" : "2016-10-30 07:52:33",
"shipping_amount" : 0,
"grand_total" : 444.67,
"id" : "1397048909",
"links" : {
"self" : {
"href" : "https://api.silvergoldbull.com/v1/orders/1397048909"
}
},
"shipping" : {
"street" : "321-101 WORTHINGTON ST E",
"email" : null,
"last_name" : "ROZICKY",
"first_name" : "WESLEY",
"postcode" : "P1B 1G5",
"country" : "Canada",
"city" : "NORTH BAY",
"region" : "Ontario",
"company" : "MINDOKA TECHNOLOGY CORP.",
"phone" : "(705) 840 2221"
},
"items" : [
{
"id" : "2706",
"price" : 443.66,
"name" : "10 gram Sunshine Mint Gold Bar",
"tax_amount" : 0,
"qty" : 1
},
{
"qty" : 1,
"name" : "Coin Capsule | 1 oz Silver Coin 38 mm",
"tax_amount" : 0,
"price" : 1.01,
"id" : "2580"
}
],
"status" : "canceled",
"tax_amount" : 0,
"currency" : "USD",
"billing" : {
"postcode" : "P1B 1G5",
"first_name" : "WESLEY",
"last_name" : "ROZICKY",
"email" : null,
"street" : "321-101 WORTHINGTON ST E",
"phone" : "(705) 840 2221",
"company" : "MINDOKA TECHNOLOGY CORP.",
"city" : "NORTH BAY",
"country" : "Canada",
"region" : "Ontario"
},
"shipping_method" : "Free FASTEST"
}
Quote Order
POST /orders/quote
Obtain a live market quote for a new order. If the response is 200 OK
then it is valid and the same data can likely be submitted as an order. To guarantee your order being at or below your price, use bid_price
. If using bid_price
then understand that a successful quote one moment may not submit as an order the next due to market price movements. With or without bid_price
you will always get our best price.
input param | type | example | info |
---|---|---|---|
billing and shipping.company | text | Silver Gold Bull | Optional |
billing and shipping.street | text | 888 - 3 ST SW | Required |
billing and shipping.first_name | text | John | Required |
billing and shipping.last_name | text | Smith | Required |
billing and shipping.city | text | Calgary | Required |
billing and shipping.region | ISO 3166-2 | AB | Required for some countries |
billing and shipping.postcode | text | T2P 5C5 | Required for some countries |
billing and shipping.country | ISO 3166-1 alpha-2 | CA | Required |
declaration | text | TEST | Required to be either TEST or PROMISE_TO_PAY |
shipping_method | text | 1YR_STORAGE | Required - use id from /shipping/method |
payment_method | text | paypal | Required - use id from /payments/method |
currency | ISO 4217 | CAD | Required - use id from /currencies |
items.id | text | 2544 | Required - use id from /products |
items.qty | integer | 12 | Required |
items.bid_price | decimal | 34.92 | Optional - only execute if market price is at or below this value in currency |
Request
Content-type: text/json
POST https://api.silvergoldbull.com/v1/orders/quote
{
"items" : [
{
"id" : "2706",
"qty" : 1,
"bid_price" : 468.37
},
{
"qty" : 1,
"bid_price" : 2,
"id" : "2580"
}
],
"shipping_method" : "1YR_STORAGE",
"payment_method" : "paypal",
"shipping" : {
"last_name" : "Smith",
"region" : "AB",
"city" : "Calgary",
"email" : "sales@silvergoldbull.com",
"postcode" : "T2P 5C5",
"phone" : "+1 (403) 668 8648",
"street" : "888 - 3 ST SW, 10 FLOOR - WEST TOWER",
"country" : "CA",
"first_name" : "John"
},
"billing" : {
"postcode" : "T2P 5C5",
"email" : "sales@silvergoldbull.com",
"city" : "Calgary",
"region" : "AB",
"last_name" : "Smith",
"first_name" : "John",
"country" : "CA",
"phone" : "+1 (403) 668 8648",
"street" : "888 - 3 ST SW, 10 FLOOR - WEST TOWER"
},
"currency" : "USD",
"declaration" : "TEST"
}
Response
Status: 422 Unprocessable Entity
Content-type: application/json
{
"message" : "product `id 2706` is out of stock"
}
Create Order
POST /orders/create
Create and commit your order. Optionally bid on products so that you only buy them if the price is at or below your price limit. Order is confirmed and binding when the response code is 201 Created
and the response JSON includes created_at
and the new order id
. The order confirmation will be emailed.
input param | type | example | info |
---|---|---|---|
billing and shipping.company | text | Silver Gold Bull | Optional |
billing and shipping.street | text | 888 - 3 ST SW | Required |
billing and shipping.first_name | text | John | Required |
billing and shipping.last_name | text | Smith | Required |
billing and shipping.city | text | Calgary | Required |
billing and shipping.region | ISO 3166-2 | AB | Required for some countries |
billing and shipping.postcode | text | T2P 5C5 | Required for some countries |
billing and shipping.country | ISO 3166-1 alpha-2 | CA | Required |
declaration | text | TEST | Required to be either TEST or PROMISE_TO_PAY |
shipping_method | text | 1YR_STORAGE | Required - use id from /shipping/method |
payment_method | text | paypal | Required - use id from /payments/method |
currency | ISO 4217 | CAD | Required - use id from /currencies |
items.id | text | 2544 | Required - use id from /products |
items.qty | integer | 12 | Required |
items.bid_price | decimal | 34.92 | Optional - only execute if market price is at or below this value in currency |
Request
Content-type: text/json
POST https://api.silvergoldbull.com/v1/orders/create
{
"payment_method" : "paypal",
"items" : [
{
"id" : "2706",
"qty" : 1,
"bid_price" : 468.37
},
{
"qty" : 1,
"bid_price" : 2,
"id" : "2580"
}
],
"shipping_method" : "1YR_STORAGE",
"shipping" : {
"region" : "AB",
"last_name" : "Smith",
"email" : "sales@silvergoldbull.com",
"postcode" : "T2P 5C5",
"city" : "Calgary",
"street" : "888 - 3 ST SW, 10 FLOOR - WEST TOWER",
"phone" : "+1 (403) 668 8648",
"first_name" : "John",
"country" : "CA"
},
"currency" : "USD",
"billing" : {
"phone" : "+1 (403) 668 8648",
"street" : "888 - 3 ST SW, 10 FLOOR - WEST TOWER",
"country" : "CA",
"first_name" : "John",
"region" : "AB",
"last_name" : "Smith",
"email" : "sales@silvergoldbull.com",
"postcode" : "T2P 5C5",
"city" : "Calgary"
},
"declaration" : "TEST"
}
Response
Status: 422 Unprocessable Entity
Content-type: application/json
{
"message" : "product `id 2706` is out of stock"
}
고객님의 의견을 공유해주세요