---
title: "Adds a friend by creating a member friend using a friend code"
method: POST
path: "/ocapi/v1/members/current/friends/code"
tags: ["Members", "Friends"]
---

# Adds a friend by creating a member friend using a friend code

`POST /ocapi/v1/members/current/friends/code`

#### Licenses Required


- Vista.Ocapi
- Vista.Loyalty.Friends

## Headers

- `loyaltySessionToken` string
- `Connect-Region-Code` string

## Request body

- OcapiV1LoyaltyMembersFriendsMemberFriendFromCodeCreate — Represents the values needed to create a member friend using a member friend code
  - `friendCode` string, required — Gets the member friend code FriendCode

## Response `200`

Success

- OcapiV1LoyaltyMembersFriendsMemberFriendDetails — Represents the details of a member friend entity, and its related data
  - `friend` OcapiV1LoyaltyMembersFriendsMemberFriend, required — Represents the details of a member that is the friend of another member
    - `id` string, uuid, required — Gets the unique identifier
    - `name` OcapiV1PersonName, required — Represents the parts of a person's name
      - `givenName` string, nullable — Gets the given name
      - `familyName` string, nullable — Gets the family name
      - `middleName` string, nullable — Gets the middle or any additional name
    - `photo` OcapiV1LoyaltyMembersFriendsMemberFriendPhoto — Represents the base properties of the photo associated with a member
      - `uriExpiresAt` string, date-time, required — Gets the date and time that the URI returned for retrieving the photo is no longer valid
      - `uri` string, uri, required — Gets the address used for retrieving the photo
    - `subscriptionSharing` OcapiV1LoyaltyMembersFriendsMemberFriendSubscriptionSharing, required — Represents the details of any member subscription sharing between a member friend and a member
      - `friendCanUseMemberSubscription` boolean, required — Gets a value indicating whether the member friend can use the member entity's member subscription
      - `friendSubscriptions` OcapiV1LoyaltyMembersFriendsMemberFriendSubscription[], required — Gets the list of member friend subscription entities that the member can use
        - `subscriptionId` integer, required — Gets the unique identifier of the subscription
    - `createdAt` string, date-time, required — Gets the date and time that the friend was created
  - `relatedData` OcapiV1LoyaltyMembersFriendsMemberFriendRelatedData, required — Related data for a member friend entity
    - `subscriptions` OcapiV1LoyaltyMasterDataSubscriptionsSubscription[], required — Gets the list of related subscription entities
      - `id` integer, required — Gets the unique identifier
      - `name` OcapiV1Translatable, required — Represents some customer-visible translatable Text in the default language, and a list of translation entities
        - `text` string, required — Gets the text in the default language
        - `translations` OcapiV1Translation[], required — Gets the translations of the translatable Text in other languages
          - `languageTag` string, required — Gets the IETF (RFC 4646) language tag that the translation Text has been translated for
          - `text` string, required — Gets the translated text
      - `clubId` integer, required — Gets the unique identifier of the club
      - `minimumTermInMonths` integer, required — Gets the minimum number of number of months required for the subscription term
      - `minimumTermBeforeCanPurchaseFutureSubscriptionInMonths` integer, required — Gets the minimum number of months that must be completed before purchase of another subscription will be allowed

## Other responses

- `400` — Request property is invalid or missing, or member cannot add friend.
- `401` — No member authenticated.
- `429` — Too many requests. Try again later.

---

[API](https://skmtc.net/vista/apis/vista-digital-platform.md) · [All operations](https://skmtc.net/vista/apis/vista-digital-platform/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vista/vista-digital-platform/versions/3a81c0aed14e/schema)
