# Create discount promise This endpoint creates a discount promise (with or without a coupon) for Wallet Connect. A discount promise is a reference that can be used to apply a specific discount to a payment ("advanced_payment"). If it is a discount promise with a coupon, the coupon must be previously validated using the "/v2/wallet_connect/coupons" endpoint. The information from the discount promise must be included during the payment creation, requested through the "/v1/advanced_payments" endpoint. In case of success, the request will return a response with status 200. **POST** `/v2/wallet_connect/discounts` ## Request parameters ### Header - `x-payer-token` (string, required) Payer token associated with the buyer who will use the discount. - `coupon` (string, optional) Unique coupon code for the discount. Send only when the buyer entered a coupon during the purchase flow. - `amount` (number, optional) Total payment amount before applying the discount. ## Response parameters - `transaction_amount` (number, optional) Total payment amount before applying the discount. - `currency_id` (string, optional) Currency used in the payment. - `legal_terms` (string, optional) URL with the terms and conditions of the discount. - `discount` (object, optional) Discount details. - `discount.amount` (number, optional) Amount to be deducted from the total payment. - `discount.detail` (object, optional) Detailed discount information. - `discount.detail.cap` (number, optional) Maximum amount that can be deducted from the payment. - `discount.detail.type` (string, optional) Type of discount applied. - `discount.detail.value` (number, optional) Discount value according to its type. ## Errors | Status | Error | Description | | ------- | ------- | ----------- | | 400 | invalid_amount | The amount field is invalid. Please check the value sent and try again. | | 400 | invalid_coupon | The coupon ID is invalid. Please check the value sent and try again. | | 400 | invalid_payer_token | The payer token sent in the "x-payer-token" header is invalid. Please check the value sent and try again. | | 500 | internal_error | An internal server error occurred. Please try again later. If the problem persists, contact support and provide the `x-request-id` and details about the operation performed. | ## Request example ### cURL ```bash curl -X POST \ 'https://api.mercadopago.com/v2/wallet_connect/discounts' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "coupon": "WALLET10", "amount": "50.00" }' ``` ## Response example ```json { "transaction_amount": "24.50", "currency_id": "PEN", "legal_terms": "https://api.mercadopago.com/v2/discounts/campaign/10580513/terms/html", "discount": { "amount": "24.50", "detail": { "cap": 1000000, "type": "percentage", "value": 10 } } } ```