Bid/Ask API Documentation

This documentation describes REST calls to post bids and asks.

Endpoint is at https://www.cdnexchange.com/api/BidAsk/

Headers

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.

X-API-KEY [Required]
String
Yes
Provided API key
X-API-TOKEN [Required]
String
Yes
Provided API token
X-DEBUG
String
No
true or false. If true returns all items with additional information in response under debug property.
Request

Request body to be posted as JSON format with an array of one or more entry objects.

Notes:

  1. Either pcgs_number or cdn_entry_id are required.
  2. Either amount or these four properties: spot_based, spot_plus_minus, spot_dollar_percent, and spot_offset, are required.

pcgs_number [Required1]
String
Yes1
PCGS number
cdn_entry_id [Required1]
String
Yes1
CDN Entry ID
grade [Required]
String
Yes
Grade (may include plus sign)
service [Required]
String
Yes
Service ('PCGS', 'NGC', or 'Any')
cac
String
No
true or false. If true entry is for CAC stickered coins. Defaults to false.
sight_code [Required]
String
Yes
Sight Code ('SS' for sight-seen or 'SU' for sight-unseen)
bid_or_ask [Required]
String
Yes
Entry Type ('Bid' or 'Ask')
quantity
Number
No
Quantity of items wanted or have. Defaults to 1.
amount [Required2]
Number
Yes2
Amount of the bid or ask per item.
retail_amount
Number
No2
Retail amount of the ask per item. Not applicable to bids.
spot_based [Required2]
String
Yes2
true or false. If true amount will be calculated off of spot pricing. Defaults to false.
spot_plus_minus [Required2]
String
Yes2
Add or subtract from spot price ('Plus' or 'Minus')
spot_dollar_percent [Required2]
String
Yes2
Offset represents dollars or a percentage ('Dollar' or 'Percent')
spot_offset [Required2]
Number
Yes2
Offset value (either in dollars or as a percentage. Thirty dollars would be '30' – four percent would be '4')
details
String
No
true or false. If true entry has details. Defaults to false. Not applicable to bids.
error
String
No
true or false. If true entry is error. Defaults to false. Not applicable to bids.
paper_quality
String
No
If currency, the paper quality. Not applicable to bids.
is_auction
String
No
true or false. If true entry is from an auction. Defaults to false. Not applicable to bids.
auction_ends
String
No
Date the auction ends. Not applicable to bids.
auction_sold_for
Number
No
If past auction and sold, the amount the item sold for. Not applicable to bids.
url
String
No
Web page address for this item. Not applicable to bids.
description
String
No
Override of catalog entry description. Not applicable to bids.
days_to_expire
Number
No
Number of days after which bid or ask should expire. Defaults to user's personal preference (if set) or the system default which is 30.
id
String
No
Identifier for this entry to be returned in case of an error. If not specified and an error occurs will return id as index of entry object.
delete
String
No
true or false. If true matching entry (based on pcgs_number/cdn_entry_id + grade + service + cac) will be deleted.
images
Array
No
Array of image paths for ask.
Response

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"
		}
	]
}
							

Fatal Errors

List of fatal errors.

400
Bad Request - No body payload found
401
Unauthorized - Missing API Key
401
Unauthorized - Missing API Token
401
Unauthorized - Invalid API Key
401
Unauthorized - Invalid API Token
Entry 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.

901
Missing Bid/Ask Indicator (bid_or_ask)
902
Invalid Bid/Ask Indicator (must be 'Bid' or 'Ask'
903
Missing Sight Code (sight_code)
904
Invalid Sight Code (must be 'SS' or 'SU')
905
Missing Service (service)
906
Invalid Service (must be 'PCGS', 'NGC' or 'Any')
907
Invalid CAC Indicator (must be 'true' or 'false')
908
Invalid Quantity (must be between 1 and 99)
909
Invalid Days To Expire (must be between 7 and 90)
910
Invalid Spot Based Indicator (must be 'true' or 'false')
911
Amount (amount) should not be provided for spot-based entries
912
Missing Spot Plus Minus (spot_plus_minus)
913
Invalid Spot Plus Minus (must be 'Plus' or 'Minus')
914
Missing Spot Dollar Percent (spot_dollar_percent)
915
Invalid Spot Dollar Percent (must be 'Dollar' or 'Percent')
916
Missing Spot Offset (spot_offset)
917
Invalid Spot Offset (must be between .01 and 9999)
918
Missing Amount (amount)
919
Invalid Amount (must be between $1 and $9,999,999)
920
Missing PCGS Number or CDN Entry ID (pcgs_number or cdn_entry_id)
921
Missing Grade (grade)
922
Invalid CDN Entry ID
923
Invalid PCGS Number
924
Invalid Grade (must be one of these: Comma separated list of valid grades
925
Spot pricing not currently available
926
Spot based bidding not enabled for this item
927
Derived price must be greater than 95% of melt value
928
Cannot find that item to delete
929
Images only valid for asks
930
Not an image path
931
Retail amount cannot be less than wholesale amount
932
Invalid Details Indicator (must be 'true' or 'false')
933
Invalid Error Indicator (must be 'true' or 'false')
934
Invalid 'Is Auction' Indicator (must be 'true' or 'false')
935
'Is Auction' not valid for bids
936
Invalid auction end date
999
Error: Message regarding failure of business logic validation

Example

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.

Request
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"
	}
}
					

