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
REQUIRED
REQUIRED
REQUIRED
400Request error.
invalid_amount
The amount field is invalid. Please check the value sent and try again.
invalid_coupon
The coupon ID is invalid. Please check the value sent and try again.
invalid_payer_token
The payer token sent in the "x-payer-token" header is invalid. Please check the value sent and try again.
500Generic error.
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.
curl -X POST \
'https://api.mercadopago.com/v2/wallet_connect/discounts'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer APP_USR-4*********782856-12*********f202ca494*********f0baa4bb3*********648' \
-H 'x-payer-token: <PAYER_TOKEN>' \
-d '{
"coupon": "WALLET10",
"amount": 50
}'{
"transaction_amount": "24.50",
"currency_id": "COP",
"legal_terms": "https://api.mercadopago.com/v2/discounts/campaign/10580513/terms/html",
"discount": {
"amount": "24.50",
"detail": {
"cap": 1000000,
"type": "percentage",
"value": 10
}
}
}