How to get Order ID using the Payment ID?

How to get Order ID using the Payment ID?

Anilket26
Shopify Partner
14 0 0

Shopify payment session API gives the Payment ID. How I will get the Order ID using this Payment ID?
How I will update payment detail for order on Shopify?


Kindly guide me.

Thanks

Replies 2 (2)

EcomGraduates
Shopify Partner
826 70 120

To get the Order ID using the Payment ID from the Shopify Payment Session API, you can query the transactions endpoint. For updating payment details for an order:

  1. Get the Order ID: Use the Transactions API: GET /admin/api/2023-04/orders/{order_id}/transactions.json.

  2. Update Payment Details: Use the Order API: PUT /admin/api/2023-04/orders/{order_id}.json with the updated payment details in the request body.

Ensure you have the necessary API permissions to perform these actions 


 If this fixed your issue, likes and accepting as a solution are highly appreciated
|  Build an online presence with our custom-built Shopify Theme: EcomifyTheme
|  Check out our reviews: Trustpilot Reviews
|  We are Shopify Partners: EcomGraduates Shopify Partner



Anilket26
Shopify Partner
14 0 0

Hi 
Thanks for Reply.

I have checked the API URL's you have provided. But these URL's used the Order ID. My first question is that How to get that order ID from Payment ID.
Kindly guide for that.

Thanks