> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PFMatchmakingTicketGetTicketId

> Retrieves the unique ticket ID assigned to a PlayFab Multiplayer matchmaking ticket, used to join or reference the ticket from other client sessions.

Provides the ticket ID.

## Syntax

```cpp theme={null}
HRESULT PFMatchmakingTicketGetTicketId(  
    PFMatchmakingTicketHandle ticket,  
    const char** id  
)  
```

### Parameters

**`ticket`**   PFMatchmakingTicketHandle

The handle of the matchmaking ticket.

**`id`**   char\*\*\
*library-allocated output*

The ticket ID.

### Return value

Type: HRESULT

`S_OK` if the call succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via [PFMultiplayerGetErrorMessage()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayergeterrormessage).

## Remarks

The ticket ID will be an empty string if it has not yet been set. This can occur under one of the following conditions:

* The ticket is in the `PFMatchmakingTicketStatus::Creating` state
* The ticket is in the `PFMatchmakingTicketStatus::Failed` state due to failure to submit a ticket to the matchmaking service
* The ticket was canceled before it could be submitted to the matchmaking service

## Requirements

**Header:** PFMatchmaking.h

## See also

[PFMatchmaking members](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/pfmatchmaking_members)
