AI resources
Validate couponhttps://api.mercadopago.com/v2/wallet_connect/coupons
This endpoint validates a Wallet Connect coupon code and returns the applicable discount information. In case of success, the request will return a response with status 200.
POST
Request parameters
Header
Authorization
Access Token obtained through the developer panel. Must be sent in all requests.string
REQUIRED
x-payer-token
Payer token associated with the buyer who will use the discount.string
REQUIRED
Body
id
Unique coupon code entered by the buyer during the purchase flow. For example: BLACKFRIDAY20.string
Response parameters
status
Coupon status after validation.string
success: The coupon is valid and the discount was applied.
pending: The coupon validation is pending.
invalid: The coupon is invalid or expired.
description
Brief description of the coupon's discount. For example: 30% discount coupon for Black Friday.string
legal_terms
URL with the legal terms associated with the coupon campaign.string
detail
Detailed discount information provided by the coupon.object
Errors
400Request error.
400
Bad Request — Invalid coupon_id.
400
Bad Request — Invalid payer token.
500Processing error.
internal_error
Some error occurred on our side while attempting to process the request. Please try again later.
Request
curl -X POST \
'https://api.mercadopago.com/v2/wallet_connect/coupons'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer APP_USR-5*********956537-12*********ff1a3d36d*********47e7b9985*********770' \
-H 'x-payer-token: <PAYER_TOKEN>' \
-d '{
"id": "BLACKFRIDAY20"
}'Response
{
"status": "success",
"description": "Cupom de desconto de 30% para Black Friday.",
"legal_terms": "https://www.mercadopago.com.ar/campaigns/terms-and-conditions/123456",
"detail": {
"value": 10,
"type": "percent",
"cap": 100,
"min_payment_amount": 100,
"max_payment_amount": 10000
}
}