Title: Payment id
Last modified: May 11, 2019

---

# Payment id

 *  Resolved [djdavit1990](https://wordpress.org/support/users/djdavit1990/)
 * (@djdavit1990)
 * [7 years ago](https://wordpress.org/support/topic/payment-id/)
 * Is it possible to add the payment ID on the ticket? My tickets are custom made.
   
   Or purchase ID
    -  This topic was modified 7 years ago by [djdavit1990](https://wordpress.org/support/users/djdavit1990/).

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Joe Dolson](https://wordpress.org/support/users/joedolson/)
 * (@joedolson)
 * [7 years ago](https://wordpress.org/support/topic/payment-id/#post-11522597)
 * Yes, using the function `mt_ticket_purchase_id()`
 *  [robnicholson](https://wordpress.org/support/users/robnicholson/)
 * (@robnicholson)
 * [7 years ago](https://wordpress.org/support/topic/payment-id/#post-11525611)
 * Coincidentally, I need this functionality as well. I’ve copied receipt.php into
   my own theme folder and added the following:
 *     ```
       	<div class='receipt'>
       		<p>
       			<code>#<?php mt_receipt_id(); ?></code>
       		</p>
       		<p>
       			<code>Purchase ID #<?php mt_ticket_purchase_id(); ?></code>
       		</p>
       	</div>
       ```
   
 * But it’s not showing the purchase ID: [https://i.imgur.com/jHGlJ7s.png](https://i.imgur.com/jHGlJ7s.png)
 *  [robnicholson](https://wordpress.org/support/users/robnicholson/)
 * (@robnicholson)
 * [7 years ago](https://wordpress.org/support/topic/payment-id/#post-11525672)
 * Later.. I did a bit of diagnosing and added some temp echos to this function:
 *     ```
       function mt_get_ticket_purchase_id( $ticket_id = false ) {
       	if ( ! $ticket_id ) {
       		echo 'Getting ticket_id; ';
       		$ticket_id = mt_get_ticket_id();
       	}
       	echo 'ticket_id ['; echo $ticket_id; echo ']; ';
       	$purchase    = get_post_meta( mt_get_ticket( $ticket_id )->ID, '_' . $ticket_id, true );
       	$purchase_id = $purchase['purchase_id'];
   
       	return $purchase_id;
       }
       ```
   
 * ticket_id is blank so mt_get_ticket_id() isn’t working as expected?
 *  [robnicholson](https://wordpress.org/support/users/robnicholson/)
 * (@robnicholson)
 * [7 years ago](https://wordpress.org/support/topic/payment-id/#post-11525686)
 * Ahh just released this post was about getting the purchase ID on the ticket. 
   I’m looking at getting it on the receipt.
 *  [robnicholson](https://wordpress.org/support/users/robnicholson/)
 * (@robnicholson)
 * [7 years ago](https://wordpress.org/support/topic/payment-id/#post-11525767)
 * Later still… found the function for me: mt_receipt_purchase_id()
 * All sorted!
 *  Plugin Author [Joe Dolson](https://wordpress.org/support/users/joedolson/)
 * (@joedolson)
 * [7 years ago](https://wordpress.org/support/topic/payment-id/#post-11525958)
 * Yes, the receipt and the ticket have different starting information, so they 
   use different functions to get that value. Glad you found it!
 *  Thread Starter [djdavit1990](https://wordpress.org/support/users/djdavit1990/)
 * (@djdavit1990)
 * [7 years ago](https://wordpress.org/support/topic/payment-id/#post-11525995)
 * Hey joe.
 * Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Payment id’ is closed to new replies.

 * ![](https://ps.w.org/my-tickets/assets/icon-256x256.png?rev=1097581)
 * [My Tickets - Accessible Event Ticketing](https://wordpress.org/plugins/my-tickets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/my-tickets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/my-tickets/)
 * [Active Topics](https://wordpress.org/support/plugin/my-tickets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/my-tickets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/my-tickets/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [djdavit1990](https://wordpress.org/support/users/djdavit1990/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/payment-id/#post-11525995)
 * Status: resolved