Get Bid/Ask API Documentation

This documentation describes REST calls to get bid and ask data.

Endpoint is at https://www.cdnexchange.com/api/GetBidAsk/

Headers

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.

X-API-KEY [Required]
String
Yes
Provided API key
X-API-TOKEN [Required]
String
Yes
Provided API token
Request

Request body to be sent as JSON format with an array of one or more entry objects.

Notes:

  1. Either pcgs_number or cdn_entry_id are required.

pcgs_number [Required1]
String
Yes1
PCGS number
cdn_entry_id [Required1]
String
Yes1
CDN Entry ID
grade [Required]
String
Yes
Grade (may include plus sign)
Response

Response returned in JSON format with any entry errors returned under the errors property. Note that only PCGS/Grade combinations with bids or asks will be returned. For each PCGS/Grade returned bids will only appear if there are bids. The same goes for asks.

Successful Response

{
   "code": 200,
   "message": "OK",
   "status": {
	   "entries": Number of entries in request,
	   "bids": Number of bids returned,
	   "asks": Number of asks returned
   },
   "entries": [
   	   {
			"pcgs_number": "PCGS Number",
			"cdn_entry_id": CDN Entry ID,
			"grade": "Grade",
			"bids": [
				{
					"username": "User name bid posted by",
					"company": "Company name bid posted by",
					"service": "Service ('PCGS', 'NGC', or 'Any')",
					"cac": true or false. If true, bid is for CAC stickered coins.,
					"sight_code": "Sight Code ('SS' for sight-seen or 'SU' for sight-unseen)",
					"amount": Bid Amount,
					"quantity": Bid Quantity
				}
			],
			"asks": [
				{
					"username": "User name ask posted by",
					"company": "Company name ask posted by",
					"service": "Service ('PCGS', 'NGC', or 'Any')",
					"cac": true or false. If true, ask is for CAC stickered coins.,
					"sight_code": "Sight Code ('SS' for sight-seen or 'SU' for sight-unseen)",
					"amount": Ask Amount,
					"retail_amount": Ask Retail Amount,
					"quantity": Ask Quantity,
					"details": true or false. If true, ask is for an item with details.,
					"error": true or false. If true, ask is for an error item.,
          "paper_quality": If currency, the paper quality.,
          "is_auction": true or false. If true entry is from an auction.,
          "auction_ends": Date the auction ends.,
          "auction_sold_for": If past auction and sold, the amount the item sold for.,
          "url": Web page address for this item.
				}
			]
	   }
	]
}
						   

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,
	   "bids": Number of bids returned,
	   "asks": Number of asks returned,
	   "errors": Number of entries resulting in errors
   },
   "errors": [
	   {
		   "id": "Index of entry with error",
		   "code": Error Code,
		   "message": "Error Message"
	   }
   ]
}
						   

Fatal Errors

List of fatal errors.

400
Bad Request - No body payload found
401
Unauthorized - Missing API Key
401
Unauthorized - Missing API Token
401
Unauthorized - Invalid API Key
401
Unauthorized - Invalid API Token
Entry 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.

920
Missing PCGS Number or CDN Entry ID (pcgs_number or cdn_entry_id)
921
Missing Grade (grade)
922
Invalid CDN Entry ID
923
Invalid PCGS Number
924
Invalid Grade (must be one of these: Comma separated list of valid grades

Example

Example request and response showing the request for bid and ask data for two entries.

Note that JSON has been prettified.

Request
POST /api/GetBidAsk/ 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"
	},
	{
		"pcgs_number": "9800",
		"grade": "66"
	}
]
				   
