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

# 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](https://docs.xbox.com/reference/live/xsapi-c/types_c/handles/xblcontexthandle.md)

XBOX live context for the local user.

*ticketSessionReference*   \_In\_\
Type: [XblMultiplayerSessionReference](https://docs.xbox.com/reference/live/xsapi-c/multiplayer_c/structs/xblmultiplayersessionreference.md)

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](https://docs.xbox.com/reference/live/xsapi-c/matchmaking_c/enums/xblpreservesessionmode.md)

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.142.C.lib or Microsoft.Xbox.Services.143.C.lib

## See also

[matchmaking\_c](https://docs.xbox.com/reference/live/xsapi-c/matchmaking_c/matchmaking_c_members.md)


## Related topics

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