# MD for: https://www.mercadopago.com.uy/developers/pt/docs/wallet-connect/discounts/process-payments-with-discounts.md \# Process Payments with Discount In this section, we detail the requests and necessary parameters to process payments with discount and the expected responses from each of them. > NOTE > > Important > > The refund of the discount is not instantaneous; it may take about 200 milliseconds without a coupon and up to 10 seconds with a coupon. Therefore, we recommend creating the discount promise and proceeding immediately with the payment. To process payments with discount, use the \_curl\_ below and ensure that the request parameters are filled in according to the information described in the following table. | Parameter | Type | Description | Example | | --- | --- | --- | --- | | Authorization | String | User's authorization token (Access token). This information can be obtained through the menu \[Your integrations\](https://www.mercadopago.com.uy/developers/pt/docs/wallet-connect/additional-content/your-integrations/credentials). | APP\_USR-123456-test-access-t0ken | | wallet\_payment | Object | Object that groups information of payment processed via Wallet Connect. | N/A | | transaction\_amount | Double | Amount for which the payment is made. | 550.0 | | description | String | Generic description of the payment being made. | "Payment Description" | | external\_reference | String | Payment reference assigned by the seller. Accepts only numbers and letters. | "Payment\_123" | | discount | Object | Optional field that groups the data of the discount to be applied. This field is only mandatory if you want to create a payment with a discount. If sent empty, it will create a payment without a discount. | N/A | | amount | Double | Value of the discount to be applied to the payment. | 55.0 | | description | String | Description of the discount. | "Discount for Black Friday". | | detail | Object | Object that extends information on the characteristics of the discount. | N/A | | value | Double | Amount of discount to be applied to the payment. This field corresponds to the \`type\` mentioned below, for example, 30 percent. | 10.0 | | type | String | Unit of measure of the discount value, can be percentage or a fixed amount. | percent (for percentage) or fixed (for fixed values). | | cap | Double | Maximum value for which the discount can be applied on a payment. | 5000 | | payer | Object | Object that contains the payer's data. | N/A | | token | String | Specific token of the payer, used to perform all the validation of the payment flow. | payer1-token2-test3-example4 | | type\_token | String | Type of token to be used in payments. | wallet-token (this is the only type of token accepted for payments via Wallet Connect). | * [curl ](#editor%5F1) curl ``` curl -X POST \ 'https://api.mercadopago.com/v1/advanced_payments' \ --header 'Authorization: ' \ --data '{ "wallet_payment": { "transaction_amount": 550, "description": "Payment Description", "external_reference": "Pago_123", "discount": { "amount": 55.0, "description": "Pruebas wc", "detail": { "value": 10.0, "type": "percent", "cap": 5000 } } }, "payer": { "token": "PAYER_TOKEN", "type_token": "wallet-token" } }' ``` Copiar \## Responses Below we detail the different responses that can be received when processing a payment with a discount. The responses are categorized based on the outcome of the request, ranging from success in processing to a specific error. ### Success \`\`\`Json { "id": 1234567, "status": "approved", "marketplace": null, "sponsor\_id": null, "payments": \[ { "id": "PAYMENT-ID", "status": "approved", "status\_detail": "accredited", "payment\_type\_id": "account\_money", "payment\_method\_id": "account\_money", "token": null, "transaction\_amount": 500, "installments": 1, "processing\_mode": "aggregator", "issuer\_id": null, "coupon\_amount": 10.0, "campaign\_id": "CAMPAIGN-ID", "coupon\_code": null, "description": "Payment Wallet", "external\_reference": null, "statement\_descriptor": null, "date\_of\_expiration": null, "merchant\_account\_id": null, "payment\_method\_option\_id": null, "additional\_info": null, "transaction\_details": null, "net\_amount": null, "taxes": null } \], "disbursements": null, "payer": { "id": "PAYER-ID", "email": "PAYER-EMAIL", "address": null, "identification": null, "first\_name": null, "last\_name": null, "phone": null, "token": "PAYER-TOKEN", "external\_payer\_id": "EXTERNAL-PAYER-ID" }, "external\_reference": null, "description": null, "binary\_mode": true, "capture": true, "date\_created": "2023-07-24T14:30:45.574-04:00", "date\_last\_updated": "2023-07-24T14:30:46.517-04:00", "metadata": null, "additional\_info": null, "wallet\_payment": { "transaction\_amount": 550, "description": "Payment Wallet", "external\_reference": null, "subscription\_data": null, "user\_present": null, "discount": { "amount": 50.0, "description": "wallet connect test", "detail": { "value": 10.0, "type": "percent", "cap": 100000.0 } }, "payment\_preference": { "active": true, "user\_id": 1431302201, "payment\_method": \[ { "priority": 1, "payment\_method": "account\_money" } \] } }, "pos\_id": null, "store\_id": null, "wallet\_connect\_discount": { "amount": 10.0, "token": "DISCOUNT-TOKEN" } } \`\`\` ### Error If the discount applied to the payment is not valid or the amount indicated in the order does not correspond to the established discount value, an error will be generated, as described below. \`\`\`Json { "error": "bad\_request", "message": "discount doesn't exist or amount is incorrect", "status": 400, "cause": \[ { "code": 400136, "description": "discount doesn't exist or amount is incorrect", "data": null } \] } \`\`\`