Hi,
I am currently trying to use the Recurring Application Charges API.
I am following the guide. I managed to create a charge and to be redirected to the merchant page where he has to accept or deny the charge.
Once I accept the charge, the return_route is called with the charge_id passed to this route. Thing is, I can't do anything with this id.
When I call the
https://{current_user.shopify_shop}/admin/recurring_application_charges/{application_charge_id}/activate.json
endpoint to have information about this particular charge_id all I get is this response:
{'errors': 'Not Found'}
Has anyone an idea about what's going on? By reading the forum I found some people talking about using the same session to do both requests but that does not fix it.
Thanks in advance.
Solved! Go to the solution
This is an accepted solution.
Hey Kevin,
I can't presently replicate this issue, My flow is as follows using shopify_python_api:
1. Instantiate session
2. Activate session
3. Instantiate RecurringApplicationCharge object, assign attributes
4. Save charge object, redirect to confirmation_url
5. After charge is activated, I get the charge object by the ID (either when I save it for later from the creation response or I take the charge_id query parameter on the return_url)
6. Activate the charge
No 404s throughout the above, so unsure what might be going wrong for you. I was using ShopifyAPI version 4.0.0 and Python 2.7.10. Pseudocode:
import shopify token = "whatever your access token is" session = shopify.Session("your-shop.myshopify.com", token) shopify.ShopifyResource.activate_session(session) rac = shopify.RecurringApplicationCharge() rac.name = "Test charge" rac.price = 10.00 rac.return_url = "https://domain.com/activate_charge" rac.capped_amount = 100.00 rac.terms = "Foobarbaz" if rac.save(): print rac.attributes # After confirmation... rac = shopify.RecurringApplicationCharge.find(3925606422) rac.activate() print rac.attributes
Cheers.
User | Count |
---|---|
12 | |
11 | |
10 | |
8 | |
5 |