code: import stripe
  stripe.api_key = "sk_test_your_key"
  
  stripe.PromotionCode.modify(
    "promo_1HMxuf2eZvKYlo2CmGXSyhRx",
    metadata={"order_id": "6735"},
  )
  '''Response {
    "id": "promo_1HMxuf2eZvKYlo2CmGXSyhRx",
    "object": "promotion_code",
    "active": true,
    "code": "TS0EQJHH",
    "coupon": {
      "id": "123",
      "object": "coupon",
      "amount_off": null,
      "created": 1507799684,
      "currency": null,
      "duration": "repeating",
      "duration_in_months": 3,
      "livemode": false,
      "max_redemptions": 14,
      "metadata": {
        "teste": "test"
      },
      "name": null,
      "percent_off": 34.0,
      "redeem_by": null,
      "times_redeemed": 0,
      "valid": true
    },
    "created": 1599060617,
    "customer": null,
    "expires_at": null,
    "livemode": false,
    "max_redemptions": null,
    "metadata": {
      "order_id": "6735"
    },
    "restrictions": {
      "first_time_transaction": false,
      "minimum_amount": null,
      "minimum_amount_currency": null
    },
    "times_redeemed": 0
  }'''
nl: Update a promotion codeUpdates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable.Parameters 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  active optional   restrictions optional dictionary preview feature ReturnsThe updated promotion code object is returned upon success. Otherwise, this call raises an error