---
title: Fetch Credit Stats
slug: fetch-credit-stats
docTags: 
createdAt: 2026-08-25T19:28:59.170Z
---

{
  "id": "_7mjywrhZB_HHVF-dVqSr",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.nue.io/customers/{customerId}/credit-stats",
    "servers": [
      {
        "url": "https://api.nue.io/customers/{customerId}/credit-stats",
        "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/customers/{customerId}/credit-stats",
        "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 Credit Stats",
    "description": "Retrieves aggregated credit statistics for a customer's account credit pools. Returns individual pool statistics and a combined summary across all requested pools. Supports fetching stats for up to 50 pools in a single request.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "customerId",
          "type": "string",
          "description": "<p>The unique identifier of the customer (UUID or Salesforce ID)</p>"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "required",
          "name": "accountPoolIds",
          "type": "string",
          "description": "<p>JSON-encoded array of account credit pool IDs to get statistics for (max 50). Example: [\"pool-id-1\",\"pool-id-2\"]</p>"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "ApiKeyAuth",
          "name": "nue-api-key",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successfully retrieved credit statistics",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"status\":\"SUCCESS\",\"data\":{\"accountCreditPoolStats\":{\"474935a8-16cc-46a6-927d-74c962cf460f\":{\"accountBalance\":240000,\"activeCredits\":240000,\"canceledCredits\":0,\"committed\":true,\"consumedCredits\":0,\"creditBackCredits\":0,\"creditPool\":[\"Default Committed Credit Pool\"],\"creditType\":\"Cash\",\"creditTypeLabel\":\"Cash\",\"currencyIsoCode\":\"USD\",\"expiredCredits\":0,\"isCash\":true,\"pendingCredits\":0,\"totalBalance\":240000,\"totalGrantCredits\":240000}},\"summary\":{\"accountBalance\":240000,\"creditPool\":[\"Default Committed Credit Pool\"],\"totalGrantCredits\":240000,\"expiredCredits\":0,\"consumedCredits\":0,\"canceledCredits\":0,\"creditBackCredits\":0,\"activeCredits\":240000,\"pendingCredits\":0,\"totalBalance\":240000}},\"warnings\":[]}",
            "description": "",
            "schema": [
              {
                "name": "status",
                "kind": "optional",
                "type": "string<SUCCESS>",
                "description": "",
                "enum": [
                  "SUCCESS"
                ]
              },
              {
                "name": "data",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": [
                  {
                    "name": "accountCreditPoolStats",
                    "kind": "optional",
                    "type": "map",
                    "description": "Statistics keyed by account credit pool ID",
                    "example": "",
                    "customType": "map<string, object>",
                    "schema": []
                  },
                  {
                    "name": "summary",
                    "kind": "optional",
                    "type": "object",
                    "description": "Aggregated summary across all requested pools",
                    "example": "",
                    "schema": [
                      {
                        "name": "accountBalance",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      },
                      {
                        "name": "creditPool",
                        "kind": "optional",
                        "type": "array",
                        "description": "",
                        "example": "",
                        "itemType": "string",
                        "customType": "string[]",
                        "itemExample": "",
                        "itemDefault": ""
                      },
                      {
                        "name": "totalGrantCredits",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      },
                      {
                        "name": "expiredCredits",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      },
                      {
                        "name": "consumedCredits",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      },
                      {
                        "name": "canceledCredits",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      },
                      {
                        "name": "creditBackCredits",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      },
                      {
                        "name": "activeCredits",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      },
                      {
                        "name": "pendingCredits",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      },
                      {
                        "name": "totalBalance",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      }
                    ]
                  }
                ]
              },
              {
                "name": "warnings",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "code",
                    "kind": "optional",
                    "type": "string",
                    "description": "Warning code."
                  },
                  {
                    "name": "message",
                    "kind": "optional",
                    "type": "string",
                    "description": "<p>Human-readable warning message.</p>"
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "207",
        "description": "<p>Partial Success - Some pools were retrieved, some failed</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "status",
                "kind": "optional",
                "type": "string<PARTIAL_SUCCESS>",
                "description": "",
                "enum": [
                  "PARTIAL_SUCCESS"
                ]
              },
              {
                "name": "data",
                "kind": "optional",
                "type": "map",
                "description": "<p>Aggregated credit statistics for the customer, per credit type / pool.</p>",
                "example": "",
                "customType": "map<string, string>",
                "schema": [
                  {
                    "name": "accountBalance",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "creditPool",
                    "kind": "optional",
                    "type": "array",
                    "description": "",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  },
                  {
                    "name": "totalGrantCredits",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "expiredCredits",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "consumedCredits",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "canceledCredits",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "creditBackCredits",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "activeCredits",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "pendingCredits",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "isCash",
                    "kind": "optional",
                    "type": "boolean",
                    "description": ""
                  },
                  {
                    "name": "creditType",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "creditTypeLabel",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "currencyIsoCode",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "committed",
                    "kind": "optional",
                    "type": "boolean",
                    "description": ""
                  }
                ]
              },
              {
                "name": "warnings",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "code",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "message",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "<p>Bad Request - Missing or invalid accountPoolIds parameter</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ErrorResponse",
            "schema": [
              {
                "name": "status",
                "kind": "required",
                "type": "string<FAILURE>",
                "description": "Status of the request",
                "enum": [
                  "FAILURE"
                ]
              },
              {
                "name": "errorType",
                "kind": "optional",
                "type": "string<NOT_FOUND | INVALID_PARAMETER | MISSING_PARAMETER | INVALID_ARGUMENT | AUTHENTICATION_ERROR>",
                "description": "Type of error that occurred",
                "enum": [
                  "NOT_FOUND",
                  "INVALID_PARAMETER",
                  "MISSING_PARAMETER",
                  "INVALID_ARGUMENT",
                  "AUTHENTICATION_ERROR"
                ]
              },
              {
                "name": "errorCode",
                "kind": "optional",
                "type": "string<MISSING_DETAILS_FETCH_PARAMETER | MISSING_FETCH_PARAMETER | INVALID_CUSTOMER_IDS_FORMAT | INVALID_PARAMETER_COMBINATION | ORDER_UNKNOWN_FIELD | CUSTOMER_NOT_FOUND | MISSING_AUTH_METHOD | INSUFFICIENT_PERMISSIONS | INVALID_JSON>",
                "description": "Specific error code for the failure",
                "enum": [
                  "MISSING_DETAILS_FETCH_PARAMETER",
                  "MISSING_FETCH_PARAMETER",
                  "INVALID_CUSTOMER_IDS_FORMAT",
                  "INVALID_PARAMETER_COMBINATION",
                  "ORDER_UNKNOWN_FIELD",
                  "CUSTOMER_NOT_FOUND",
                  "MISSING_AUTH_METHOD",
                  "INSUFFICIENT_PERMISSIONS",
                  "INVALID_JSON"
                ]
              },
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "<p>Human-readable error message</p>"
              }
            ],
            "modelRef": "#/components/schemas/ErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "<p>Unauthorized - Authentication information is missing or invalid</p>",
        "jsonExample": "",
        "isExpanded": true,
        "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 - Customer or all pools not found</p>",
        "jsonExample": "",
        "isExpanded": true,
        "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": "5QKA8VrqM7QZrtmGuNpoT",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url 'https://api.nue.io/customers/{customerId}/credit-stats?accountPoolIds=string' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "jpaFfidcBXd3sNYmfsCyt",
          "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/customers/{customerId}/credit-stats?accountPoolIds=string\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "u-G0WJIyOTXCLcX-sbCah",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.nue.io/customers/{customerId}/credit-stats?accountPoolIds=string\")\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": "eWwATWZSrgMIKsPmYjGvi",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.nue.io/customers/{customerId}/credit-stats?accountPoolIds=string\"\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": "5QKA8VrqM7QZrtmGuNpoT"
    },
    "results": {
      "languages": [
        {
          "id": "UdzPmeRLF4u8oIlxnQLoe",
          "language": "200",
          "code": "// Successfully retrieved credit statistics\n{\n  \"status\": \"\",\n  \"data\": {\n    \"accountCreditPoolStats\": \"\",\n    \"summary\": {\n      \"accountBalance\": 0,\n      \"creditPool\": [\n        \"\"\n      ],\n      \"totalGrantCredits\": 0,\n      \"expiredCredits\": 0,\n      \"consumedCredits\": 0,\n      \"canceledCredits\": 0,\n      \"creditBackCredits\": 0,\n      \"activeCredits\": 0,\n      \"pendingCredits\": 0,\n      \"totalBalance\": 0\n    }\n  },\n  \"warnings\": [\n    {\n      \"code\": \"\",\n      \"message\": \"\"\n    }\n  ]\n}"
        },
        {
          "id": "_UFXN3TQTPXysIWi1zUwY",
          "language": "207",
          "code": "// Partial Success - Some pools were retrieved, some failed\n{\n  \"status\": \"\",\n  \"data\": \"\",\n  \"warnings\": [\n    {\n      \"code\": \"\",\n      \"message\": \"\"\n    }\n  ]\n}"
        },
        {
          "id": "OUMvMJvYsb-n7fornqaEe",
          "language": "400",
          "code": "// Bad Request - Missing or invalid accountPoolIds parameter\n{\n  \"status\": \"\",\n  \"errorType\": \"\",\n  \"errorCode\": \"\",\n  \"message\": \"\"\n}"
        },
        {
          "id": "IXTu8_Gg4ZL8EOVweca3R",
          "language": "401",
          "code": "// Unauthorized - Authentication information is missing or invalid\n{\n  \"status\": \"\",\n  \"error\": \"\",\n  \"errorCode\": \"\",\n  \"errorType\": \"\",\n  \"message\": \"\"\n}"
        },
        {
          "id": "hVLu9CF_cI1WimEyInyxc",
          "language": "404",
          "code": "// Not Found - Customer or all pools not found\n{\n  \"status\": 0,\n  \"error\": \"\",\n  \"message\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "UdzPmeRLF4u8oIlxnQLoe"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}