How can I include the Payment ID in the Shopify transaction history export?

Hi, I need to export the transaction history for our accountant.

However, the current transaction history report does not include the Payment ID or transaction reference for each payment instead it shows Order ID. Without this information, our accountant needs to open two Excel sheets and compare them side by side to match each transaction manually.

Is there a way to include the Payment ID, transaction ID, or payment reference directly in the transaction history export? If this is not currently available, could Shopify consider adding this field to the report?

Thank you.

This would need Admin GraphQL access. I’m sure there’s already an app for this. Just know if you build something yourself, there are 2 payment IDs and 2 authorization codes, one each for the authorization, and one each for the capture.

The default transaction export only pulls Order ID, not the gateway Payment ID. You can get it via the Admin API’s Order Transactions endpoint (each transaction includes the gateway authorization/reference code) - note there are actually 2 payment IDs and 2 authorization codes (one each for authorization and capture). Alternatively, an export app like Report Pundit or Order Export can add a gateway reference column to your report without custom dev work.

Hi @MelixMalaysia
You can get this without manually matching two Excel files.

Shopify’s Admin GraphQL OrderTransaction object exposes both the transaction id and a paymentId field. The transaction also has a kind field, so you can distinguish authorization, capture, refund, etc. rather than treating every transaction as a single payment reference.

For an accounting export, I’d pull the order transactions and include columns such as:

  • Order ID

  • Transaction ID (OrderTransaction.id)

  • Payment ID (OrderTransaction.paymentId)

  • Transaction kind

  • Gateway

  • Amount

  • Processed date

  • Status

One important detail: an order can have multiple transactions, so the export should be transaction-level rather than one row per order. This will also make refunds/captures easier to reconcile.

The limitation is that this isn’t something you can simply add as a column to Shopify’s native transaction-history CSV; you’d need an API-based report/app to generate that export. Shopify’s current API documentation confirms paymentId is available on OrderTransaction.

For your accountant, I’d specifically ask for the export to use paymentId as the gateway/payment reference and keep Shopify’s transaction ID as a separate column.

Hi @MelixMalaysia Welcome To Shopify Community So Native transaction history export doesn’t currently include a Payment ID/reference column, but there are two workarounds that avoid the manual matching. First, if you’re on Shopify Payments, the Payouts report (Settings > Payments > View Payouts, then export) does include the payment/transaction reference tied to each payout, so cross-referencing from that report instead of the general transaction history might already give your accountant what they need. Second, Shopify’s Admin API (Transactions resource) does return the transaction ID and gateway reference per order, so if you have a developer available, a small script pulling orders via API and exporting transaction ID alongside order ID would solve this permanently without waiting on Shopify to change the native report. Since this isn’t natively available, it’s also worth submitting it directly as feedback through Shopify’s “Give us feedback” link in admin, feature requests like this do sometimes get picked up when enough merchants report the same gap. Hope this helps solve your problem, and if it does, don’t forget to like and mark it as the solution. Thank you!

@MelixMalaysia You dont need the API or an app for this. Its already in a native export, just not the one you used.

The Payment ID sits in the Orders export, not the Transaction histories export. Thats the whole confusion. On the Orders page you clicked Export and then Export transaction histories. Go back and click Export orders instead.

Shopify documents both file structures here, and its worth sending this link to your accountant too:
https://help.shopify.com/en/manual/fulfillment/managing-orders/exporting-orders

Scroll to Order export CSV structure and youll find two columns that solve this.

Payment ID. Shopifys own description is a unique ID sent by Shopify to payment providers when a customer pays at checkout, and it says outright to use this ID to match order information between Shopify and your payment provider. Successful or pending payments only, no captures or refunds.

Payment References. Same thing but complete, including failed payments, refunds and captures. For accounting reconciliation this is usually the one you actually want. Theres also an older Payment Reference in the singular which the docs mark as deprecated, so ignore that one.

Two things to warn your accountant about before they open the file.

