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

# PFAccountManagementClientLinkPSNAccountAsync

> Client API that links a PlayStation Network account to the user's PlayFab account using an access code. Available on PlayStation, Linux, and macOS.

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

## Syntax

```cpp theme={null}
HRESULT PFAccountManagementClientLinkPSNAccountAsync(  
    PFEntityHandle entityHandle,  
    const PFAccountManagementClientLinkPSNAccountRequest* request,  
    XAsyncBlock* async  
)  
```

### Parameters

**`entityHandle`**   PFEntityHandle

PFEntityHandle to use for authentication.

**`request`**   [PFAccountManagementClientLinkPSNAccountRequest\*](https://docs.xbox.com/services/playfab/api-references/c/pfaccountmanagementtypes/structs/pfaccountmanagementclientlinkpsnaccountrequest.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 Sony PlayStation®, Linux, and macOS. See also ClientLoginWithPSNAsync, ClientUnlinkPSNAccountAsync. 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\_LINKED\_TO\_A\_BANNED\_PLAYER, E\_PF\_INVALID\_PARAMS, E\_PF\_INVALID\_PSN\_AUTH\_CODE, E\_PF\_INVALID\_PSN\_AUTH\_CODE, E\_PF\_INVALID\_PSN\_ISSUER\_ID, E\_PF\_LINKED\_ACCOUNT\_ALREADY\_CLAIMED, E\_PF\_PSN\_INACCESSIBLE, E\_PF\_PSN\_NEXT\_GEN\_NOT\_CONFIGURED\_FOR\_TITLE 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)
- [PFAccountManagementClientLinkGoogleAccountAsync](https://docs.xbox.com/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementclientlinkgoogleaccountasync.md)
- [PFAccountManagementClientLinkSteamAccountAsync](https://docs.xbox.com/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementclientlinksteamaccountasync.md)
- [PFAccountManagementClientLinkXboxAccountAsync](https://docs.xbox.com/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementclientlinkxboxaccountasync.md)
- [PFAccountManagementClientLinkFacebookAccountAsync](https://docs.xbox.com/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementclientlinkfacebookaccountasync.md)
