---
title: "userInviteRelations"
description: >
  Get successful referral relationships of the specified customer within the store.
doc_type: graphql
doc_category: storefront
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/storefront-api/member-system/queries/user-invite-relations'
  md: 'https://developer.shopline.com/docs/storefront-api/member-system/queries/user-invite-relations.md'
---
# userInviteRelations

Get successful referral relationships of the specified customer within the store.

- **API Version:** v20270301
- **API Type:** Storefront
- **API Protocol:** GraphQL
- **Operation Type:** Query

## Arguments

* `after`

  [String](https://developer.shopline.com/docs/storefront-api/common/scalars/string.md)

  Returns elements following the specified cursor. The `first` argument must also be specified when using this argument.

* `before`

  [String](https://developer.shopline.com/docs/storefront-api/common/scalars/string.md)

  Returns elements preceding the specified cursor. The `last` argument must also be specified when using this argument.

* `first`

  [Int](https://developer.shopline.com/docs/storefront-api/common/scalars/int.md)

  Returns the first n elements in the list. 

* `last`

  [Int](https://developer.shopline.com/docs/storefront-api/common/scalars/int.md)

  Returns the last n elements in the list. 

* `reverse`

  [Boolean](https://developer.shopline.com/docs/storefront-api/common/scalars/boolean.md)

  Whether to reverse the order of the list. 
  
  ● true: reverse
  
  ● false: do not reverse
  
  Default value: false

* `customerAccessToken`

  [String!](https://developer.shopline.com/docs/storefront-api/common/scalars/string.md)

  The customer access token.

## Returns

* `edges`

  [[UserInviteRelationEdge!]!](https://developer.shopline.com/docs/storefront-api/member-system/objects/user-invite-relation-edge.md)

  A list of edges, containing the nodes and their corresponding cursors.

* `pageInfo`

  [MemberSystemPageInfo!](https://developer.shopline.com/docs/storefront-api/member-system/objects/member-system-page-info.md)

  Pagination information for the current page.

* `nodes`

  [[InviteRelation]](https://developer.shopline.com/docs/storefront-api/member-system/queries/invite-relation.md)

  A flattened list of nodes.

## Examples

### Get successful referral relationships of the specified customer within the store

Get successful referral relationships of the specified customer within the store.

**Request:**

```json
query {
   userInviteRelations(first:10,customerAccessToken:"tokenxx"){
  nodes{
         senderCustomer{
                customerId
                email
                phone
                firstName
                lastName
                levelName
                levelCode
                referralUrl
                referralCode
         },
         receiverCustomer{
             customerId
                email
                phone
                firstName
                lastName
                levelName
                levelCode
                referralUrl
                referralCode
         }
     }
     edges{
         cursor,node{ 
              senderCustomer{
             customerId
         },
         receiverCustomer{
             customerId
         }
         }
     }
    pageInfo{
    startCursor
    endCursor
    hasNextPage
    hasPreviousPage
    }

  }
}
```

**Response:**

```json
{
  "data": {
    "data": {
      "userInviteRelations": {
        "nodes": [
          {
            "receiverCustomer": {
              "customerId": "gid://shopline/Customer/4603700****",
              "email": "**222@qq.com",
              "lastName": null,
              "levelCode": "",
              "referralCode": "RW**",
              "referralUrl": "https://****.myshopline.com/user/signUp?referral_code=RWL**&source_type=member_plugin_referral&slt=member_plugin_referral",
              "firstName": null,
              "levelName": null,
              "phone": null
            },
            "senderCustomer": {
              "levelName": "middle",
              "referralCode": "UL**",
              "customerId": "gid://shopline/Customer/460352****",
              "email": "***666@qq.com",
              "firstName": "zhang",
              "phone": null,
              "referralUrl": "https://*.myshopline.com/user/signUp?referral_code=UL**C&source_type=member_plugin_referral&slt=member_plugin_referral",
              "lastName": "eeeevv",
              "levelCode": "gid://shopline/Membership/MLC644317091657103****"
            }
          }
        ],
        "pageInfo": {
          "endCursor": "EED61853938C27E6CA1623B1FE2****",
          "hasNextPage": false,
          "hasPreviousPage": false,
          "startCursor": "EED61853938C27E6CA1623B1FE****"
        },
        "edges": [
          {
            "cursor": "EED61853938C27E6CA1623B1FE2****",
            "node": {
              "receiverCustomer": {
                "customerId": "gid://shopline/Customer/4603700***"
              },
              "senderCustomer": {
                "customerId": "gid://shopline/Customer/460352***"
              }
            }
          }
        ]
      }
    }
  }
}
```

## Error Handling

For detailed information about common codes, see [Status and error codes](https://developer.shopline.com/docs/apps/api-instructions-for-use/storefront-api/overview.md#status-and-error-codes).

