Billing API Error!

Derek_Giles1
Shopify Partner
3 0 0

Hi all,

I'm trying to call my shops billing API to setup a test application charge, using this url (from a REST console):

https://APIKey:Password@MyStoreName.myshopify.com/admin/application_charges.json ;

{
  "application_charge": {
    "name": "My Application Name",
    "price": 100.0,
    "return_url": "return_url",
    "test": true
  }
}

But i'm getting the following error:

{
"errors": {
"base": ["It appears that this application is currently owned by a Shop. It must be migrated to the Shopify partners area before it can create charges with the API."]
}
}

I have migrated my app to the shopify partners area. Am I getting this error because I'm trying to charge the store I created the app on? Does the application have to be listed on the app store in order for it to be charged? Am I missing something?

Thanks in advance.

 

 

0 Likes
Ben_Cox
Shopify Staff
Shopify Staff
93 0 17

If the store you're trying to charge is a test, development, or demo store it won't work. In order for charges to process the store needs to be an active store with valid payment information - otherwise the charge will inevitably fail. 

0 Likes
Kevin_Hughes
Shopify Staff (Retired)
Shopify Staff (Retired)
130 0 18

The url you have in the post looks like it is for a private application not a partner application. There would be no reason to have an application charge on a private app as the error message is trying to indicate. You need to make sure you are making that request with partner app credentials - it will be OAuth so you will have an access token.

0 Likes
supDev
New Member
1 0 0

I'm trying to call my shops billing API to setup a test recurring application charge for a paid store using the following url:

POST request to "https://APIKey:Secret@MyStoreName.myshopify.com/admin/recurring_application_charges.json";

with the 'X-Shopify-Access-Token' header set.

Payload:

{
    "recurring_application_charge": {
        "test": "true",
        "trial_days": "14",
        "price": "10",
        "name": "super plan",
        "return_url": "http://localhost:8000/app";
    }
}

 

Respose Headers:

Server: nginx 

Date: Mon, 19 May 2014 11:24:56 GMT 

Content-Type: application/json; charset=utf-8 
Transfer-Encoding: chunked 
Status: 422 Unprocessable Entity
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-UA-Compatible: chrome=1
X-ShopId: <shop id>
X-ShardId: 2
X-Shopify-Asset-Version: <some value>
X-Shopify-Shop-Api-Call-Limit: 1/40
HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT: 1/40
X-Stats-UserId: 0
X-Stats-ApiClientId: <some id>
X-Stats-ApiPermissionId: <some id>
X-Stats-Validation-Errors: Name can't be blank,Price must be greater than zero
X-Frame-Options: SAMEORIGIN
X-Request-Id: <some id>
 

 

0 Likes
hj
Shopify Partner
202 0 26

Did you set the Request Content-Type to application/json?

HJ

0 Likes
Francesco8
Tourist
6 1 0

Hi, what was the problem? Do you remember?

 

Thanks,

Francesco

0 Likes