---
title: Create a subscription
slug: amberflo-api/create-a-subscription
docTags: 
createdAt: 2024-11-07T15:10:16.976Z
---

{
  "id": "01SMqgvcMfBCOyKgUnOLV",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.amberflo.io/payments/pricing/amberflo/customer-prepaid-subscription",
    "servers": [
      {
        "url": "https://app.amberflo.io/payments/pricing/amberflo/customer-prepaid-subscription"
      }
    ],
    "name": "Create a subscription",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "payment.meters.IngestMessage.in",
          "schema": [
            {
              "name": "uniqueId",
              "kind": "optional",
              "type": "string",
              "example": ""
            },
            {
              "name": "meterApiName",
              "kind": "optional",
              "type": "string",
              "example": ""
            },
            {
              "name": "meterValue",
              "kind": "optional",
              "type": "number",
              "example": ""
            },
            {
              "name": "meterTimeInMillis",
              "kind": "optional",
              "type": "integer<int64>",
              "example": 0
            },
            {
              "name": "customerName",
              "kind": "optional",
              "type": "string",
              "example": ""
            },
            {
              "name": "customerId",
              "kind": "optional",
              "type": "string",
              "example": ""
            },
            {
              "name": "customerType",
              "kind": "optional",
              "type": "string",
              "example": ""
            },
            {
              "name": "dimensions",
              "kind": "optional",
              "type": "map",
              "example": "",
              "customType": "map<string, string>",
              "schema": []
            }
          ],
          "modelRef": "#/components/schemas/payment.meters.IngestMessage.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": "payment.meters.IngestMessage.out",
            "schema": [
              {
                "name": "uniqueId",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "meterApiName",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "meterValue",
                "kind": "optional",
                "type": "number",
                "example": ""
              },
              {
                "name": "meterTimeInMillis",
                "kind": "optional",
                "type": "integer<int64>",
                "example": 0
              },
              {
                "name": "customerName",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "customerId",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "customerType",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "dimensions",
                "kind": "optional",
                "type": "map",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/payment.meters.IngestMessage.out",
            "isExpanded": true
          }
        ]
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "5I-_jCEIWhi1fgxOY-mxS",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://app.amberflo.io/payments/pricing/amberflo/customer-prepaid-subscription \\\n     --header 'accept: application/json'"
        },
        {
          "id": "dXoVAh9ERmFlJgFes8lD5",
          "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/payments/pricing/amberflo/customer-prepaid-subscription\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "p8pPbfcnUpuB76i8EO307",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://app.amberflo.io/payments/pricing/amberflo/customer-prepaid-subscription\")\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": "mzPkaPcBk-Gzqw06vh6PI",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/payments/pricing/amberflo/customer-prepaid-subscription\"\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": "5I-_jCEIWhi1fgxOY-mxS"
    },
    "results": {
      "languages": [
        {
          "id": "Y4PUcywAEgY2Sxi-9amNV",
          "language": "200",
          "code": "// Successful request\n{\n  \"uniqueId\": \"\",\n  \"meterApiName\": \"\",\n  \"meterValue\": 0,\n  \"meterTimeInMillis\": \"\",\n  \"customerName\": \"\",\n  \"customerId\": \"\",\n  \"customerType\": \"\",\n  \"dimensions\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "Y4PUcywAEgY2Sxi-9amNV"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}