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. The validated coupon can be used in a discount promise through the "/v2/wallet_connect/discounts" endpoint. In case of success, the request will return a response with status 200.
POST
Request parameters
Header
Authorization
string
REQUIRED
Access Token obtained through the developer panel. Must be sent in all requests.
x-payer-token
string
REQUIRED
Payer token associated with the buyer who will use the discount.
Body
id
string
Unique coupon code entered by the buyer during the purchase flow.
Response parameters
status
string
Coupon status after validation.
success: The coupon is valid and the discount was applied.
pending: The coupon validation is pending.
invalid: The coupon is invalid or expired.
description
string
Brief description of the coupon's discount.
legal_terms
string
URL with the legal terms associated with the coupon campaign.
detail
object
Detailed discount information provided by the coupon.
Errors
400Request error.
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.
Request
curl -X POST \
'https://api.mercadopago.com/v2/wallet_connect/coupons'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer APP_USR-8*********88776-122*********fc20dede6*********a497d7225*********64' \
-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.br/campaigns/terms-and-conditions/123456",
"detail": {
"value": 10,
"type": "percent",
"cap": 100,
"min_payment_amount": 100,
"max_payment_amount": 10000
}
}