Response
{
	"code": 200,
	"message": "OK",
	"status": {
		"entries": 2,
		"bids": 3,
		"asks": 1
	},
	"entries": [
		{
			"pcgs_number": "9800",
			"grade": "65",
			"bids": [
				{
					"username": "ABC",
					"company": "ABC Coins, LLC",
					"service": "PCGS",
					"cac": true,
					"sight_code": "SU",
					"amount": 250,
					"quantity": 5
				},
				{
					"username": "DEF",
					"company": "DEF Numismatics, Inc",
					"service": "PCGS",
					"cac": true,
					"sight_code": "SU",
					"amount": 275,
					"quantity": 10
				}
			],
			"asks": [
				{
					"username": "XYZ",
					"company": "XYZ Collectors, Ltd",
					"service": "NGC",
					"cac": false,
					"sight_code": "SS",
					"amount": 285,
					"retail_amount": 350,
					"quantity": 1,
					"details": true,
					"error": false,
          "paper_quality": "",
          "is_auction": false,
          "auction_ends": "",
          "auction_sold_for": "",
          "url": ""
				}
			]
		},
		{
			"pcgs_number": "9800",
			"grade": "66",
			"bids": [
				{
					"username": "ABC",
					"company": "ABC Coins, LLC",
					"service": "PCGS",
					"cac": true,
					"sight_code": "SU",
					"amount": 300,
					"quantity": 10
				}
			],
			"asks": [
			]
		}
	]
}
				   

Get My Bid/Ask API Documentation

This documentation describes REST calls to get all of your bid and ask data.

Endpoint is at https://www.cdnexchange.com/api/GetMyBidAsk/

Headers

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 returned for.

X-API-KEY [Required]
String
Yes
Provided API key
X-API-TOKEN [Required]
String
Yes
Provided API token
Request

Request body to be sent empty. Anything in body will be ignored.

Response

Response returned in JSON format with all bids and asks in PCGS number and grade order.

Successful Response

