HTTP 400 when inserting new subscription for Google Apps Marketplace application -


i'm trying insert new subscription change seatcount license. i'm using v2 licensing api , here code :

appsmarketservice service = new appsmarketservice(); service.appid = "appid"; service.appname = "somedomain"; service.endpoint = "https://www.googleapis.com/appsmarket/v2/"; service.consumerkey = service.appid + ".apps.googleusercontent.com"; service.consumersecret = "somethingsecret"; service.authorize();  customerlicense cl = service.getcustomerlicense("company.com", true);  subscription sub = new subscription(); sub.subscriptionid = "subid"; sub.applicationid = service.appid; sub.name = "full"; sub.description = "full service"; sub.currencycode = "usd"; sub.customerid = cl.customerid; sub.initialcart = new initialcart(); sub.initialcart.cart = new cart(); sub.initialcart.cart.receiptname = "receipt name"; sub.initialcart.cart.receiptdescription = "receipt description";  lineitem item = new lineitem(); item.name = "my subscription"; item.description = "subscription billing app"; item.editionid = "default_edition"; item.seatcount = 100;  item.price = 100l;  sub.initialcart.cart.items = new arraylist<lineitem>(); sub.initialcart.cart.items.add(item);  subscription response = service.insertsubscription(sub); 

it similar example provided here except didn't set purchase token because don't have it. no 1 has made purchase yet. i've debbuged insertsubscription call down httprequest.execute() , response :

-------------- response -------------- 400 x-frame-options: sameorigin date: thu, 02 may 2013 18:44:07 gmt content-length: 139 x-xss-protection: 1; mode=block expires: thu, 02 may 2013 18:44:07 gmt content-encoding: gzip content-type: application/json; charset=utf-8 server: gse x-content-type-options: nosniff cache-control: private, max-age=0  02.05.2013. 20.44.07 com.google.apphosting.utils.jetty.jettylogger warn warning: /licensing: com.google.api.client.http.httpresponseexception: 400 

so there's no error message saying went wrong. clues?

p.s. showing how update default edition of license helpful.


Comments

Popular posts from this blog

Eclipse formatter for java ending braces -

ruby - Nesting modules inside of a Rails eninge gem -

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -