---
title: Replicate Roku subscription within eSuite
slug: docs/demo/replicate-roku-subscription-within-esuite
description: Learn how to use the cURL command to make a successful POST request to any API endpoint with this comprehensive document. Discover how to set the necessary headers to communicate JSON data effectively and explore a code example that includes a JSON payloa
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "OBt5oejq10ie47T3Wg-HU",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts/{accountReference}/subscriptions/native-billing/roku",
    "name": "Replicate Roku subscription within eSuite",
    "method": "POST",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "accountReference",
          "type": "string",
          "description": "Account reference identifier."
        }
      ],
      "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": "rokuTransactionId",
              "type": "string",
              "example": "",
              "description": "The roku transaction ID that is to be validated."
            }
          ],
          "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.RokuValidateTransactionForSessionRequest",
          "customType": "FictiveGlobal.Api.Rest.Dtos.v1.RokuValidateTransactionForSessionRequest",
          "isExpanded": true,
          "description": "DTO for Roku Validate Transaction API Requests"
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "• Not Authorized",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will provide the ability to create a subscription against a pre-existing eSuite account that has been purchased via the native Roku channel",
    "examples": {
      "languages": [
        {
          "id": "TRKF2jyB20vybmZkrlfk6",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.fictive.com/REST/api/accounts/{accountReference}/subscriptions/native-billing/roku \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "1glN-PdaaUV9jvC28KnJP",
          "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/{accountReference}/subscriptions/native-billing/roku\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "aF-IYPq62bt7exXplG4Nd",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/accounts/{accountReference}/subscriptions/native-billing/roku\")\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": "m-f9gnUQdL0jNeTjaPc-Q",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts/{accountReference}/subscriptions/native-billing/roku\"\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": "TRKF2jyB20vybmZkrlfk6"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-401",
          "language": "401",
          "code": "// • Not Authorized\n"
        }
      ],
      "selectedLanguageId": "response-0-401"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}