Search code examples
curlgoogle-checkout

Cannot Access Google Checkout API with curl


I'm trying to get some reports from google checkout. Following: http://checkout.google.com/support/sell/bin/answer.py?hl=en&answer=70646
and http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Order_Report_API.html

Using command:

curl -k  --user "xyz:123" \
  https://checkout.google.com/api/checkout/v2/reports/Merchant/111111 \
  -d "$( cat req.xml)"

Gives error:

<?xml version="1.0" encoding="UTF-8"?>
<error xmlns="http://checkout.google.com/schema/2"
       serial-number="22321312-9ce8-asdasd-asda-2754106e0195">
  <error-message>Bad username and/or password for API Access.</error-message>
</error>
  1. Note, the -k is because curl was complaining about uncertified ssl.
  2. Yes, I have the correct username and password.
  3. Yes, I have tried with the @gmail to the username
  4. Yes, I have tried the https://uname:pass@checkout.google.com syntax

Solution

  • Ok, I solved this one....

    I was using my google uname/password when instead I had to use my MerchantID as uname and MerchantKey as password....