AI resources
Create discount promise

This endpoint creates a discount promise for Wallet Connect. A discount promise is a reference that can be used when creating an advanced payment to apply a specific discount. The information from the discount promise must be included during the payment creation. In case of success, the request will return a response with status 200.

POST

https://api.mercadopago.com/v2/wallet_connect/discounts
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
coupon
string
Unique coupon code for the discount. Send only when the buyer entered a coupon during the purchase flow.
amount
number

REQUIRED

Total payment amount before applying the discount.
Response parameters
transaction_amount
number
Total payment amount before applying the discount.
currency_id
string
Currency used in the payment.
legal_terms
string
URL with the terms and conditions of the discount.
discount
object
Discount details.
Errors

400Request error.

400

Bad Request — Invalid amount.

400

Bad Request — Invalid coupon.

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/discounts'\
    -H 'Content-Type: application/json' \
       -H 'Authorization: Bearer APP_USR-5*********956537-12*********ff1a3d36d*********47e7b9985*********770' \
       -H 'x-payer-token: <PAYER_TOKEN>' \
    -d '{
  "coupon": "WALLET10",
  "amount": 50
}'
Response
{
  "transaction_amount": "24.50",
  "currency_id": "UYU",
  "legal_terms": "https://api.mercadopago.com/v2/discounts/campaign/10580513/terms/html",
  "discount": {
    "amount": "24.50",
    "detail": {
      "cap": 1000000,
      "type": "percentage",
      "value": 10
    }
  }
}