---
title: Fetch Customer Orders
slug: fetch-customer-orders
docTags: 
createdAt: 2026-08-25T19:28:59.170Z
---

{
  "id": "3lA5R-LphmbZ1oGf3YKg1",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.nue.io/orders",
    "servers": [
      {
        "url": "https://api.nue.io/orders",
        "description": "**Production Environment** - Live production server for all customer-facing operations. Use this for production integrations with real customer data and transactions."
      },
      {
        "url": "https://api.sandbox.nue.io/orders",
        "description": "**Sandbox Environment** - Safe testing environment with sample data for development and integration testing. No rate limits apply. Data is reset weekly. Perfect for prototyping and QA testing."
      }
    ],
    "name": "Fetch Customer Orders",
    "description": "This endpoint allows you to retrieve all orders associated with a customer.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "required",
          "name": "customerIds",
          "type": "array",
          "description": "<p>A JSON-encoded array of customerIds to fetch all customer orders for those customers.</p>",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "includes",
          "type": "string",
          "description": "<p>A list of fields to include in the response. Current options are orderProducts, assets, invoices.</p>",
          "enum": [
            "orderProducts",
            "assets",
            "invoices"
          ]
        },
        {
          "kind": "optional",
          "name": "status",
          "type": "string",
          "description": "<p>Filter orders by status. activated, draft, or canceled are valid options.</p>",
          "enum": [
            "activated",
            "draft",
            "canceled"
          ]
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "ApiKeyAuth",
          "name": "nue-api-key",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successfully created order preview",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "status",
                "kind": "optional",
                "type": "string",
                "description": "",
                "example": "SUCCESS"
              },
              {
                "name": "data",
                "kind": "optional",
                "type": "object",
                "description": "Order preview details including pricing and line items",
                "example": "",
                "schema": []
              },
              {
                "name": "warnings",
                "kind": "optional",
                "type": "array",
                "description": "Any warnings generated during order processing",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "itemExample": "",
                "itemDefault": ""
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "<p>Bad Request - Invalid request data</p>",
        "jsonExample": "",
        "isExpanded": true,
        "subExamples": [
          {
            "label": "GENERATED",
            "code": "// Bad Request - Invalid request data\n{\n  \"status\": \"\",\n  \"errorCode\": \"\",\n  \"message\": \"\"\n}"
          },
          {
            "label": "Empty request body",
            "code": "{\n  \"status\": \"FAILURE\",\n  \"errorType\": \"INVALID_ARGUMENT\",\n  \"errorCode\": \"ORDER_EMPTY_BODY\",\n  \"message\": \"Request for creating an order preview has failed. Order details contains validation errors: Payload must contain valid data and cannot be empty (received: '{} (empty map)')\"\n}"
          },
          {
            "label": "Invalid JSON",
            "code": "{\n  \"status\": \"FAILURE\",\n  \"errorCode\": \"INVALID_JSON\",\n  \"message\": \"Invalid JSON in request body. Please check for syntax errors.\"\n}"
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ValidationError",
            "schema": [
              {
                "name": "status",
                "kind": "optional",
                "type": "string<FAILURE>",
                "description": "",
                "enum": [
                  "FAILURE"
                ]
              },
              {
                "name": "errorCode",
                "kind": "optional",
                "type": "string",
                "description": "Specific validation error code"
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "Detailed validation error message"
              }
            ],
            "modelRef": "#/components/schemas/ValidationError",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "<p>Unauthorized - Authentication failed</p>",
        "jsonExample": "",
        "isExpanded": true,
        "subExamples": [
          {
            "label": "GENERATED",
            "code": "// Unauthorized - Authentication failed\n{\n  \"status\": \"\",\n  \"error\": \"\",\n  \"errorCode\": \"\",\n  \"errorType\": \"\",\n  \"message\": \"\"\n}"
          },
          {
            "label": "Missing API key",
            "code": "{\n  \"status\": \"FAILURE\",\n  \"errorCode\": \"MISSING_AUTH_METHOD\",\n  \"errorType\": \"AUTHENTICATION_ERROR\",\n  \"message\": \"No authentication method provided in the request.\"\n}"
          },
          {
            "label": "Invalid API key",
            "code": "{\n  \"status\": 401,\n  \"error\": \"Unauthorized\",\n  \"message\": \"Invalid api key invalid-key\"\n}"
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>Authentication failed — returned with HTTP 401. Two variants occur: a missing key is rejected by the gateway with {status: \"FAILURE\", errorCode, errorType, message}; an invalid key is rejected by the service with {status: 401, error, message}.</p>",
            "customType": "UnauthorizedError",
            "schema": [
              {
                "name": "status",
                "kind": "optional",
                "type": "",
                "description": "<p>HTTP status code (e.g. 401) or the string \"FAILURE\" for gateway-level rejections.</p>"
              },
              {
                "name": "error",
                "kind": "optional",
                "type": "string",
                "description": "<p>Error reason phrase (invalid-key variant).</p>"
              },
              {
                "name": "errorCode",
                "kind": "optional",
                "type": "string",
                "description": "<p>Machine-readable error code, e.g. MISSING_AUTH_METHOD (missing-key variant).</p>"
              },
              {
                "name": "errorType",
                "kind": "optional",
                "type": "string",
                "description": "<p>Error category, e.g. AUTHENTICATION_ERROR (missing-key variant).</p>"
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "<p>Human-readable error message.</p>"
              }
            ],
            "modelRef": "#/components/schemas/UnauthorizedError",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "<p>Not Found - Endpoint not found</p>",
        "jsonExample": "",
        "isExpanded": true,
        "subExamples": [
          {
            "label": "GENERATED",
            "code": "// Not Found - Endpoint not found\n{\n  \"status\": 0,\n  \"error\": \"\",\n  \"message\": \"\"\n}"
          },
          {
            "label": "Endpoint not found",
            "code": "{\n  \"timestamp\": \"2025-06-17T19:25:53.449+00:00\",\n  \"path\": \"/nonexistent-endpoint\",\n  \"status\": 404,\n  \"error\": \"Not Found\",\n  \"requestId\": \"7acde796-25009\"\n}"
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>The requested resource was not found — returned with HTTP 404.</p>",
            "customType": "NotFoundError",
            "schema": [
              {
                "name": "status",
                "kind": "optional",
                "type": "integer",
                "description": "HTTP status code."
              },
              {
                "name": "error",
                "kind": "optional",
                "type": "string",
                "description": "Error reason phrase."
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "<p>Human-readable error message.</p>"
              }
            ],
            "modelRef": "#/components/schemas/NotFoundError",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "bBVejV-Ci_A2diKUbJ0bI",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url 'https://api.nue.io/orders?customerIds=array' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "Wh4BmVgQ6Xozxn_HZpfJu",
          "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?customerIds=array\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "VfVM2R2NmuPdiUEkqxuEf",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.nue.io/orders?customerIds=array\")\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": "Eyo39YVqGoaYG0MBpqCcV",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.nue.io/orders?customerIds=array\"\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": "bBVejV-Ci_A2diKUbJ0bI"
    },
    "results": {
      "languages": [
        {
          "id": "MmBTEoLHsEV9N0cVGV4Pt",
          "language": "200",
          "code": "// Successfully created order preview\n{\n  \"status\": \"SUCCESS\",\n  \"data\": {},\n  \"warnings\": [\n    {}\n  ]\n}"
        },
        {
          "id": "90tA9PZW-_jeirGVVT9hP",
          "language": "400",
          "code": "// Bad Request - Invalid request data\n{\n  \"status\": \"\",\n  \"errorCode\": \"\",\n  \"message\": \"\"\n}",
          "subExamples": [
            {
              "label": "GENERATED",
              "code": "// Bad Request - Invalid request data\n{\n  \"status\": \"\",\n  \"errorCode\": \"\",\n  \"message\": \"\"\n}"
            },
            {
              "label": "Empty request body",
              "code": "{\n  \"status\": \"FAILURE\",\n  \"errorType\": \"INVALID_ARGUMENT\",\n  \"errorCode\": \"ORDER_EMPTY_BODY\",\n  \"message\": \"Request for creating an order preview has failed. Order details contains validation errors: Payload must contain valid data and cannot be empty (received: '{} (empty map)')\"\n}"
            },
            {
              "label": "Invalid JSON",
              "code": "{\n  \"status\": \"FAILURE\",\n  \"errorCode\": \"INVALID_JSON\",\n  \"message\": \"Invalid JSON in request body. Please check for syntax errors.\"\n}"
            }
          ]
        },
        {
          "id": "Zzpav_QRkvXEcW4AS8I-l",
          "language": "401",
          "code": "// Unauthorized - Authentication failed\n{\n  \"status\": \"\",\n  \"error\": \"\",\n  \"errorCode\": \"\",\n  \"errorType\": \"\",\n  \"message\": \"\"\n}",
          "subExamples": [
            {
              "label": "GENERATED",
              "code": "// Unauthorized - Authentication failed\n{\n  \"status\": \"\",\n  \"error\": \"\",\n  \"errorCode\": \"\",\n  \"errorType\": \"\",\n  \"message\": \"\"\n}"
            },
            {
              "label": "Missing API key",
              "code": "{\n  \"status\": \"FAILURE\",\n  \"errorCode\": \"MISSING_AUTH_METHOD\",\n  \"errorType\": \"AUTHENTICATION_ERROR\",\n  \"message\": \"No authentication method provided in the request.\"\n}"
            },
            {
              "label": "Invalid API key",
              "code": "{\n  \"status\": 401,\n  \"error\": \"Unauthorized\",\n  \"message\": \"Invalid api key invalid-key\"\n}"
            }
          ]
        },
        {
          "id": "jpqUclnTGXeVJn01BScfy",
          "language": "404",
          "code": "// Not Found - Endpoint not found\n{\n  \"status\": 0,\n  \"error\": \"\",\n  \"message\": \"\"\n}",
          "subExamples": [
            {
              "label": "GENERATED",
              "code": "// Not Found - Endpoint not found\n{\n  \"status\": 0,\n  \"error\": \"\",\n  \"message\": \"\"\n}"
            },
            {
              "label": "Endpoint not found",
              "code": "{\n  \"timestamp\": \"2025-06-17T19:25:53.449+00:00\",\n  \"path\": \"/nonexistent-endpoint\",\n  \"status\": 404,\n  \"error\": \"Not Found\",\n  \"requestId\": \"7acde796-25009\"\n}"
            }
          ]
        }
      ],
      "selectedLanguageId": "MmBTEoLHsEV9N0cVGV4Pt"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}