---
title: Add Member to Subscription
slug: docs/demo/add-member-to-subscription
description: This document provides a code example demonstrating the use of the curl command to make a POST request to a fictive API. The request focuses on adding a member to a specific account group's subscription. It explains how to include necessary headers for ac
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "yr63_Lsa4NYsQ1yWiRztT",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts/groups/{accountGroupToken}/subscriptions/{subscriptionId}/members",
    "name": "Add Member to Subscription",
    "method": "POST",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "accountGroupToken",
          "type": "string",
          "description": "The account group token used to identify the account group."
        },
        {
          "kind": "required",
          "name": "subscriptionId",
          "type": "integer",
          "description": "The account id."
        }
      ],
      "queryParameters": [],
      "headerParameters": [
        {
          "kind": "optional",
          "name": "X-TokenId",
          "type": "string",
          "description": "The eSuite Token Id"
        },
        {
          "kind": "optional",
          "name": "X-SessionId",
          "type": "string",
          "description": "The eSuite Session Id"
        },
        {
          "kind": "required",
          "name": "X-Version",
          "type": "string",
          "description": "The eSuite Version"
        },
        {
          "kind": "optional",
          "name": "Origin",
          "type": "string",
          "description": "The eSuite Origin"
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "request",
          "type": "object",
          "schema": [
            {
              "kind": "optional",
              "name": "useOverFlowLicense",
              "type": "boolean",
              "example": "",
              "description": "Use Overflow lincense"
            },
            {
              "kind": "optional",
              "name": "clientUserId",
              "type": "string",
              "example": "",
              "description": "Gets or sets the client user id."
            },
            {
              "kind": "optional",
              "name": "emailAddress",
              "type": "string",
              "example": "",
              "description": "Email Address"
            },
            {
              "kind": "optional",
              "name": "taxInfo",
              "type": "object",
              "schema": [
                {
                  "kind": "optional",
                  "name": "zeroRated",
                  "type": "string",
                  "example": "",
                  "description": "Gets or sets the zero rated"
                },
                {
                  "kind": "optional",
                  "name": "country",
                  "type": "string",
                  "example": "",
                  "description": "Gets or sets the country"
                },
                {
                  "kind": "optional",
                  "name": "state",
                  "type": "string",
                  "example": "",
                  "description": "Gets or sets the state"
                },
                {
                  "kind": "optional",
                  "name": "county",
                  "type": "string",
                  "example": "",
                  "description": "Gets or sets the county"
                },
                {
                  "kind": "optional",
                  "name": "city",
                  "type": "string",
                  "example": "",
                  "description": "Gets or sets the city"
                },
                {
                  "kind": "optional",
                  "name": "zipCode",
                  "type": "string",
                  "example": "",
                  "description": "Gets or sets the zipcode"
                },
                {
                  "kind": "optional",
                  "name": "street",
                  "type": "string",
                  "example": "",
                  "description": "Gets or sets the street"
                }
              ],
              "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.TaxRegionInfo",
              "customType": "FictiveGlobal.Api.Rest.Dtos.v1.TaxRegionInfo",
              "description": "Gets or sets the tax info."
            }
          ],
          "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.SubscriptionAddToSubscriptionGroup",
          "customType": "FictiveGlobal.Api.Rest.Dtos.v1.SubscriptionAddToSubscriptionGroup",
          "isExpanded": true
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "isExpanded": true,
        "statusCode": "204",
        "description": "No Content",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "400",
        "description": "Request is invalid.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "403",
        "description": "Unable to authenticate using the provided session.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "Account Group cannot be found.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error.",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will enable you to assign a new account to an existing account group subscription.",
    "examples": {
      "languages": [
        {
          "id": "89wDfPAPvbe7auhQ_VOb4",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.fictive.com/REST/api/accounts/groups/{accountGroupToken}/subscriptions/{subscriptionId}/members \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "DcKA7qgezAHNX-tyzNfFH",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-version\", \"string\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.fictive.com/REST/api/accounts/groups/{accountGroupToken}/subscriptions/{subscriptionId}/members\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "gVSa_5fAMGl-StS1fQr59",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/accounts/groups/{accountGroupToken}/subscriptions/{subscriptionId}/members\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-version\"] = \"string\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "G-YQmv393825dXx6wQSSe",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts/groups/{accountGroupToken}/subscriptions/{subscriptionId}/members\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-version': 'string'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "89wDfPAPvbe7auhQ_VOb4"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-204",
          "language": "204",
          "code": "// No Content\n"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Request is invalid.\n"
        },
        {
          "id": "response-2-403",
          "language": "403",
          "code": "// Unable to authenticate using the provided session.\n"
        },
        {
          "id": "response-3-404",
          "language": "404",
          "code": "// Account Group cannot be found.\n"
        },
        {
          "id": "response-4-500",
          "language": "500",
          "code": "// Internal Server Error.\n"
        }
      ],
      "selectedLanguageId": "response-0-204"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}