OpenMeter Billing Settings

Snapshot quantities for usage based line items

Changed on

Snapshot quantities for usage-based line items.

This call will snapshot the quantities for all usage based line items in the invoice.

This call is only valid in draft.waiting_for_collection status, where the collection period can be skipped using this action.

post/v3/openmeter/billing/invoices/{invoiceId}/snapshot-quantities

Request

  • Base URL
    https://global.api.konghq.com
  • Auth
    • HTTP bearer
    • or HTTP bearer
    • or HTTP bearer
    • or HTTP bearer

Path parameters

invoiceId, string required

ULID (Universally Unique Lexicographically Sortable Identifier).

Example:01G65Z755AFWAKHE12NY0CQ9FH

Response

The updated invoice with the snapshot quantities for usage based line items.

BillingInvoice required

An invoice issued to a customer.

The type field determines the concrete variant:

  • standard: a standard invoice for charges owed.

Example response

{
  "id": "01G65Z755AFWAKHE12NY0CQ9FH",
  "labels": {
    "env": "test"
  },
  "created_at": "2023-01-01T01:01:01.001Z",
  "updated_at": "2023-01-01T01:01:01.001Z",
  "deleted_at": "2023-01-01T01:01:01.001Z",
  "number": "INV-2024-01-01-01",
  "currency": "USD",
  "supplier": {
    "addresses": {
      "billing_address": {
        "country": "US"
      }
    }
  },
  "customer": {
    "billing_address": {
      "country": "US"
    },
    "id": "01G65Z755AFWAKHE12NY0CQ9FH",
    "key": "019ae40f-4258-7f15-9491-842f42a7d6ac"
  },
  "service_period": {
    "from": "2023-01-01T01:01:01.001Z",
    "to": "2023-01-01T01:01:01.001Z"
  },
  "issued_at": "2023-01-01T01:01:01.001Z",
  "draft_until": "2023-01-01T01:01:01.001Z",
  "quantity_snapshotted_at": "2023-01-01T01:01:01.001Z",
  "collection_at": "2023-01-01T01:01:01.001Z",
  "due_at": "2023-01-01T01:01:01.001Z",
  "sent_to_customer_at": "2023-01-01T01:01:01.001Z",
  "workflow": {
    "apps": {
      "tax": {
        "id": "01G65Z755AFWAKHE12NY0CQ9FH"
      },
      "invoicing": {
        "id": "01G65Z755AFWAKHE12NY0CQ9FH"
      },
      "payment": {
        "id": "01G65Z755AFWAKHE12NY0CQ9FH"
      }
    },
    "source_billing_profile": {
      "id": "01G65Z755AFWAKHE12NY0CQ9FH"
    },
    "workflow": {
      "invoicing": {
        "draft_period": "P1D",
        "due_after": "P30D"
      },
      "payment": {
        "due_after": "P30D"
      }
    }
  },
  "lines": [
    {
      "labels": {
        "env": "test"
      },
      "created_at": "2023-01-01T01:01:01.001Z",
      "updated_at": "2023-01-01T01:01:01.001Z",
      "deleted_at": "2023-01-01T01:01:01.001Z",
      "id": "01G65Z755AFWAKHE12NY0CQ9FH",
      "service_period": {
        "from": "2023-01-01T01:01:01.001Z",
        "to": "2023-01-01T01:01:01.001Z"
      },
      "discounts": {
        "amount": [
          {
            "id": "01G65Z755AFWAKHE12NY0CQ9FH"
          }
        ],
        "usage": [
          {
            "id": "01G65Z755AFWAKHE12NY0CQ9FH"
          }
        ]
      },
      "subscription": {
        "id": "01G65Z755AFWAKHE12NY0CQ9FH",
        "phase": {
          "id": "01G65Z755AFWAKHE12NY0CQ9FH",
          "item": {
            "id": "01G65Z755AFWAKHE12NY0CQ9FH"
          }
        }
      },
      "rate_card": {
        "tax_config": {
          "code": {
            "id": "01G65Z755AFWAKHE12NY0CQ9FH"
          }
        },
        "feature_key": "resource_key"
      },
      "detailed_lines": [
        {
          "id": "01G65Z755AFWAKHE12NY0CQ9FH",
          "labels": {
            "env": "test"
          },
          "created_at": "2023-01-01T01:01:01.001Z",
          "updated_at": "2023-01-01T01:01:01.001Z",
          "deleted_at": "2023-01-01T01:01:01.001Z",
          "service_period": {
            "from": "2023-01-01T01:01:01.001Z",
            "to": "2023-01-01T01:01:01.001Z"
          },
          "discounts": {
            "amount": [
              {
                "id": "01G65Z755AFWAKHE12NY0CQ9FH"
              }
            ],
            "usage": [
              {
                "id": "01G65Z755AFWAKHE12NY0CQ9FH"
              }
            ]
          }
        }
      ],
      "charge": {
        "id": "01G65Z755AFWAKHE12NY0CQ9FH"
      }
    }
  ]
}

Changes

    • breaking

      added to the invalid_parameters/items response property oneOf list for the response status

    • warning

      added the new key_invalid enum value to the invalid_parameters/items/oneOf[#/components/schemas/InvalidParameterStandard]/rule response property for the response status

    • warning

      added the new unique enum value to the invalid_parameters/items/oneOf[#/components/schemas/InvalidParameterStandard]/rule response property for the response status