---
title: Add or update invoice
slug: amberflo-api/NJZ4-add-or-update-invoice
docTags: 
createdAt: 2024-11-07T15:10:16.980Z
---

{
  "id": "q_QjS5L3Sk14GVBwd1pe1",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.amberflo.io/integration/datastore/csv-invoice/create",
    "servers": [
      {
        "url": "https://app.amberflo.io/integration/datastore/csv-invoice/create"
      }
    ],
    "name": "Add or update invoice",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "com.amberflo.integration.datastore.QueryableInvoiceCreationRequest.in",
          "schema": [
            {
              "name": "queryableInvoiceList",
              "kind": "optional",
              "type": "array",
              "description": "",
              "modelRef": "#/components/schemas/com.amberflo.integration.datastore.QueryableInvoice.in",
              "customType": "com.amberflo.integration.datastore.QueryableInvoice.in[]",
              "schema": [
                {
                  "name": "customerProductInvoiceKey",
                  "kind": "optional",
                  "type": "object",
                  "description": "",
                  "modelRef": "#/components/schemas/payment.billing.CustomerProductInvoiceKey.in",
                  "customType": "payment.billing.CustomerProductInvoiceKey.in",
                  "schema": [
                    {
                      "name": "accountId",
                      "kind": "optional",
                      "type": "string",
                      "example": ""
                    },
                    {
                      "name": "customerId",
                      "kind": "optional",
                      "type": "string",
                      "example": ""
                    },
                    {
                      "name": "productId",
                      "kind": "optional",
                      "type": "string",
                      "example": ""
                    },
                    {
                      "name": "productPlanId",
                      "kind": "optional",
                      "type": "string",
                      "example": ""
                    },
                    {
                      "name": "year",
                      "kind": "optional",
                      "type": "integer<int32>",
                      "example": 0
                    },
                    {
                      "name": "month",
                      "kind": "optional",
                      "type": "integer<int32>",
                      "example": 0
                    },
                    {
                      "name": "day",
                      "kind": "optional",
                      "type": "integer<int32>",
                      "example": 0
                    }
                  ]
                }
              ]
            }
          ],
          "modelRef": "#/components/schemas/com.amberflo.integration.datastore.QueryableInvoiceCreationRequest.in",
          "isExpanded": true
        }
      ],
      "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": "object",
            "description": "",
            "customType": "com.amberflo.integration.datastore.QueryableInvoiceCreationResponse.out",
            "schema": [
              {
                "name": "queryableInvoiceList",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/com.amberflo.integration.datastore.QueryableInvoice.out",
                "customType": "com.amberflo.integration.datastore.QueryableInvoice.out[]",
                "schema": [
                  {
                    "name": "customerProductInvoiceKey",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/components/schemas/payment.billing.CustomerProductInvoiceKey.out",
                    "customType": "payment.billing.CustomerProductInvoiceKey.out",
                    "schema": [
                      {
                        "name": "accountId",
                        "kind": "optional",
                        "type": "string",
                        "example": ""
                      },
                      {
                        "name": "customerId",
                        "kind": "optional",
                        "type": "string",
                        "example": ""
                      },
                      {
                        "name": "productId",
                        "kind": "optional",
                        "type": "string",
                        "example": ""
                      },
                      {
                        "name": "productPlanId",
                        "kind": "optional",
                        "type": "string",
                        "example": ""
                      },
                      {
                        "name": "year",
                        "kind": "optional",
                        "type": "integer<int32>",
                        "example": 0
                      },
                      {
                        "name": "month",
                        "kind": "optional",
                        "type": "integer<int32>",
                        "example": 0
                      },
                      {
                        "name": "day",
                        "kind": "optional",
                        "type": "integer<int32>",
                        "example": 0
                      }
                    ]
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/com.amberflo.integration.datastore.QueryableInvoiceCreationResponse.out",
            "isExpanded": true
          }
        ]
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "g2y5cwOuRspBkwu1_xbo9",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://app.amberflo.io/integration/datastore/csv-invoice/create \\\n     --header 'accept: application/json'"
        },
        {
          "id": "vUCB4VpplhtKaG-2sdCZy",
          "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: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://app.amberflo.io/integration/datastore/csv-invoice/create\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "0Pu39LAlFSRaQmJu9_PHf",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://app.amberflo.io/integration/datastore/csv-invoice/create\")\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\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "Z4kou-0gmR-2X589rt2u0",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/integration/datastore/csv-invoice/create\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "g2y5cwOuRspBkwu1_xbo9"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Successful request\n{\n  \"queryableInvoiceList\": [\n    {\n      \"customerProductInvoiceKey\": {\n        \"accountId\": \"\",\n        \"customerId\": \"\",\n        \"productId\": \"\",\n        \"productPlanId\": \"\",\n        \"year\": \"\",\n        \"month\": \"\",\n        \"day\": \"\"\n      }\n    }\n  ]\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}