GoDaddy’s “Micro Dollars”

I’m working on a GoDaddy plugin at the moment, to allow the wp-admin user to purchase domains through the GoDaddy API. ┬áThis is a crucial step in a larger project to allow non-technical clients to manage their own launch process. Turns out, GoDaddy’s API is weird.

Here’s a sample response from their `/domains/available` endpoint:

	"available"  : true,
	"domain"     : "",
	"definitive" : false,
	"price"      : 7490000,
	"currency"   : "USD",
	"period"     : 1

Notice anything strange about that? How about the fact that my domain as a .net would cost 7 million in US dollars? A closer look at their API docs reveal that these are not actual US dollars, rather they are a “micro-currency”:

price (integer, currency-micro-unit, optional): Price of the domain excluding taxes or fees. Only returned if tld is offered

I had no idea what I was supposed to do with this (and was hoping that GoDaddy had colonized their own micro-nation currency) so I asked their support staff, who explained that a micro-dollar is something like one one-millionth of an actual dollar. In their words:

Dear Scott,

Thank you for contacting us. You would need to convert the value to 2 decimal places so that 7490000 becomes 7.49.

Please contact us if you need further assistance.

Not exactly a stellar feeling of confidence when lining up API calls to withdraw from someone’s bank account, but this isn’t even among the top ten most annoying things about GoDaddy, so onward.