RecurringApplicationCharge returns 200 OK? Response is null

Solved

RecurringApplicationCharge returns 200 OK? Response is null

XB_
Shopify Partner
4 0 0

According to the docs here: https://shopify.dev/docs/api/admin-rest/2023-10/resources/recurringapplicationcharge I'm running this api request:

 

POST /admin/api/2023-10/recurring_application_charges.json HTTP/1.1
Host: XXXXXXX
X-Shopify-Access-Token: XXXXXXX
Content-Type: application/json
Cookie: request_method=POST
Content-Length: 135

{"recurring_application_charge":{"name":"Super Duper Plan","price":10.0,"return_url":"http://super-duper.shopifyapps.com","test":true}}

It results with 200 OK with this response:

 

{
    "recurring_application_charges": []
}

 

But it should return 201 with the created recurring_application_charge?

 

Accepted Solution (1)
lizk
Shopify Staff
246 58 79

This is an accepted solution.

Hi there 👋

The billing API can only be used on Public Apps. If you have a custom app unfortunately you will not be able to use the Billing API.

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 7 (7)

lizk
Shopify Staff
246 58 79

This result would make it seem that you are actually doing a GET request to that endpoint instead of a POST request.

If possible would you be able to share your code you are using to make this request? 

To learn more visit the Shopify Help Center or the Community Blog.

XB_
Shopify Partner
4 0 0

Currently just using Postman

xenbit_0-1698762591094.png

 

lizk
Shopify Staff
246 58 79

In the bottom left hand corner of Postman you should see console. Open that up and you should be able to see what requests Postman is actually making.

I tried to reproduce the functionality you are seeing in Postman and I am unable to.

To learn more visit the Shopify Help Center or the Community Blog.

XB_
Shopify Partner
4 0 0

The log shows that Postman is performing the POST request as shown. But Shopify is returning 301 to the GET endpoint.

lizk
Shopify Staff
246 58 79

You are making the API call to the custom domain, correct?  Are you seeing this functionality when you make the API call directly to the myshopify domain? 

To learn more visit the Shopify Help Center or the Community Blog.

XB_
Shopify Partner
4 0 0

This returns

 

{"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."]}}

 

That would probably be much too complicated to go the way via an external app now. Too bad...

 

lizk
Shopify Staff
246 58 79

This is an accepted solution.

Hi there 👋

The billing API can only be used on Public Apps. If you have a custom app unfortunately you will not be able to use the Billing API.

To learn more visit the Shopify Help Center or the Community Blog.