# Create a Supplement Plan for Member

Use the `createSupplementPlan` mutation to create and assign a supplement plan to a member.

## Required Arguments

| **Argument**                            | **Type**                 | **Description**                                                                                                              |
| --------------------------------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| `memberId`                              | ID!                      | Id of user.                                                                                                                  |
| `name`                                  | String!                  | Name of supplement plan.                                                                                                     |
| `startDate`                             | Date!                    | Supplement plan starting date.                                                                                               |
| `overview`                              | String                   | Overview description of supplement plan.                                                                                     |
| `nutrition`                             | String                   | Text area to describe nutrition related to supplement plan.                                                                  |
| `exercise`                              | String                   | Text area to describe exercise related to supplement plan.                                                                   |
| `resources`                             | String                   | Text area to describe resources related to supplement plan.                                                                  |
| `visibility`                            | Boolean                  | **True** will make the plan visible to the user, otherwise **False**                                                         |
| `isActive`                              | Boolean                  | **True** will make the plan active, otherwise **False**.                                                                     |
| `supplements`                           | \[SingleSupplement]      | Array of supplements.                                                                                                        |
| `supplements.supplementId`              | ID!                      | Id of supplement.                                                                                                            |
| `supplements.directionsOfUSe`           | \[DirectionsOfUseInput!] |                                                                                                                              |
| `supplements.directionsOfUse.quantity`  | Float!                   | Quantity of the supplement selected.                                                                                         |
| `supplements.directionsOfUse.timeOfDay` | TimeOfDay!               | Time of day the member will take the supplement. Enum: AT\_WAKING, WITH\_BREAKFAST, WITH\_LUNCH, WITH\_DINNER, AT\_BEDTIME.  |
| `supplements.length`                    | Int!                     | Number of days the supplement needs to be taken.                                                                             |
| `supplements.monday`                    | Boolean                  | **True** if the supplement should be taken on monday, otherwise **False**.                                                   |
| `supplements.tuesday`                   | Boolean                  | **True** if the supplement should be taken on tuesday, otherwise **False**.                                                  |
| `supplements.wednesday`                 | Boolean                  | **True** if the supplement should be taken on wednesday, otherwise **False**.                                                |
| `supplements.thursday`                  | Boolean                  | **True** if the supplement should be taken on thursday, otherwise **False**.                                                 |
| `supplements.friday`                    | Boolean                  | **True** if the supplement should be taken on friday, otherwise **False**.                                                   |
| `supplements.saturday`                  | Boolean                  | **True** if the supplement should be taken on saturday, otherwise **False**.                                                 |
| `supplements.sunday`                    | Boolean                  | **True** if the supplement should be taken on sunday, otherwise **False**.                                                   |
| `protocols`                             | \[SPProtocolInput]       |                                                                                                                              |
| `protocols.protocolId`                  | ID!                      | Id of protocol.                                                                                                              |
| `protocols.directionsOfUse`             | DirectionsOfUseInput!    |                                                                                                                              |
| `protocols.directionsOfUse.quantity`    | Float!                   | Quantity of the protocol selected.                                                                                           |
| `protocols.directionsOfUse.timeOfDay`   | TimeOfDay!               | Time of day the member will take the supplements. Enum: AT\_WAKING, WITH\_BREAKFAST, WITH\_LUNCH, WITH\_DINNER, AT\_BEDTIME. |
| `protocols.monday`                      | Boolean                  | **True** if the protocol should be taken on monday, otherwise **False**.                                                     |
| `protocols.tuesday`                     | Boolean                  | **True** if the protocol should be taken on tuesday, otherwise **False**.                                                    |
| `protocols.wednesday`                   | Boolean                  | **True** if the protocol should be taken on wednesday, otherwise **False**.                                                  |
| `protocols.thursday`                    | Boolean                  | **True** if the protocol should be taken on thursday, otherwise **False**.                                                   |
| `protocols.friday`                      | Boolean                  | **True** if the protocol should be taken on friday, otherwise **False**.                                                     |
| `protocols.saturday`                    | Boolean                  | **True** if the protocol should be taken on saturday, otherwise **False**.                                                   |
| `protocols.sunday`                      | Boolean                  | **True** if the protocol should be taken on sunday, otherwise **False**.                                                     |

## Available fields

<table><thead><tr><th width="190.33333333333331"></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Type</strong></td><td><strong>Description</strong></td></tr><tr><td><code>success</code></td><td>Boolean</td><td><strong>True</strong> if the supplement plan has been created, Otherwise <strong>False.</strong></td></tr><tr><td><code>message</code></td><td>String</td><td>Description of the result.</td></tr></tbody></table>

