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

# PFAccountManagementServerLinkPSNIdAsync

> Links the PlayStation :tm: Network account associated with the provided user id to the user's PlayFab account

Links the PlayStation :tm: Network account associated with the provided user id to the user's PlayFab account

## Syntax

```cpp theme={null}
HRESULT PFAccountManagementServerLinkPSNIdAsync(  
    PFEntityHandle titleEntityHandle,  
    const PFAccountManagementLinkPSNIdRequest* request,  
    XAsyncBlock* async  
)  
```

### Parameters

**`titleEntityHandle`**   PFEntityHandle

PFEntityHandle for a title Entity obtained using PFAuthenticationGetEntityWithSecretKeyAsync.

**`request`**   [PFAccountManagementLinkPSNIdRequest\*](https://docs.xbox.com/services/playfab/api-references/c/pfaccountmanagementtypes/structs/pfaccountmanagementlinkpsnidrequest.md)

Populated request object.

**`async`**   XAsyncBlock\*\
*Inout*

XAsyncBlock for the async operation.

### Return value

Type: HRESULT

Result code for this API operation.

## Remarks

This API is available on Windows. Call XAsyncGetStatus to get the status of the operation. If the service call is unsuccessful, the async result will be E\_PF\_ACCOUNT\_ALREADY\_LINKED, E\_PF\_ACCOUNT\_NOT\_FOUND, E\_PF\_INVALID\_NAMESPACE\_MISMATCH, E\_PF\_INVALID\_PSN\_AUTH\_CODE, E\_PF\_INVALID\_PSN\_ISSUER\_ID, E\_PF\_LINKED\_ACCOUNT\_ALREADY\_CLAIMED, E\_PF\_PSN\_INACCESSIBLE or any of the global PlayFab Service errors. See doc page "Handling PlayFab Errors" for more details on error handling.

## Requirements

**Header:** PFAccountManagement.h

## See also

[PFAccountManagement members](https://docs.xbox.com/services/playfab/api-references/c/pfaccountmanagement/pfaccountmanagement_members.md)


## Related topics

- [Services C API overview - PFAccountManagement.h](https://docs.xbox.com/services/playfab/api-references/c/pfaccountmanagement/pfaccountmanagement_members.md)
- [PFAccountManagementServerLinkServerCustomIdAsync](https://docs.xbox.com/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementserverlinkservercustomidasync.md)
- [PFAccountManagementServerLinkSteamIdAsync](https://docs.xbox.com/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementserverlinksteamidasync.md)
- [PFAccountManagementServerLinkNintendoSwitchDeviceIdAsync](https://docs.xbox.com/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementserverlinknintendoswitchdeviceidasync.md)
- [PFAccountManagementServerLinkNintendoServiceAccountSubjectAsync](https://docs.xbox.com/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementserverlinknintendoserviceaccountsubjectasync.md)
