# Charge a Fee source: https://developer.mastercard.com/mastercard-processing-core/documentation/use-cases/transactions-and-fees-management/charge-a-fee/index.md ## Overview {#overview} The use case describes how you charge a fee to the contract. ## Sequence diagram {#sequence-diagram} Diagram charge-a-fee ### Explanation {#explanation} 1. The server sends a `POST` request to the `/contracts/{contract_id}/charge-fees` endpoint by passing the required fields `amount`, `currency`, `feeTypeId`, and `uniqueReferenceNumber` in the request body. To charge a fee for the account contract or card contract, the server must put the `accountContractId` or the `cardContractId`, respectively, in place of the `contract_id` in the path. Note: The `feeTypeId` is preconfigured in the Mastercard Processing CMS system during the onboarding process. 2. The API returns the HTTP status `201` with the `transactionId` generated by the CMS. Refer to [Sandbox testing](https://developer.mastercard.com/mastercard-processing-core/documentation/sandbox-testing/transactions-and-fees-management/charge-fee/index.md) for information on how to execute the use case in the Sandbox environment. ## Endpoint {#endpoint} API Reference: `POST /contracts/{contract_id}/charge-fees`