An order can have more than one payment id, and when it does they all sit in one cell separated by a space, a plus sign, then another space. Those cells need splitting before anything will match.

Orders with several products are spread across multiple rows, one per line item, and Shopify leaves most fields blank on the extra rows. So the payment id shows on the first row of an order and nothing after it. Sort by order name and fill down, otherwise it looks like most of your orders have no payment id at all and thats where people give up.

Also worth knowing, on the same page under Transaction history CSV structure you can see exactly why that export was never going to work. It only has ten columns and none of them is an id. It also only contains captured payment data, authorisation data is left out completely.

Last thing, since the Payouts report came up above. That only exists on Shopify Payments, and Malaysia isnt on Shopifys supported countries list, so it wont apply to you.

could you kindly assist me step by step instruction on this ?

Thank you for the clarification. However, this does not fully address my requirement.

Currently, the Transaction Histories export only shows the Order ID, while the Payment ID is only available in the Orders export. This means our accountant has to export two separate files, open two tabs and compare them side by side, which is time-consuming.

What we need is for the Payment ID to be automatically included as an additional column in the Transaction Histories export, so the accountant can complete the reconciliation using a single file.

Is there any way to achieve this through a custom export, report, app or another solution? If Shopify’s native export cannot support it, could you please recommend the most suitable alternative?

@MelixMalaysia Youre right, native cant do it. Theres no way to add columns to either export, so one file straight out of Shopify isnt happening.

But the two tabs side by side part is fixable today for free, and its a one minute setup.

Both files share the order name column, called Name in each. So in the transaction history file, add one column with a lookup that pulls Payment ID from the orders file, matching on Name. XLOOKUP in Excel, VLOOKUP in Sheets. Your accountant then works in one sheet with the payment id sitting on every transaction row and never opens the second file again.

One thing thats convenient here. In the orders export the payment id only appears on the first row of each order, with the extra line item rows left blank. A lookup takes the first match, so that works in your favour.

If you want it properly automated, the data association does exist, its only the CSV export that leaves it out. Payment ID sits directly on the transaction object in the GraphQL Admin API as paymentId, the field that replaced the old authorizationCode:

So you have two routes from there.

An export app. Matrixify and EZ Exporter both do custom columns and scheduled exports. Give them the exact field path, order transactions paymentId, and ask whether they can include it at transaction level. That turns a vague requirement into a yes or no in one message.

Or skip apps entirely. Create a custom app in your admin under Settings, Apps and sales channels, Develop apps, give it read_orders, and have a developer write a short script that queries orders with their transactions and writes one CSV with a row per transaction and the payment id on each. Its genuinely small, maybe an hour of work, and you can put it on a schedule so the file is waiting for your accountant each month. Note youll also need read_all_orders if you ever pull anything older than 60 days. No subscription, and nothing leaves your own systems, which your accountant may prefer anyway.

If this is a monthly job though, try the lookup first. Its free and it kills the actual annoyance, which is the two files rather than the export itself.

Totally get the frustration - the default Transaction History export only shows Order ID, so matching it against your payment processor’s records means manual cross-referencing, which isn’t fun for accounting.

A few ways to solve this without the manual matching:

Easiest fix : Check Settings > Payments > View Payouts. Shopify’s Payout reports usually include payment references you can match more directly than the plain transaction export.

If you use apps like Shopify Payments/Razorpay/etc. : Your payment gateway’s own dashboard often has a matching Order ID or reference number field you can export and use as a bridge between the two systems.

For a proper fix : If you (or your developer) can use Shopify’s API, the transaction data does contain a payment ID field - a script or a report-building app (like Report Pundit or similar export apps) can pull Order ID + Payment ID together into one sheet automatically, so your accountant never has to do it by hand again.

Worth doing too : Submit this as feedback to Shopify directly - a “payment ID” column in the native export is a reasonable ask, and enough requests can get it prioritized.

Hope one of these unblocks you :slight_smile: