Payment information in order confirmation

New Member
4 0 0


How do I customize my order confirmation notification to include more information about payment than just the gateway name, e.g.

  • Card type (visa/master card etc.)
  • Last 4 digits in card.

Currently I can get a gateway identifier using either

{{ gateway }}


{{ unique_gateways }}

 but according to documentation I seem to be limited to these.

Any help is appreciated!

Shopify Staff
Shopify Staff
253 0 19

Hello Mikkel

One of the things that it mentions is that guide is that it can have transactions, they are a whole object so there's more information in this guide.

So you could do something like this.

{{ transaction.payment_details.credit_card_number ))

Then you will get something back like...

•••• •••• •••• 4242

Hope that helps!


New Member
4 0 0


I tested this today, and adding the following to the Order confirmation e-mail yielded only the paratheses " ()", ie. no credit card information.

(Note: I placed an order, with real credit card information)

{{ transaction.payment_details.credit_card_company }} ({{ transaction.payment_details.credit_card_number }})

Am I missing something obvious? :-o


New Member
1 0 1

I am also trying to achieve something similar in my New Order email notification.  I would like to list the gateway transaction ID on the email.  We use and want to be sure to match the Authorize emails to the Shopify emails for accounting purposes.  I tried using the following, but no luck:

{{ }}

Any advice would be great.  This is the only change I need to make to the very helpful default setup.

Thank you.


1 Like
New Member
4 0 0

Does anyone have an answer to this? Why is the transaction object empty?

New Member
4 0 0

I found the answer in another forum post:

Apparently, the transaction object must be accessed through a collection of transactions, like this:

{% for transaction in transactions %}
{{ transaction.payment_details.credit_card_number }}
{% endfor %}

The documentation is misleading, see the Email variable reference article ( which doesn't explain this properly. It only mentions the transaction variable, and should be updated to reflect the above.

Hope this helps.