user691: I'm creating a web app that uses Bitpay for payments. I'm writing it in ruby (but that shouldn't matter), and have a class method bitpay_client with the body BitPay::Client.new('mYs3cretAPIkey'). 
Anytime I do BitcoinInvoice.bitpay_client.get("invoice/#{invoice_id}") I get the JSON {"error": "Invalid token"} back from the server. In Bitpay's documentation there's no mention of this message. I'm using the right api key, and I'm sure this is a real invoice. What does this message mean? 

user691: The error was my client connected to the wrong endpoint. This feature was undocumented at the time, but is now clearly documented. Kudos to Bitpay! 

691: <p>I'm creating a web app that uses Bitpay for payments. I'm writing it in ruby (but that shouldn't matter), and have a class method <code>bitpay_client</code> with the body <code>BitPay::Client.new('mYs3cretAPIkey')</code>. </p>

<p>Anytime I do <code>BitcoinInvoice.bitpay_client.get("invoice/#{invoice_id}")</code> I get the JSON <code>{"error": "Invalid token"}</code> back from the server. In <a href="https://bitpay.com/downloads/bitpayApi.pdf" rel="nofollow">Bitpay's documentation</a> there's no mention of this message. I'm using the right api key, and I'm sure this is a real invoice. What does this message mean? </p>
 691: <p>The error was my client connected to the wrong endpoint. This feature was undocumented at the time, but is now <a href="https://github.com/bitpay/ruby-client#testnet-usage" rel="nofollow">clearly documented</a>. Kudos to Bitpay! </p>
