Discussing APIs and development related to customers, discounts, and order management.
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?
Solved! Go to the solution
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.
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.
Currently just using Postman
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.
The log shows that Postman is performing the POST request as shown. But Shopify is returning 301 to the GET endpoint.
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.
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...
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.