Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
I'm trying to match up Shopify transactions in our Stripe account to their relevant Shopify orders.
Shopify adds the following metadata fields to the transaction in Stripe:
Hi @jarrydmoore
The order IDs between the two systems are distinct. You can view the Stripe ID in the order timeline on the page for each order. This is a current limitation of the platform that we are aware of.
Kind Regards,
To learn more visit the Shopify Help Center or the Community Blog.
@csam Is there field that Shopify can return via API that will let us identify which Stripe payment it belongs to?
Obviously Shopify knows which Stripe payment belongs to each order - it needs to for refunds, etc. Surely there's a way to get this data?
Hey @jarrydmoore ,
Shopify doesn't technically host gateway-side details as dedicated fields within the order or transaction json. We create ids associated with these interactions for our own use, but they are not 1:1 copies of the ids used on the payment gateway side.
That said, you can typically query the "receiptJson" field in graphQL to gather the gateway specific data that Shopify receives from any non-shopify payments gateway. The receiptJson field will contain the unique id associated with the transaction that's held on the gateway side. In the case of Stripe, I believe its "charge id" but it would be worth double checking by calling for that field on your shop.
Example:
query {
orders(first: 5) {
edges {
node {
id
name
transactions(first: 5) {
id
receiptJson
}
}
}
}
}
To learn more visit the Shopify Help Center or the Community Blog.
So I'm newish to Shopify, but I'm having the same issue. But, I think I may have found a working solution. I'm not sure if this is guaranteed to always work - just reporting what I noticed.
The order object I get from shopify has a checkout_id field. It has a value of aMadeUpCheckoutId, for example.
My order_id metafield I see on the stripe transaction has the format caMadeUpCheckoutId.1.
So if the shopify checkout_id field was 123def456abc, then I see an order_id metafield in stripe of c123def456abc.1
Hi,
You can use https://SpeakTextOnline.com which provides Shopify & Stripe tool that allows to get Shopify orders IDs in Stripe payments reports.
Plus this tool has exporting functionality in multiple formats such PDF, CSV, etc..
For any questions, feel free to contact at info@speaktextonline.com
Thanks,
Khaled
Jarrydmoore this is how you can find a stripe charge linked with your shopify order.
1. Use Order Transaction API to get the payment_id (shopify payment session) from the response.
Doc:https://shopify.dev/docs/api/admin-rest/2024-04/resources/transactions
GET /admin/api/2023-10/orders/450789469/transactions/389404469.json
2. Use Stripe search charges API shown below to find charge for shopify payment session found above:
Doc: https://docs.stripe.com/api/charges/search
Example:
const stripe = require('stripe')('sk_test_51JK0Gx...f700xnPTE3Zssk_test_51JK0GxBnP1f8jLOseMk19ol0pOnpwCJzNyQF7LTF0ou8Ugxw3UFt0DteQlboVF6e4a4bc8oOxz8JOZEx0yVvkEf700xnPTE3Zs');