AI resources
Validate coupon

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

https://api.mercadopago.com/v2/wallet_connect/coupons
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. For example: BLACKFRIDAY20.
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. For example: 30% discount coupon for Black Friday.
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.

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-1*********685765-12*********1b4332e5c*********e077d7679*********664' \
       -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
  }
}