--- title: "Delete latest cost contract" description: "Delete the most recent inactive cost contract for an account key." url: "https://docs.adyen.com/account-management-api/manage-cost-contracts/deletelatestcostcontract" source_url: "https://docs.adyen.com/account-management-api/manage-cost-contracts/deletelatestcostcontract.md" canonical: "https://docs.adyen.com/account-management-api/manage-cost-contracts/deletelatestcostcontract" last_modified: "2026-05-25T12:55:01+02:00" language: "en" --- # Delete latest cost contract Delete the most recent inactive cost contract for an account key. [View source](/account-management-api/manage-cost-contracts/deletelatestcostcontract.md) When replacing a cost contract, you first need to make a `deleteLastCostContract` request to remove the previous inactive cost contract. Then, proceed to create a new one with [addCostContract](/account-management-api/manage-cost-contracts/addcostcontract). This endpoint does not support partial updates. In case an error occurs during a `/deleteLatestCostContract` update: * No changes are applied. * Current data is kept. * The entire update fails. ## Request parameters To delete the oldest inactive cost contract for a specific account key, make a POST `/deleteLatestCostContract` request specifying: | Name | Type | Required | Description | | ------------ | ------ | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | `accountKey` | String | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Unique reference to identify an account. - Company account key format: \`Company.COMPANY\_CODE\` - Merchant account key format: \`Merchant.MERCHANT\_CODE\` | ## Response parameters If there are no errors in the request, the call returns a `pspReference.`If any issues occur during the process, the call returns one or more warning or error messages. | Name | Type | Returned by default | Description | | ------------------ | ------ | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **`pspReference`** | String | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | A reference to uniquely identify the request. | | **`warnings`** | String | ![-x-](/user/data/smileys/emoji/x.png "-x-") | Warning message(s) about problems encountered while trying to delete the oldest inactive cost contract. Returned when the oldest inactive cost contract deletion for the specified account key does not work as expected. | | **`errors`** | String | ![-x-](/user/data/smileys/emoji/x.png "-x-") | Error message(s) about problems encountered while trying to delete the oldest inactive cost contract. Returned when the oldest inactive cost contract deletion for the specified account key fails. | ## Examples ### Request #### JSON ```json { "accountKey":"MerchantAccount.TestMerchant" } ``` #### Soap ```xml   MerchantAccount.TestMerchant ``` ### Response #### JSON ```json { "pspReference":"9914526949160163" } ``` #### Soap ```xml   9914140650000269 ```