A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
The use case is: Order is created on behalf of the customer in our ERP and then exported to Shopify. Since the payments cannot be created outside of Shopify:
@TPandita You have a few options here that depends on your situation.
Hope this helps!
@Ralph-HA Thank you so much for your reply.
I was just thinking of a scenario if we use the first approach: Say if the order was initially created without the payment in ERP. I created the order in Shopify for it. Now, say I create the payment for this order in ERP, would I be able to use the Order API to update the status of the order to Paid?
Is there a different API that I need to check to update this? Asking this because, in the Create Order API documentation, there is information that the financial status can only be set at the time of order creation.
@TPanditaThis is a typical workflow that we've seen from many merchants. You do have the option to update the payment information in the Shopify admin for the order.
If you want to use the API, you can use the `Update Order` endpoint to do this as well. Based on the documentation you should be able to update the `financial_status` but I haven't verified this. I would recommend you run a small test by creating an order using the Order API and then trying to update that orders financial_status using the `PUT` method on the Order API. Ideally, you'd want to add the transaction data as well so the purchase amount gets associated with the `Customer`. This will also ensure the customer data is updated with how much they've spent.
Here is the REST endpoint to update an order https://shopify.dev/api/admin-rest/2021-10/resources/order#put-orders-order-id
@Ralph-HA It does not allow me to update the financial status. Also, how to create payment transaction using API in Shopify. There needs to be an existing parent_ID, which I do not have (since I am creating payment outside Shopify), and without this the POST method does not create payment transaction.