Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hi,
I would like to mark an order as PAID through REST API - is it possible or it is prohibited by Shopify?
I have found a few topics about this but they seem a bit old and do not work.
So what did I try:
any tip what I'm doing wrong? I did invest quite a lot of time into it and do not want to switch to WooComerce.. 😞 (which seems the only solution for now)
Thx,
R.
Hi Roman,
Are you using a custom payment method? Pretty sure you don't need a custom app or a REST call for this. Try the following in SETTINGS > PAYMENT PROVIDERS:
Regards,
Sam
Hi,
we do have the manual payment method because the payment is provided to our bank account - then we use an Integromat to catch a new payment and we would like to mark the given order as paid.
So the automated payment method is mentioned for credit card payment or I can use it also for payment to the bank account?
Thx,
R
This is exactly my problem at the moment.
I havent found a way to mark an order with a manual payment method as paid through the api.
Has anyone tried to first create the order then POST a transaction?
POST /admin/api/2020-01/orders/#{order_id}/transactions.json { "transaction": { "kind": "capture", "authorization": "authorization-key" } }
Hi,
well yes, but I do have 2 issues - where to take authorization-key if I omit it either get invalid request error or link to "login" page as a response.
like described here: https://community.shopify.com/c/Shopify-APIs-SDKs/Marking-order-transaction-as-paid-with-REST-Admin-...
it seems that go for the shopify was a big mistake 😞 and due to their intelligent monetizing scenario, they do block this option by purpose - with no alternative how to handle payments to bank account automatically - they live in a world where credit cards are used only I guess (but maybe I'm wrong - or I hope I'm wrong).
R.
I tried two different payloads for the transaction
{'amount': '123.21', 'currency': 'EUR', 'gateway': u'Vorkasse', 'kind': 'capture', 'parent_id': '123456789', 'status': 'success'} {'amount': '123.21', 'currency': 'EUR', 'gateway': u'Vorkasse', 'kind': 'sale', 'status': 'success'}
Both result in
Parent transaction specified cannot be marked as paid
I already mailed the support regarding this and will keep you updated
@achieveapplabs
It seems like your solution works I was only sending to much information.
@Roman81 are you sending the json directly to the shopify API or are you using some API wrapper like https://github.com/Shopify/shopify_python_api ?
Hi,
I did use the Integromat and also tried with Postman - created my custom private app credentials - all with the same result - either 406 or 400 or 404 or "continue" login page.
Also, I do not know how to get parent id - for order created directly from Shopify, there is no such thing. If I try to get all transactions for order again "continue" login page result.
R.
Roman,
Make sure you're sending your private app key and secret along with the request. If you subscribe to the orders webhook the ID will be in the request body when an order is created. I also believe Checkout API can be used to capture the new order, but I would stick with webhooks.
Hi,
so I have tried to get all transactions for the given order - I used the private app
you can see that the private app should have rights for the transactions:
the request result isn't list of transactions but an HTML page with "identity" login page with "continue button"
Any ideas? From my point of view, it is a bug or intention.
Am I wrong?
Thx,
R.
Hi @Roman81,
You did everything correctly just remove the hashtag # in your URL after /orders/#
/orders/#12312312
Regards,
-Sam
Hi @Anonymous (Sam),
thx so far it seems I'm moving somewhere - finally I'm able to get transactions (the '#' in URL was the issue) but I'm not able to create one with payment.
I do get this:
and this is what I'm trying to post but again "identity continue"...
Any idea what I do wrong this time?
Thx,
R.
Hi @Roman81,
I'm sure your permissions are correct. From testing it seems that if the URL is incorrect or the POST body is incorrect you will get this identity HTML response. I strongly believe the issue is within the POST body. Try this:
{ "transaction": { "kind": "sale", "source": "external",
"parent_id": yourIDhere } }
All the best,
Sam
Hi @Anonymous (Sam :)),
I have given a try and no success 😞 any tip on how to investigate where the issue, is?
Thx,
R.
Hi,
so finally I'm able to make an order as paid - sorry for my comments to Shopify - anyway I'm not able to do so thru rest api call - post man - but I'm able to do so thru integromat integrations - strange is that I'm doing the same api call..
So thx all and have a nice day,
R.
Hey @Roman81 this thread is already really old but I'm giving it a shot. I am trying to do the same thing with make (formerly integromat). The only solution I found is capturing a transaction but then I actually record a payment in shopify which I don't want to do. How did you do it through integromat?
Tnx
Have you found a way to do it in Make? Thank you!
The solution for me was (source: external)
Also Roman,
Wondering if creating a custom payment method and then setting the financial_status = "paid" would do the trick?
-Sam
Nope, as my point 1. this you can do just for the new order, not for the existing one