code: import stripe
  stripe.api_key = "sk_test_your_key"
  
  stripe.Invoice.modify(
    "in_1LSdrX2eZvKYlo2Cy1kxMopu",
    metadata={"order_id": "6735"},
  )
  '''Response {
    "id": "in_1LSdrX2eZvKYlo2Cy1kxMopu",
    "object": "invoice",
    "account_country": "US",
    "account_name": "Stripe.com",
    "account_tax_ids": null,
    "amount_due": 300,
    "amount_paid": 0,
    "amount_remaining": 300,
    "application": null,
    "application_fee_amount": null,
    "attempt_count": 0,
    "attempted": false,
    "auto_advance": true,
    "automatic_tax": {
      "enabled": false,
      "status": null
    },
    "billing_reason": "manual",
    "charge": null,
    "collection_method": "charge_automatically",
    "created": 1659518855,
    "currency": "usd",
    "custom_fields": null,
    "customer": "cus_8TEMHVY5moxIPI",
    "customer_address": null,
    "customer_email": "ava.anderson.22@example.com",
    "customer_name": null,
    "customer_phone": null,
    "customer_shipping": null,
    "customer_tax_exempt": "none",
    "customer_tax_ids": [],
    "default_payment_method": null,
    "default_source": null,
    "default_tax_rates": [],
    "description": null,
    "discount": null,
    "discounts": [],
    "due_date": null,
    "ending_balance": null,
    "footer": null,
    "hosted_invoice_url": null,
    "invoice_pdf": null,
    "last_finalization_error": null,
    "lines": {
      "object": "list",
      "data": [
        {
          "id": "il_1LSdrX2eZvKYlo2CwVfODzHa",
          "object": "line_item",
          "amount": 300,
          "amount_excluding_tax": 300,
          "currency": "usd",
          "description": "My First Invoice Item (created for API docs)",
          "discount_amounts": [],
          "discountable": true,
          "discounts": [],
          "invoice_item": "ii_1LSdrX2eZvKYlo2Crz8rasOM",
          "livemode": false,
          "metadata": {},
          "period": {
            "end": 1659518855,
            "start": 1659518855
          },
          "price": {
            "id": "price_1LScCX2eZvKYlo2C1Z9zPyXF",
            "object": "price",
            "active": true,
            "billing_scheme": "per_unit",
            "created": 1659512469,
            "currency": "usd",
            "custom_unit_amount": null,
            "livemode": false,
            "lookup_key": null,
            "metadata": {},
            "nickname": null,
            "product": "prod_MAy8UvSA0uRRju",
            "recurring": null,
            "tax_behavior": "unspecified",
            "tiers_mode": null,
            "transform_quantity": null,
            "type": "one_time",
            "unit_amount": 300,
            "unit_amount_decimal": "300"
          },
          "proration": false,
          "proration_details": {
            "credited_items": null
          },
          "quantity": 1,
          "subscription": null,
          "tax_amounts": [],
          "tax_rates": [],
          "type": "invoiceitem",
          "unit_amount_excluding_tax": "300"
        }
      ],
      "has_more": false,
      "url": "/v1/invoices/in_1LSdrX2eZvKYlo2Cy1kxMopu/lines"
    },
    "livemode": false,
    "metadata": {
      "order_id": "6735"
    },
    "next_payment_attempt": 1659522455,
    "number": null,
    "on_behalf_of": null,
    "paid": false,
    "paid_out_of_band": false,
    "payment_intent": null,
    "payment_settings": {
      "default_mandate": null,
      "payment_method_options": null,
      "payment_method_types": null
    },
    "period_end": 1659518855,
    "period_start": 1659518855,
    "post_payment_credit_notes_amount": 0,
    "pre_payment_credit_notes_amount": 0,
    "quote": null,
    "receipt_number": null,
    "redaction": null,
    "rendering_options": null,
    "starting_balance": 0,
    "statement_descriptor": null,
    "status": "draft",
    "status_transitions": {
      "finalized_at": null,
      "marked_uncollectible_at": null,
      "paid_at": null,
      "voided_at": null
    },
    "subscription": null,
    "subtotal": 300,
    "subtotal_excluding_tax": 300,
    "tax": null,
    "test_clock": null,
    "total": 300,
    "total_discount_amounts": [],
    "total_excluding_tax": 300,
    "total_tax_amounts": [],
    "transfer_data": null,
    "webhooks_delivered_at": null
  }'''
nl: Update an invoiceDraft invoices are fully editable. Once an invoice is finalized,
  monetary values, as well as collection_method, become uneditable.
  If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on,
  sending reminders for, or automatically reconciling invoices, pass
  auto_advance=false.Parameters auto_advance optional Controls whether Stripe will perform automatic collection of the invoice. collection_method optional Either charge_automatically or send_invoice. This field can be updated only on draft invoices. description optional An arbitrary string attached to the object. Often useful for displaying to users. Referenced as ‘memo’ in the Dashboard. metadata optional dictionary Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.More parametersExpand all  account_tax_ids optional   application_fee_amount optional Connect only   automatic_tax optional dictionary   custom_fields optional array of hashes   days_until_due optional   default_payment_method optional   default_source optional   default_tax_rates optional   discounts optional array of hashes   due_date optional   footer optional   on_behalf_of optional Connect only   payment_settings optional dictionary   rendering_options optional dictionary   statement_descriptor optional   transfer_data optional dictionary Connect only ReturnsReturns the invoice object