---
title: Get Magic Link with Template
slug: get-magic-link-with-template
docTags: 
createdAt: 2026-08-25T19:28:59.170Z
---

{
  "id": "XP1aQF1ZkUyBXEYoaovIk",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.nue.io/orders/magiclink/{objectType}/{objectId}/template/{templateId}",
    "servers": [
      {
        "url": "https://api.nue.io/orders/magiclink/{objectType}/{objectId}/template/{templateId}",
        "description": "Nue Production API Endpoint"
      },
      {
        "url": "https://api.sandbox.nue.io/orders/magiclink/{objectType}/{objectId}/template/{templateId}",
        "description": "Nue Sandbox API Endpoint"
      }
    ],
    "name": "Get Magic Link with Template",
    "description": "<p>Get a magic link URL for rendering the presentation view of the specified object record type, including Quote, Order, Invoice, Credit Memo, and Payment Link, with a specific template.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "objectType",
          "type": "string",
          "description": "",
          "enum": [
            "invoice",
            "credit-memo",
            "order",
            "quote",
            "payment-link"
          ]
        },
        {
          "kind": "required",
          "name": "objectId",
          "type": "string",
          "description": ""
        },
        {
          "kind": "required",
          "name": "templateId",
          "type": "string",
          "description": ""
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json",
            "*/*"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "internal",
          "type": "boolean",
          "description": ""
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKeyAuth",
          "name": "nue-api-key",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "magicLink",
                "kind": "optional",
                "type": "string",
                "description": "<p>Magic-link URL that renders the presentation view of the requested object using the specified template.</p>"
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Bad Request",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "title",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "errorCode",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Not Found",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "vahi7ZttIzzN-AEc4WmTu",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.nue.io/orders/magiclink/{objectType}/{objectId}/template/{templateId} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "2d_I2lntmZiS9ivHb1VSl",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.nue.io/orders/magiclink/{objectType}/{objectId}/template/{templateId}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "te3iwMNQ8IrXHn-1WYgVL",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.nue.io/orders/magiclink/{objectType}/{objectId}/template/{templateId}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "O0gDOq5Szxyx5g0I_qwkR",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.nue.io/orders/magiclink/{objectType}/{objectId}/template/{templateId}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "vahi7ZttIzzN-AEc4WmTu"
    },
    "results": {
      "languages": [
        {
          "id": "NhZ6r302Am3_AdWyYs3W-",
          "language": "200",
          "code": "// OK\n{\n  \"magicLink\": \"\"\n}"
        },
        {
          "id": "4qWRG3v4lU9fihFAuI_Ph",
          "language": "400",
          "code": "// Bad Request\n{\n  \"title\": \"\",\n  \"message\": \"\",\n  \"errorCode\": \"\"\n}"
        },
        {
          "id": "zcV8Nuo3ytpEUxuPQp0QD",
          "language": "404",
          "code": "// Not Found\n"
        }
      ],
      "selectedLanguageId": "NhZ6r302Am3_AdWyYs3W-"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}