## Edit Credit `v2.contracts.edit_credit(**kwargs) -> ContractEditCreditResponse` **post** `/v2/contracts/credits/edit` Edit a customer or contract credit. Contract credits can only be edited using this endpoint if contract editing is enabled. ### Parameters - **credit\_id:** `String` ID of the credit to edit - **customer\_id:** `String` ID of the customer whose credit is being edited - **access\_schedule:** `{ add_schedule_items, remove_schedule_items, update_schedule_items}` - **add\_schedule\_items:** `Array[{ amount, ending_before, starting_at}]` - **amount:** `Float` - **ending\_before:** `Time` - **starting\_at:** `Time` - **remove\_schedule\_items:** `Array[{ id}]` - **id:** `String` - **update\_schedule\_items:** `Array[{ id, amount, ending_before, starting_at}]` - **id:** `String` - **amount:** `Float` - **ending\_before:** `Time` - **starting\_at:** `Time` - **applicable\_product\_ids:** `Array[String]` Which products the credit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the credit applies to all products. - **applicable\_product\_tags:** `Array[String]` Which tags the credit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the credit applies to all products. - **priority:** `Float` If multiple commits are applicable, the one with the lower priority will apply first. - **product\_id:** `String` - **specifiers:** `Array[{ presentation_group_values, pricing_group_values, product_id, product_tags}]` List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`. - **presentation\_group\_values:** `Hash[Symbol, String]` - **pricing\_group\_values:** `Hash[Symbol, String]` - **product\_id:** `String` If provided, the specifier will only apply to the product with the specified ID. - **product\_tags:** `Array[String]` If provided, the specifier will only apply to products with all the specified tags. ### Returns - `class ContractEditCreditResponse` - **data:** `ID` ### Example ```ruby require "metronome_sdk" metronome = MetronomeSDK::Client.new(bearer_token: "My Bearer Token") response = metronome.v2.contracts.edit_credit( credit_id: "5e7e82cf-ccb7-428c-a96f-a8e4f67af822", customer_id: "4c91c473-fc12-445a-9c38-40421d47023f" ) puts(response) ```