> ## 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.

# XblMatchmakingCreateMatchTicketAsync

> XblMatchmakingCreateMatchTicketAsync

# XblMatchmakingCreateMatchTicketAsync

Sends a matchmaking request to the server and returns the match ticket with a ticket id. Call XblMatchmakingCreateMatchTicketResult upon completion to get the result.

## Syntax

```cpp theme={null}
HRESULT XblMatchmakingCreateMatchTicketAsync(  
         XblContextHandle xboxLiveContext,  
         XblMultiplayerSessionReference ticketSessionReference,  
         const char* matchmakingServiceConfigurationId,  
         const char* hopperName,  
         const uint64_t ticketTimeout,  
         XblPreserveSessionMode preserveSession,  
         const char* ticketAttributesJson,  
         XAsyncBlock* asyncBlock  
)  
```

### Parameters

*xboxLiveContext*   \_In\_\
Type: [XblContextHandle](/reference/live/xsapi-c/types_c/handles/xblcontexthandle)

XBOX live context for the local user.

*ticketSessionReference*   \_In\_\
Type: [XblMultiplayerSessionReference](/reference/live/xsapi-c/multiplayer_c/structs/xblmultiplayersessionreference)

The multiplayer session to use for the match.

*matchmakingServiceConfigurationId*   \_In\_\
Type: char\*

The service configuration ID for the match.

*hopperName*   \_In\_\
Type: char\*

The name of the hopper.

*ticketTimeout*   \_In\_\
Type: uint64\_t

The maximum time to wait for players to join the session.

*preserveSession*   \_In\_\
Type: [XblPreserveSessionMode](/reference/live/xsapi-c/matchmaking_c/enums/xblpreservesessionmode)

Indicates if the session should be preserved.

*ticketAttributesJson*   \_In\_\
Type: char\*

The ticket attributes for the session. (Optional)

*asyncBlock*   \_In\_\
Type: XAsyncBlock\*

The AsyncBlock for this operation.

### Return value

Type: HRESULT

HRESULT return code for this API operation.

## Remarks

The match ticket object contains server returned information such as ticket id and wait time, and also contains copies of the title specified data from the ticket data object.

## REST Call

Calls V103 POST /serviceconfigs/{serviceConfigId}/hoppers/{hopperName}

## Requirements

**Header:** matchmaking\_c.h

**Library:** Microsoft.Xbox.Services.14x.GDK.C.lib

## See also

[matchmaking\_c](/reference/live/xsapi-c/matchmaking_c/matchmaking_c_members)


## Related topics

- [XblMatchmakingCreateMatchTicketResult](/reference/live/xsapi-c/matchmaking_c/functions/xblmatchmakingcreatematchticketresult.md)
- [Using SmartMatch matchmaking](/services/xbox-services/multiplayer/matchmaking/concepts/live-matchmaking-how-tos.md)
- [Configuring matchmaking in Partner Center](/services/xbox-services/multiplayer/matchmaking/config/live-matchmaking-config.md)
- [Moving from MPSD to PlayFab Multiplayer and MPA](/services/xbox-services/multiplayer/mpsd/concepts/live-mpsd-to-mlp.md)
- [Multiplayer tasks](/services/xbox-services/multiplayer/mpsd/how-to/live-mpsd-how-tos.md)
