Is it possible to use a GraphQL mutation to capture payment for an order without specifying the full amount?
I am currently using Transaction - REST with params: kind: ‘capture’, authorization: ‘key’, source: ‘external’
this creates a capture transaction on the order, without specifying an amount. I am looking for a replacement for this.
The docs recommend using orderCapture - GraphQL Admin BUT the orderCapture mutation requires an amount so it’s not what I am asking for.
Does a GraphQL mutation to capture payment for an order without specifying the full amount exist? If not will it be added in the near future?
The Docs Assistant hallucinated a orderTransactionCreate mutation which is exactly what I need! Please let me know if this exists.
Hi @sengming
It doesn’t look like it’s possible to capture a payment for an order without specifying the full amount. The recommended approach is to use orderCapture, but as you found, the amount is required on the input. What would be the use case where you’re creating a payment for an order, but you don’t have the amount for this order?
I’ve also passed on the feedback regarding the dev assistant hallucinating the mutation that doesn’t exist.
Just to close the loop here as these are related threads.
I came up with a great solution here with the orderMarkAsPaid mutation:
Hey @sengming , I realized we overlooked a mutation that might actually simplify this whole process for you!
The markOrderAsPaid mutation works great for orders created with orderCreate. Here’s how it functions: you create your order with financialStatus: "PENDING" (no transactions needed), then use markOrderAsPaid which automatically calculates the full outstanding amount and creates proper SALE transactions. When you later cancel with refund: true, it correctly processes the refund and updates…
I just tried it out and it works! Thank you!