Edit Credit
Edit a credit
client.v2.contracts.editCredit(ContractEditCreditParamsbody, RequestOptionsoptions?): dataIDContractEditCreditResponse
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
bodycredit_idstringcustomer_idstringaccess_scheduleAccessScheduleapplicable_product_idsunionapplicable_product_tagsunionpriorityunionproduct_idstringspecifiersunionContractEditCreditParams
Returns
ContractEditCreditResponse
import Metronome from '@metronome/sdk';
const client = new Metronome({
bearerToken: 'My Bearer Token',
});
const response = await client.v2.contracts.editCredit({
credit_id: '5e7e82cf-ccb7-428c-a96f-a8e4f67af822',
customer_id: '4c91c473-fc12-445a-9c38-40421d47023f',
access_schedule: {
update_schedule_items: [
{ id: 'd5edbd32-c744-48cb-9475-a9bca0e6fa39', ending_before: '2025-03-12T00:00:00Z' },
],
},
});
console.log(response.data);
200 Example
{
"data": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}
}