---
title: fetchCustomDataTokenForUser - Shop Partners API
description: |-
  Fetch an OAuth Access and Refresh Token pair for the Shop Users API to read or write metafields after
  user's presence interaction ends.

  If a user has used Sign in with Shop with your App client, you may retreive tokens to read / write
  your own metafields on a user.
api_version: unstable latest
source_url:
  html: https://shopify.dev/docs/api/shop-partners/latest/mutations/fetchCustomDataTokenForUser
  md: https://shopify.dev/docs/api/shop-partners/latest/mutations/fetchCustomDataTokenForUser.md
---

# fetch​Custom​Data​Token​For​User

mutation

Fetch an OAuth Access and Refresh Token pair for the Shop Users API to read or write metafields after user's presence interaction ends.

If a user has used Sign in with Shop with your App client, you may retreive tokens to read / write your own metafields on a user.

## Arguments

* email

  [String!](https://shopify.dev/docs/api/shop-partners/latest/scalars/String)

  required

  The email of the buyer for whom you need an Access token.

* through

  [String](https://shopify.dev/docs/api/shop-partners/latest/scalars/String)

  Private to Shopify Internal clients. Allows a storefront to be passed in by its myshopify domain.

***

## Fetch​Custom​Data​Token​For​User​Payload returns

* access​Token

  [String](https://shopify.dev/docs/api/shop-partners/latest/scalars/String)

  New AccessToken for Users API.

* expires​In

  [Int](https://shopify.dev/docs/api/shop-partners/latest/scalars/Int)

  Access Token TTL in Seconds.

* refresh​Token

  [String](https://shopify.dev/docs/api/shop-partners/latest/scalars/String)

  New RefreshToken for Users API used to get new AccessTokens.

* token​Type

  [String](https://shopify.dev/docs/api/shop-partners/latest/scalars/String)

  New RefreshToken for Users API used to get new AccessTokens.

* user​Errors

  [\[User​Error!\]!](https://shopify.dev/docs/api/shop-partners/latest/objects/UserError)

  non-null

  List of errors that occured while executing the mutation.

***

## Examples

* ### fetchCustomDataTokenForUser reference