This documentation describes REST calls to post bids and asks.
Endpoint is at https://www.cdnexchange.com/api/BidAsk/
All requests must have the following required headers. The API key and token passed will match to entries that refer to a specific user that the entries are to be posted under.
String
String
String
true
or false
. If true
returns all items with additional information in response under debug
property.Request body to be posted as JSON format with an array of one or more entry objects.
Notes:
- Either
pcgs_number
orcdn_entry_id
are required. - Either
amount
or these four properties:spot_based
,spot_plus_minus
,spot_dollar_percent
, andspot_offset
, are required.
String
String
String
String
String
true
or false
. If true
entry is for CAC stickered coins. Defaults to false
.String
String
Number
Number
Number
String
true
or false
. If true
amount will be calculated off of spot pricing. Defaults to false
.String
String
Number
String
true
or false
. If true
entry has details. Defaults to false
. Not applicable to bids.String
true
or false
. If true
entry is error. Defaults to false
. Not applicable to bids.String
String
true
or false
. If true
entry is from an auction. Defaults to false
. Not applicable to bids.String
Number
String
String
Number
String
id
as index of entry object.String
true
or false
. If true
matching entry (based on pcgs_number/cdn_entry_id + grade + service + cac) will be deleted.Array
Response returned in JSON format with any entry errors returned under the errors
property.
Successful Response
{ "code": 200, "message": "OK", "status": { "entries": Number of entries in request, "updates": Number of entries resulting in updates, "inserts": Number of entries resulting in inserts, "deletes": Number of entries resulting in deletes }, "user": { "username": "User name entries posted to", "company": "Company name entries posted to" } }
Fatal Response
{ "code": Error Code, "message": "Error Message" }
Error Response
{ "code": 406, "message": "Not Acceptable - Number of errors encountered", "status": { "entries": Number of entries in request, "updates": Number of entries resulting in updates, "inserts": Number of entries resulting in inserts, "deletes": Number of entries resulting in deletes, "errors": Number of entries resulting in errors }, "user": { "username": "User name entries posted to", "company": "Company name entries posted to" }, "errors": [ { "id": "Identifier (or index) of entry with error", "code": Error Code, "message": "Error Message" } ] }
List of fatal errors.
When response has a code of 406, one or more entries have an error. This is the list of entry errors returned under the errors
property.
Example request and response showing the posting of two bids for 1986-Present Silver Eagle $1 [Type] entries in 65 with a service of PCGS, sight-unseen.
The first is for non-CAC at 15% over spot and the second is for CAC at 20% over spot.
Note that JSON has been prettified.
POST /api/BidAsk/ HTTP/1.1 X-API-KEY: ea115a12-5fec-11ea-ba1b-42010a8e0003 X-API-TOKEN: 0062a30c-5fed-11ea-ba1b-42010a8e0003 Content-Type: application/json; charset=utf-8 Cookie: PHPSESSID=erfvud5vd9ltmuejc3lfuavjj1 Host: www.cdnexchange.com Connection: close User-Agent: Paw/3.1.10 (Macintosh; OS X/10.14.6) GCDHTTPRequest Content-Length: 418 [ { "pcgs_number": "9800", "grade": "65", "service": "PCGS", "sight_code": "SU", "bid_or_ask": "Bid", "quantity": "10", "spot_based": "true", "spot_plus_minus": "Plus", "spot_dollar_percent": "Percent", "spot_offset": "15" }, { "pcgs_number": "9800", "grade": "65", "service": "PCGS", "cac": "true" "sight_code": "SU", "bid_or_ask": "Bid", "quantity": "10", "spot_based": "true", "spot_plus_minus": "Plus", "spot_dollar_percent": "Percent", "spot_offset": "20" }, { "pcgs_number": "10214", "grade": "61", "service": "NGC", "cac": "false" "sight_code": "SU", "bid_or_ask": "Ask", "quantity": "1", "amount": "105000", "images": [ "https://www.imagesrus.com/image1.png", "https://www.imagesrus.com/image2.png", "https://www.imagesrus.com/image3.png" ] } ]Response
{ "code": 200, "message": "OK", "status": { "entries": 3, "updates": 2, "inserts": 1, "deletes": 0 }, "user": { "username": "EXMP", "company": "Example Company" } }