## Examples

**Example with Supplements only**

{% tabs %}
{% tab title="Request" %}

```graphql
mutation {createSupplementPlan(
  memberId:"TWVtYmVyOmVhYzk4MjU2LTQ0MWMtNGExNy04NmY4LWQwZDM3NzI5ZDU3ZQ=="
  input:{
    name:"Supplement plan only supplements example"
    isActive: true
    visibility: true
    startDate:"2023-09-01"
    supplements:[{
      supplementId:"U3VwgGxlbWVudDo5ZjdjZmU2YS04NzI0LTQ5OGUtYTc4ZC0zNDJhYjU3YmI5MDU="
      directionsOfUse:[{
        quantity:1
        timeOfDay: AT_WAKING
      },
      {
       quantity:2
       timeOfDay:WITH_DINNER 
      },
      ]
      length:20
      monday:true
      tuesday:true
      wednesday:true
      thursday:true
      friday:true
      saturday:true
      sunday:true
    },
    {
      supplementId:"U3VwcGxlbWVudDpjoDBmOTBhZS1kMmM3LTRhNDYtOWU0OC00NjIyOTNkNjBjMDc="
      directionsOfUse:[{
        quantity:2
        timeOfDay: AT_WAKING
      }]
      length:20
      monday:true
      tuesday:false
      wednesday:true
      thursday:false
      friday:true
      saturday:false
      sunday:false
    }]
  }
){
  success
  message
  }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "createSupplementPlan": {
      "success": true,
      "message": "Supplement plan created"
    }
  }
}
```

{% endtab %}
{% endtabs %}

**Example with Protocols only**

{% tabs %}
{% tab title="Request" %}

```graphql
mutation {createSupplementPlan(
  memberId:"TWVtYmVyOmVhYzk4MjU2LTQ0MWMtNGExNy04NmY4LWQwZDM3NzI5ZDU3ZQ=="
  input:{
    name:"Supplement plan protocols only example"
    isActive: true
    visibility: true
    startDate:"2023-09-01"
    protocols:[{
      protocolId:"UHJvdG9jb2w6Njc2"
      directionsOfUse:[{
        quantity:1
        timeOfDay:AT_BEDTIME
      },
      {
        quantity:1
        timeOfDay:AT_WAKING
      }]
      monday: true
      tuesday: true
      wednesday: true
      thursday:true
      friday: true
      saturday: true
      sunday: true
    
    }]
  }
){
	success
  message
  }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "createSupplementPlan": {
      "success": true,
      "message": "Supplement plan created"
    }
  }
}
```

{% endtab %}
{% endtabs %}

**Example with Protocols and Supplements**

{% tabs %}
{% tab title="Request" %}

```graphql
mutation {createSupplementPlan(
  memberId:"TWVtYmVyOmVhYzk4MjU2LTQ0MWMtNGExNy04NmY4LWQwZDM3NzI5ZDU3ZQ=="
  input:{
    name:"Supplement plan supplements & protocols example"
    isActive: true
    visibility: true
    startDate:"2023-09-01"
    supplements:[{
      supplementId:"U3VwcGxlbWVudDo5ZjdjZmU2YS04NzI0LTQ5OGUtYTc4ZC0zNDJhYjU3YmI5MDU="
      directionsOfUse:[{
        quantity:1
        timeOfDay: AT_WAKING
      },
      {
       quantity:2
       timeOfDay:WITH_DINNER 
      },
      ]
      length:20
      monday:true
      tuesday:true
      wednesday:true
      thursday:true
      friday:true
      saturday:true
      sunday:true
    },
    {
      supplementId:"U3VwcGxlbWVudDpjODBmOTBhZS1kMmM3LTRhNDYtOWU0OC00NjIyOTNkNjBjMDc="
      directionsOfUse:[{
        quantity:2
        timeOfDay: AT_WAKING
      }]
      length:20
      monday:true
      tuesday:false
      wednesday:true
      thursday:false
      friday:true
      saturday:false
      sunday:false
    }]
    protocols:[{
      protocolId:"UHJvdG9jb2w6Njc2"
      directionsOfUse:[{
        quantity:1
        timeOfDay:AT_BEDTIME
      },
      {
        quantity:1
        timeOfDay:AT_WAKING
      }]
    	monday: true
    	tuesday: true
    	wednesday: true
      thursday:true
      friday: true
      saturday: true
      sunday: true
    
    }]
  }
){
	success
  message
  }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "createSupplementPlan": {
      "success": true,
      "message": "Supplement plan created"
    }
  }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.suggestic.com/telewellness-portal/api-reference/wellness-plans/create-a-supplement-plan-for-member.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
