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

# PFMultiplayerCreateServerBackfillTicket

> Creates a PlayFab Multiplayer server backfill ticket so a game server with open slots can be matched with additional players from a matchmaking queue.

Creates a server backfill ticket.

## Syntax

```cpp theme={null}
HRESULT PFMultiplayerCreateServerBackfillTicket(  
    PFMultiplayerHandle handle,  
    const PFEntityKey* server,  
    const PFMatchmakingServerBackfillTicketConfiguration* configuration,  
    void* asyncContext,  
    PFMatchmakingTicketHandle* ticket  
)  
```

### Parameters

**`handle`**   PFMultiplayerHandle

The handle of the PFMultiplayer API instance.

**`server`**   [PFEntityKey\*](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/pfentitykey_clientsdk)

The server entity.

**`configuration`**   [PFMatchmakingServerBackfillTicketConfiguration\*](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/structs/pfmatchmakingserverbackfillticketconfiguration)

The backfill ticket configuration.

**`asyncContext`**   void\*\
*optional*

An optional, app-defined, pointer-sized context value that can be used to associate the completion state change with this call.

**`ticket`**   PFMatchmakingTicketHandle\*\
*library-allocated output*

The resulting ticket object.

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

To use this feature, you must define PFMULTIPLAYER\_INCLUDE\_SERVER\_APIS before including PFMatchmaking.h. <br /><br /> The library automatically, and asynchronously, submits a server backfill ticket to the matchmaking service. Each time the ticket status changes, a [PFMatchmakingTicketStatusChangedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/structs/pfmatchmakingticketstatuschangedstatechange) is provided. The ticket status can be queried at any time via [PFMatchmakingTicketGetStatus()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/functions/pfmatchmakingticketgetstatus). The ticket immediately starts in the `PFMatchmakingTicketStatus::Creating` state.   <br /><br /> When the ticket completed, a [PFMatchmakingTicketStatusChangedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/structs/pfmatchmakingticketstatuschangedstatechange) is provided. At that point, a match for the backfill ticket is found or the ticket stopped due to failure. On success, the match that was found can be queried via [PFMatchmakingTicketGetMatch()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/functions/pfmatchmakingticketgetmatch). The `regionPreferences` in [PFMatchmakingMatchDetails](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/structs/pfmatchmakingmatchdetails) only contains the region that the server is located in.   <br /><br /> If ticket creation fails because there are already too many tickets for the users specified in the configuration, the library transparently cancels those outstanding tickets and then retries ticket creation.   <br /><br /> This function requires that a previous call to [PFMultiplayerSetEntityToken()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayersetentitytoken) was made to set the game server entity token.

## Requirements

**Header:** PFMatchmaking.h

## See also

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


## Related topics

- [Using Server Backfill Tickets - Multiplayer SDK](/services/playfab/multiplayer/matchmaking/backfill-tickets-multiplayer-sdk.md)
- [PlayFab Multiplayer C++ SDK Release Notes](/services/playfab/multiplayer/lobby/lobby-matchmaking-sdks/lobby-and-matchmaking-release-notes.md)
- [PFMultiplayer C/C++ API overview - PFMatchmaking.h](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/pfmatchmaking_members.md)
- [CreateServerBackfillTicket](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/CreateServerBackfillTicket.md)
- [Using Server Backfill Tickets - REST API](/services/playfab/multiplayer/matchmaking/backfill-tickets.md)
