---
title: Get credits ledger
slug: amberflo-api/get-credits-ledger
docTags: 
createdAt: 2024-11-07T15:10:16.975Z
---

{
  "id": "6cJERW2I1wCqX9xZimgzR",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://app.amberflo.io/payments/billing/credits-ledger",
    "servers": [
      {
        "url": "https://app.amberflo.io/payments/billing/credits-ledger"
      }
    ],
    "name": "Get credits ledger",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "X-API-KEY",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful request",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "payment.billing.prepaid_to_product.detailed.DetailedPrepaidLedger.out[]",
            "schema": [
              {
                "name": "accountId",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "customerId",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "currency",
                "kind": "optional",
                "type": "string",
                "description": "Currency code in ISO 4217 format.",
                "example": "USD"
              },
              {
                "name": "availableAmount",
                "kind": "optional",
                "type": "number",
                "example": ""
              },
              {
                "name": "consumedAmount",
                "kind": "optional",
                "type": "number",
                "example": ""
              },
              {
                "name": "expiredAmount",
                "kind": "optional",
                "type": "number",
                "example": ""
              },
              {
                "name": "totalAmount",
                "kind": "optional",
                "type": "number",
                "example": ""
              },
              {
                "name": "pastEntries",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/payment.billing.prepaid_to_product.detailed.DetailedPrepaidLedgerEntry.out",
                "customType": "payment.billing.prepaid_to_product.detailed.DetailedPrepaidLedgerEntry.out[]",
                "schema": [
                  {
                    "name": "prepaidUri",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "prepaidLabel",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "invoiceUri",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "transactionTimeSeconds",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "example": 0
                  },
                  {
                    "name": "transactionAmount",
                    "kind": "optional",
                    "type": "number",
                    "example": ""
                  },
                  {
                    "name": "balanceAfterTransaction",
                    "kind": "optional",
                    "type": "number",
                    "example": ""
                  },
                  {
                    "name": "prepaidCardType",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "modelRef": "#/components/schemas/payment.billing.prepaid_to_product.PrepaidCardType.out",
                    "customType": "payment.billing.prepaid_to_product.PrepaidCardType.out",
                    "schema": []
                  },
                  {
                    "name": "prepaidTransactionType",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "modelRef": "#/components/schemas/payment.billing.prepaid_to_product.PrepaidTransactionType.out",
                    "customType": "payment.billing.prepaid_to_product.PrepaidTransactionType.out",
                    "schema": []
                  }
                ]
              },
              {
                "name": "currentEntries",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/payment.billing.prepaid_to_product.detailed.DetailedPrepaidLedgerEntry.out",
                "customType": "payment.billing.prepaid_to_product.detailed.DetailedPrepaidLedgerEntry.out[]",
                "schema": [
                  {
                    "name": "prepaidUri",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "prepaidLabel",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "invoiceUri",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "name": "transactionTimeSeconds",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "example": 0
                  },
                  {
                    "name": "transactionAmount",
                    "kind": "optional",
                    "type": "number",
                    "example": ""
                  },
                  {
                    "name": "balanceAfterTransaction",
                    "kind": "optional",
                    "type": "number",
                    "example": ""
                  },
                  {
                    "name": "prepaidCardType",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "modelRef": "#/components/schemas/payment.billing.prepaid_to_product.PrepaidCardType.out",
                    "customType": "payment.billing.prepaid_to_product.PrepaidCardType.out",
                    "schema": []
                  },
                  {
                    "name": "prepaidTransactionType",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "modelRef": "#/components/schemas/payment.billing.prepaid_to_product.PrepaidTransactionType.out",
                    "customType": "payment.billing.prepaid_to_product.PrepaidTransactionType.out",
                    "schema": []
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/payment.billing.prepaid_to_product.detailed.DetailedPrepaidLedger.out",
            "isExpanded": true
          }
        ]
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "5pI9KuJcjyjst5VikgJK4",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://app.amberflo.io/payments/billing/credits-ledger \\\n     --header 'accept: application/json'"
        },
        {
          "id": "g9wcn_EAZIlAArYzWmlU7",
          "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://app.amberflo.io/payments/billing/credits-ledger\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "i3ZP5QXswe08h5uXmBwph",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://app.amberflo.io/payments/billing/credits-ledger\")\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": "qaKbGq_GdNNcts6GRuT3w",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/payments/billing/credits-ledger\"\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": "5pI9KuJcjyjst5VikgJK4"
    },
    "results": {
      "languages": [
        {
          "id": "V95Ti9hmNv2Z4Mcad6IjL",
          "language": "200",
          "code": "// Successful request\n[\n  {\n    \"accountId\": \"\",\n    \"customerId\": \"\",\n    \"currency\": \"USD\",\n    \"availableAmount\": 0,\n    \"consumedAmount\": 0,\n    \"expiredAmount\": 0,\n    \"totalAmount\": 0,\n    \"pastEntries\": [\n      {\n        \"prepaidUri\": \"\",\n        \"prepaidLabel\": \"\",\n        \"invoiceUri\": \"\",\n        \"transactionTimeSeconds\": \"\",\n        \"transactionAmount\": 0,\n        \"balanceAfterTransaction\": 0,\n        \"prepaidCardType\": \"\",\n        \"prepaidTransactionType\": \"\"\n      }\n    ],\n    \"currentEntries\": [\n      {\n        \"prepaidUri\": \"\",\n        \"prepaidLabel\": \"\",\n        \"invoiceUri\": \"\",\n        \"transactionTimeSeconds\": \"\",\n        \"transactionAmount\": 0,\n        \"balanceAfterTransaction\": 0,\n        \"prepaidCardType\": \"\",\n        \"prepaidTransactionType\": \"\"\n      }\n    ]\n  }\n]"
        }
      ],
      "selectedLanguageId": "V95Ti9hmNv2Z4Mcad6IjL"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}