{
"code": 200,
"message": "OK",
"status": {
   "bids": Number of bids returned,
   "asks": Number of asks returned
},
"entries": [
	  {
		"pcgs_number": "PCGS Number",
		"cdn_entry_id": CDN Entry ID,
		"grade": "Grade",
		"service": "Service ('PCGS', 'NGC', or 'Any')",
		"cac": true or false. If true, entry is for CAC stickered coins.,
		"sight_code": "Sight Code ('SS' for sight-seen or 'SU' for sight-unseen)",
		"bid_or_ask": "Entry Type ('Bid' or 'Ask')",
		"quantity": Quantity,
		"amount": Amount,
		"days_to_expire": Number of days after which entry will expire.,
		"retail_amount": Retail Amount. Only applicable for asks.,
		"details": true or false. If true, entry is has details. Only applicable for asks.,
		"error": true or false. If true, entry is an error. Only applicable for asks.,
    "paper_quality": If currency, the paper quality. Only applicable for asks.,
    "is_auction": true or false. If true entry is from an auction. Only applicable for asks.,
    "auction_ends": Date the auction ends. Only applicable for asks.,
    "auction_sold_for": If past auction and sold, the amount the item sold for. Only applicable for asks.,
    "url": Web page address for this item. Only applicable for asks.
	  },
	  {
		"pcgs_number": "PCGS Number",
		"cdn_entry_id": CDN Entry ID,
		"grade": "Grade",
		"service": "Service ('PCGS', 'NGC', or 'Any')",
		"cac": true or false. If true, entry is for CAC stickered coins.,
		"sight_code": "Sight Code ('SS' for sight-seen or 'SU' for sight-unseen)",
		"bid_or_ask": "Entry Type ('Bid' or 'Ask')",
		"quantity": Quantity,
		"spot_based": true or false. If true amount will be calculated off of spot pricing.,
		"spot_plus_minus": "Add or subtract from spot price ('Plus' or 'Minus')",
		"spot_dollar_percent": "Offset represents dollars or a percentage ('Dollar' or 'Percent')",
		"spot_offset": Offset value (either in dollars or as a percentage.,
		"days_to_expire": Number of days after which entry will expire.,
		"retail_amount": Retail Amount. Only applicable for asks.,
		"details": true or false. If true, entry is has details. Only applicable for asks.,
		"error": true or false. If true, entry is an error. Only applicable for asks.,
    "paper_quality": If currency, the paper quality. Only applicable for asks.,
    "is_auction": true or false. If true entry is from an auction. Only applicable for asks.,
    "auction_ends": Date the auction ends. Only applicable for asks.,
    "auction_sold_for": If past auction and sold, the amount the item sold for. Only applicable for asks.,
    "url": Web page address for this item. Only applicable for asks.
	  }
]
}
					   

Fatal Response

{
"code": Error Code,
"message": "Error Message"
}
					   

Fatal Errors

List of fatal errors.

400
Bad Request - No body payload found
401
Unauthorized - Missing API Key
401
Unauthorized - Missing API Token
401
Unauthorized - Invalid API Key
401
Unauthorized - Invalid API Token

Example

Example request and response showing the request for your bid and ask data.

Note that JSON has been prettified.

Request
GET /api/GetMyBidAsk/ 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: 2

[]
			   
Response
{
	"code": 200,
	"message": "OK",
	"status": {
	  "bids": 3,
	  "asks": 2
	},
	"entries": [
	  {
		"pcgs_number": "8981",
		"cdn_entry_id": "73520",
		"grade": "65",
		"service": "Any",
		"cac": true,
		"sight_code": "SS",
		"bid_or_ask": "Bid",
		"quantity": "1",
		"amount": 2500,
		"days_to_expire": 27
	  },
	  {
		"pcgs_number": "8981",
		"cdn_entry_id": "73520",
		"grade": "65",
		"service": "Any",
		"cac": true,
		"sight_code": "SS",
		"bid_or_ask": "Ask",
		"quantity": "1",
		"amount": "4000",
		"days_to_expire": 28,
		"retail_amount": "5000",
    "paper_quality": "",
    "is_auction": false,
    "auction_ends": "",
    "auction_sold_for": "",
    "url": "",
		"details": true,
		"error": false
	  },
	  {
		"pcgs_number": "8981",
		"cdn_entry_id": "73520",
		"grade": "67",
		"service": "Any",
		"cac": true,
		"sight_code": "SS",
		"bid_or_ask": "Bid",
		"quantity": "1",
		"spot_based": true,
		"spot_plus_minus": "Plus",
		"spot_dollar_percent": "Percent",
		"spot_offset": "20",
		"days_to_expire": 29
	  },
	  {
		"pcgs_number": "8981",
		"cdn_entry_id": "73520",
		"grade": "67",
		"service": "Any",
		"cac": false,
		"sight_code": "SS",
		"bid_or_ask": "Bid",
		"quantity": "1",
		"spot_based": true,
		"spot_plus_minus": "Plus",
		"spot_dollar_percent": "Dollar",
		"spot_offset": "200",
		"days_to_expire": 29
	  },
	  {
		"pcgs_number": "8981",
		"cdn_entry_id": "73520",
		"grade": "67",
		"service": "Any",
		"cac": true,
		"sight_code": "SS",
		"bid_or_ask": "Ask",
		"quantity": "1",
		"amount": "5000",
		"days_to_expire": 29,
		"retail_amount": "5500",
    "paper_quality": "",
    "is_auction": false,
    "auction_ends": "",
    "auction_sold_for": "",
    "url": "",
		"details": false,
		"error": false
	  }
	]
  }
			   

Delete My Asks API Documentation

This documentation describes REST calls to delete all of your ask data.

Endpoint is at https://www.cdnexchange.com/api/DeleteMyAsks/

Headers

All requests must have the following required headers. The API key and token passed will match to entries that refer to a specific user for whose asks are deleted.

X-API-KEY [Required]
String
Yes
Provided API key
X-API-TOKEN [Required]
String
Yes
Provided API token
Request

Request body to be sent empty. Anything in body will be ignored.

Response

Response returned in JSON format with details of the deletes.

Successful Response

{
"code": 200,
"message": "OK",
"status": {
"asks": Number of asks deleted
}
				   

Fatal Response

{
"code": Error Code,
"message": "Error Message"
}
				   

Fatal Errors

List of fatal errors.

400
Bad Request - No body payload found
401
Unauthorized - Missing API Key
401
Unauthorized - Missing API Token
401
Unauthorized - Invalid API Key
401
Unauthorized - Invalid API Token

Example

Example request and response showing the request to delete ask data.

Note that JSON has been prettified.

Request
POST /api/DeleteMyAsks/ 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: 2

[]
		   
Response
{
	"code": 200,
	"message": "OK",
	"status": {
	  "asks": 2
	}
}
		   

Delete My Bids API Documentation

This documentation describes REST calls to delete all of your bid data.

Endpoint is at https://www.cdnexchange.com/api/DeleteMyBids/

Headers

All requests must have the following required headers. The API key and token passed will match to entries that refer to a specific user for whose bids are deleted.

X-API-KEY [Required]
String
Yes
Provided API key
X-API-TOKEN [Required]
String
Yes
Provided API token
Request

Request body to be sent empty. Anything in body will be ignored.

Response

Response returned in JSON format with details of the deletes.

Successful Response

{
"code": 200,
"message": "OK",
"status": {
"bids": Number of bids deleted
}
				   

Fatal Response

{
"code": Error Code,
"message": "Error Message"
}
				   

Fatal Errors

List of fatal errors.

400
Bad Request - No body payload found
401
Unauthorized - Missing API Key
401
Unauthorized - Missing API Token
401
Unauthorized - Invalid API Key
401
Unauthorized - Invalid API Token

Example

Example request and response showing the request to delete ask data.

Note that JSON has been prettified.

Request
POST /api/DeleteMyBids/ 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: 2

[]
		   
Response
{
	"code": 200,
	"message": "OK",
	"status": {
	  "bids": 2
	}
}