Run your gold and silver shop using our catalog and fulfillment
{ api.silvergoldbull.com }
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 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.
60 requests may be made per 60 second period.
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.
attribute | type | specification |
---|---|---|
message | string | Human readable description of the problem |
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 |
Perl client: SilverGoldBull::API
PHP client: silvergoldbull/php-silvergoldbull-api
Perl6 client: WWW::SilverGoldBull
GET /currencies
View available store currencies.
GET https://api.silvergoldbull.com/v1/currencies
Status: 200 OK
Content-type: application/json
[
{
"name" : "Canadian Dollar",
"id" : "CAD"
},
{
"id" : "USD",
"name" : "US Dollar"
},
{
"name" : "Euro",
"id" : "EUR"
}
]
GET /payments/method
View available methods and requirements. Use these `method` values to specify the payment type in orders as `payment.method`.
GET https://api.silvergoldbull.com/v1/payments/method
Status: 200 OK
Content-type: application/json
[
{
"order_maximum" : 1000,
"name" : "INTERAC E-Transfer",
"country" : [
"CA"
],
"currency" : [
"CAD"
],
"clearing_days" : 2,
"id" : "interac-e-transfer"
},
{
"name" : "Wire Transfer",
"order_minimum" : 1000,
"currency" : [
"CAD",
"USD",
"EUR",
"GBP",
"AUD",
"CHF",
"DKK",
"HKD",
"JPY",
"NOK",
"NZD",
"SEK"
],
"clearing_days" : 1,
"id" : "wire-transfer"
},
{
"country"
--- shortened ---
GET /shipping/method
Use the id
for shipping_method
field in /create/quote
or /create/order
.
GET https://api.silvergoldbull.com/v1/shipping/method
Status: 200 OK
Content-type: application/json
[
{
"id" : "1YR_STORAGE",
"name" : "STORAGE 1 year, renewable"
},
{
"name" : "FASTEST insured, signed delivery",
"id" : "FASTEST_DELIVERY"
}
]
GET /products
View entire product catalog. Use id
in /products
to get more detail like prices.
GET https://api.silvergoldbull.com/v1/products
Status: 200 OK
Content-type: application/json
[
{
"id" : "4723",
"name" : "10 oz Silver Gold Bull Silver Bar | AT SPOT PRICE",
"in_stock" : true,
"links" : {
"self" : {
"href" : "https://api.silvergoldbull.com/v1/products/4723"
}
}
},
{
"in_stock" : true,
"links" : {
"self" : {
"href" : "https://api.silvergoldbull.com/v1/products/3078"
}
},
"name" : "10 oz New Royal Canadian Mint Silver Bar",
"id" : "3078"
},
{
"in_stock" : true,
"links" : {
"self" : {
"href" : "https://api
--- shortened ---
GET /products/{id}
input param | type | example | info |
---|---|---|---|
id | text | 1234 | Required - use id from /products |
GET https://api.silvergoldbull.com/v1/products/{id}
Status: 200 OK
Content-type: application/json
{
"manufacturer" : "Royal Canadian Mint",
"reverse" : "Queen Elizabeth II",
"shape" : "Coin",
"country" : "CA",
"url" : "https://silvergoldbull.ca/1oz-canadian-gold-maple-leaf-coin",
"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.\r\n\r\nThese coins are discounted as they may be tarnished, scratched or visibly handled. \r\n\r\nWeight and purity are guaranteed but year and condition are subject to availability.\r\n\r\nThese coins are discounted as they may be tarnished, scratched or visibly handled. \r\n\r\nWeight and purity are guaranteed but year and condition are subject to availability.",
"material" : "Gold",
"name" : "1 oz Random Year Canadian Maple Leaf Gold Coin",
"total_weight_troy_oz" : 1.2487,
"days_since_new" : 4603,
"metal_weight_troy_oz" : 1,
"links" : {
"self" : {
"href" : "https://api.silvergoldbull.com/v1/products/2544"
}
},
"tax" : [],
"image" : "https://d3avf09moqeia3.cloudfront.net/media/products/2544/tn-2544-m.png",
"in_stock" : true,
"purity" : "999",
"prices" : {
"from" : 1788.99,
"tiers" : [
{
"qty" : 1,
"price" : 1796.88
},
{
"qty" : 10,
"price" : 1792.93
},
{
"qty" : 50,
"price" : 1788.99
}
],
"to" : 1796.88,
"cash_discount" : true,
"currency" : "CAD"
},
"qty" : 499,
"obverse" : "Maple Leaf",
"id" : "2544",
"mintage" : null,
"legal_tender" : "CAD 50"
}
GET /orders
GET https://api.silvergoldbull.com/v1/orders
Status: 200 OK
Content-type: application/json
[
{
"id" : "1397051140",
"created_at" : "2016-11-13 19:48:39",
"grand_total" : 25.15,
"status" : "canceled",
"links" : {
"self" : {
"href" : "https://api.silvergoldbull.com/v1/orders/1397051140"
}
},
"currency" : "CAD"
},
{
"currency" : "CAD",
"status" : "canceled",
"links" : {
"self" : {
"href" : "https://api.silvergoldbull.com/v1/orders/1397050171"
}
},
"created_at" : "2016-11-08 03:53:52",
"id" : "1397050171",
"grand_total" : 21.42
},
--- shortened ---
GET /orders/{id}
View order detail.
input param | type | example | info |
---|---|---|---|
id | text | 123456789-1 | Required - use id from /orders |
GET https://api.silvergoldbull.com/v1/orders/{id}
Status: 200 OK
Content-type: application/json
{
"items" : [
{
"tax_amount" : 0,
"id" : "2706",
"name" : "10 g Sunshine Mint Gold Bar",
"price" : 443.66,
"qty" : 1
},
{
"price" : 1.01,
"qty" : 1,
"tax_amount" : 0,
"name" : "Coin Capsule | 1 oz Silver Coin 38 mm",
"id" : "2580"
}
],
"status" : "canceled",
"shipping" : {},
"shipping_method" : "Free FASTEST",
"links" : {
"self" : {
"href" : "https://api.silvergoldbull.com/v1/orders/1397048909"
}
},
"id" : "1397048909",
"currency" : "USD",
"billing" : {},
"grand_total" : 444.67,
"created_at" : "2016-10-30 07:52:33",
"shipping_amount" : 0,
"tax_amount" : 0
}
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 |
Content-type: text/json
POST https://api.silvergoldbull.com/v1/orders/quote
{
"shipping" : {
"country" : "CA",
"city" : "Calgary",
"region" : "AB",
"street" : "888 - 3 ST SW, 10 FLOOR - WEST TOWER",
"last_name" : "Smith",
"email" : "sales@silvergoldbull.com",
"phone" : "+1 (403) 668 8648",
"first_name" : "John",
"postcode" : "T2P 5C5"
},
"shipping_method" : "1YR_STORAGE",
"declaration" : "TEST",
"payment_method" : "paypal",
"currency" : "USD",
"items" : [
{
"qty" : 1,
"id" : "2706",
"bid_price" : 468.37
},
{
"bid_price" : 2,
"id" : "2580",
"qty" : 1
}
],
"billing" : {
"email" : "sales@silvergoldbull.com",
"phone" : "+1 (403) 668 8648",
"first_name" : "John",
"postcode" : "T2P 5C5",
"city" : "Calgary",
"country" : "CA",
"region" : "AB",
"last_name" : "Smith",
"street" : "888 - 3 ST SW, 10 FLOOR - WEST TOWER"
}
}
Status: 200 OK
Content-type: text/html; charset=utf-8
paypal
Status: 200 OK
Content-Type: application/json
{
"items" : [
{
"id" : "2706",
"name" : "10 g Sunshine Mint Gold Bar",
"price" : 454.56,
"tax" : {
"sum" : {}
},
"qty" : 1,
"bid_price" : 468.37
},
{
"qty" : 1,
"tax" : {
"sum" : {
"percent" : 5,
"amount" : "0.05"
},
"GST-AB" : {
"percent" : 5,
"amount" : "0.05"
}
},
"name" : "Coin Capsule | 1 oz Silver Coin 38 mm",
"id" : "2580",
"price" : 1.03,
"bid_price" : 2
}
],
"declaration" : "TEST",
"currency" : "USD",
"shipping" : {
"country" : "CA",
"region" : "AB",
"street" : "888 - 3 ST SW, 10 FLOOR - WEST TOWER",
"phone" : "+1 (403) 668 8648",
"last_name" : "Smith",
"email" : "sales@silvergoldbull.com",
"city" : "CALGARY",
"postcode" : "T2P 5C5",
"first_name" : "John"
},
"shipping_price" : 36.45,
"shipping_description" : "STORAGE 1 year, renewable",
"payment_method" : "paypal",
"shipping_method" : "1YR_STORAGE",
"grand_total" : 492.09,
"billing" : {
"street" : "888 - 3 ST SW, 10 FLOOR - WEST TOWER",
"region" : "AB",
"country" : "CA",
"city" : "CALGARY",
"email" : "sales@silvergoldbull.com",
"last_name" : "Smith",
"phone" : "+1 (403) 668 8648",
"postcode" : "T2P 5C5",
"first_name" : "John"
}
}
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 |
Content-type: text/json
POST https://api.silvergoldbull.com/v1/orders/create
{
"currency" : "USD",
"payment_method" : "paypal",
"declaration" : "TEST",
"billing" : {
"city" : "Calgary",
"country" : "CA",
"region" : "AB",
"last_name" : "Smith",
"street" : "888 - 3 ST SW, 10 FLOOR - WEST TOWER",
"email" : "sales@silvergoldbull.com",
"phone" : "+1 (403) 668 8648",
"first_name" : "John",
"postcode" : "T2P 5C5"
},
"items" : [
{
"bid_price" : 468.37,
"id" : "2706",
"qty" : 1
},
{
"qty" : 1,
"id" : "2580",
"bid_price" : 2
}
],
"shipping" : {
"postcode" : "T2P 5C5",
"first_name" : "John",
"phone" : "+1 (403) 668 8648",
"email" : "sales@silvergoldbull.com",
"last_name" : "Smith",
"street" : "888 - 3 ST SW, 10 FLOOR - WEST TOWER",
"region" : "AB",
"city" : "Calgary",
"country" : "CA"
},
"shipping_method" : "1YR_STORAGE"
}
Status: 200 OK
Content-type: text/html; charset=utf-8
paypal
Status: 201 Created
Content-Type: application/json
{
"billing" : {
"first_name" : "John",
"city" : "CALGARY",
"phone" : "+1 (403) 668 8648",
"last_name" : "Smith",
"street" : "888 - 3 ST SW, 10 FLOOR - WEST TOWER",
"region" : "AB",
"email" : "sales@silvergoldbull.com",
"country" : "CA",
"postcode" : "T2P 5C5"
},
"declaration" : "TEST",
"grand_total" : 492.09,
"shipping" : {
"last_name" : "Smith",
"city" : "CALGARY",
"phone" : "+1 (403) 668 8648",
"first_name" : "John",
"postcode" : "T2P 5C5",
"region" : "AB",
"country" : "CA",
"email" : "sales@silvergoldbull.com",
"street" : "888 - 3 ST SW, 10 FLOOR - WEST TOWER"
},
"shipping_description" : "STORAGE 1 year, renewable",
"created_at" : "2019-02-06 03:11:15",
"payment_method" : "paypal",
"items" : [
{
"qty" : 1,
"name" : "10 g Sunshine Mint Gold Bar",
"bid_price" : 468.37,
"tax" : {
"sum" : {}
},
"id" : "2706",
"price" : 454.56
},
{
"tax" : {
"GST-AB" : {
"percent" : 5,
"amount" : "0.05"
},
"sum" : {
"amount" : "0.05",
"percent" : 5
}
},
"name" : "Coin Capsule | 1 oz Silver Coin 38 mm",
"bid_price" : 2,
"qty" : 1,
"id" : "2580",
"price" : 1.03
}
],
"shipping_method" : "1YR_STORAGE",
"id" : 9999999999,
"currency" : "USD",
"shipping_price" : 36.45
}
Ihre Meinung ist uns wichtig!