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

# 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\*](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/pfentitykey_clientsdk.md)

The server entity.

**`configuration`**   [PFMatchmakingServerBackfillTicketConfiguration\*](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/structs/pfmatchmakingserverbackfillticketconfiguration.md)

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()](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayergeterrormessage.md).

## Remarks

To use this feature, you must define PFMULTIPLAYER\_INCLUDE\_SERVER\_APIS before including PFMatchmaking.h. \
\
&#x20;The library automatically, and asynchronously, submits a server backfill ticket to the matchmaking service. Each time the ticket status changes, a [PFMatchmakingTicketStatusChangedStateChange](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/structs/pfmatchmakingticketstatuschangedstatechange.md) is provided. The ticket status can be queried at any time via [PFMatchmakingTicketGetStatus()](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/functions/pfmatchmakingticketgetstatus.md). The ticket immediately starts in the `PFMatchmakingTicketStatus::Creating` state.   \
\
&#x20;When the ticket completed, a [PFMatchmakingTicketStatusChangedStateChange](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/structs/pfmatchmakingticketstatuschangedstatechange.md) 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()](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/functions/pfmatchmakingticketgetmatch.md). The `regionPreferences` in [PFMatchmakingMatchDetails](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/structs/pfmatchmakingmatchdetails.md) only contains the region that the server is located in.   \
\
&#x20;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.   \
\
&#x20;This function requires that a previous call to [PFMultiplayerSetEntityToken()](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayersetentitytoken.md) was made to set the game server entity token.

## Requirements

**Header:** PFMatchmaking.h

## See also

[PFMatchmaking members](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/pfmatchmaking_members.md)


## Related topics

- [Using Server Backfill Tickets - Multiplayer SDK](https://docs.xbox.com/services/playfab/multiplayer/matchmaking/backfill-tickets-multiplayer-sdk.md)
- [PlayFab Multiplayer C++ SDK Release Notes](https://docs.xbox.com/services/playfab/multiplayer/lobby/lobby-matchmaking-sdks/lobby-and-matchmaking-release-notes.md)
- [PFMultiplayer C/C++ API overview - PFMatchmaking.h](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/pfmatchmaking_members.md)
- [Create Server Backfill Ticket](https://docs.xbox.com/services/playfab/api-references/rest/multiplayer/matchmaking/create-server-backfill-ticket.md)
- [CreateServerBackfillTicket](https://docs.xbox.com/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer.PlayFabMultiplayerServer/CreateServerBackfillTicket.md)
