OpenMeter Billing Settings

Update a billing invoice

Changed on

Update a billing invoice.

Only the mutable fields of the invoice can be edited: description, labels, supplier, customer, workflow settings, and top-level lines. Top-level lines are matched by id; lines without an id are created, and existing lines omitted from lines are deleted. Detailed (child) lines are always computed and cannot be edited directly. Only invoices in draft status can be updated.

put/v3/openmeter/billing/invoices/{invoiceId}

Request

  • Base URL: https://global.api.konghq.com
  • URL: https://global.api.konghq.com/v3/openmeter/billing/invoices/{invoiceId}
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer
    • HTTP bearer
    • HTTP bearer

Path parameters

invoiceIdstring required

ULID (Universally Unique Lexicographically Sortable Identifier).

Example:01G65Z755AFWAKHE12NY0CQ9FH

Request body

descriptionstring

Optional description of the resource.

Maximum 1024 characters.

labelsLabels

Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.

Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".

type'standard' required

Discriminator field identifying this as a standard invoice.

Example request

{
  "labels": {
    "env": "test"
  },
  "supplier": {
    "addresses": {
      "billing_address": {
        "country": "US"
      }
    }
  },
  "customer": {
    "billing_address": {
      "country": "US"
    },
    "id": "01G65Z755AFWAKHE12NY0CQ9FH",
    "key": "019ae40f-4258-7f15-9491-842f42a7d6ac"
  },
  "workflow": {
    "workflow": {
      "invoicing": {
        "draft_period": "P1D"
      },
      "payment": {
        "due_after": "P30D"
      }
    }
  },
  "lines": [
    {
      "labels": {
        "env": "test"
      },
      "id": "01G65Z755AFWAKHE12NY0CQ9FH",
      "service_period": {
        "from": "2023-01-01T01:01:01.001Z",
        "to": "2023-01-01T01:01:01.001Z"
      },
      "rate_card": {
        "tax_config": {
          "code": {
            "id": "01G65Z755AFWAKHE12NY0CQ9FH"
          }
        },
        "feature_key": "resource_key"
      }
    }
  ]
}

Response

Invoice updated response.

idstring required

ULID (Universally Unique Lexicographically Sortable Identifier).

descriptionstring

Optional description of the resource.

Maximum 1024 characters.

labelsLabels

Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.

Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".

created_atstring date-time required

An ISO-8601 timestamp representation of entity creation date.

updated_atstring date-time required

An ISO-8601 timestamp representation of entity last update date.

deleted_atstring date-time

An ISO-8601 timestamp representation of entity deletion date.

numberstring required

Human-readable invoice number generated by the invoicing app.

currencystring required

Three-letter ISO 4217 currency code for the invoice.

type'standard' required

Discriminator field identifying this as a standard invoice.

status'draft' | 'issuing' | 'issued' | 'payment_processing' | 'overdue' | 'paid' | 'uncollectible' | 'voided' required

Current lifecycle status of the invoice.

issued_atstring date-time

Timestamp when the invoice was issued to the customer.

draft_untilstring date-time

Timestamp until which the invoice remains in draft state.

The invoice advances automatically once this time is reached.

quantity_snapshotted_atstring date-time

Timestamp when usage quantities were last snapshotted for this invoice.

collection_atstring date-time

Timestamp when collection was initiated for this invoice.

due_atstring date-time

Timestamp when payment is due.

sent_to_customer_atstring date-time

Timestamp when the invoice was sent to the customer.

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 / response property oneOf list for the response status

    • warning

      added the new key_invalid enum value to the ////// response property for the response status

    • warning

      added the new unique enum value to the ////// response property for the response status

    • info

      endpoint added