Redeem an offer (campaigns/redeem)
The aggregator or store provides YooMoney with the information regarding the leads, i. e. how the users can redeem discounts or bonuses.
Request
Address for sending the request
POST https://yoomoney.ru/api/offerwall/v1/campaigns/redeem
Parameters
Parameter | Type | Description |
---|---|---|
ymCampaignId | int | Campaign ID in the YooMoney service. Returned in the response to the campaigns/create request. Required parameter |
pinContent | string | Contents of the promo code (alphanumeric string, not case-sensitive). See campaigns/create Required for campaigns with campaignType=codeOnline and campaignType=codeOffline with single-use promo codes (one-off ). |
clickId | string | Unique ID of a click. Generated in the YooMoney service at the moment of linking and added to acceptUrl (a unique link for redeeming the offer that redirects the user). See campaigns/createRequired for campaigns:
|
transactionId | string (36) | ID of the order on the store’s side (that covers the applied offer). It must be unique for a single ad campaign. You can use monotonically increasing numbers, a string of random characters, or any other option. Required parameter |
redeemStatus | enum | Lead status. Possible values:
Optional parameter |
sceneRedeem | string | Place where the lead was redeemed (discount or bonus were used). Optional parameter |
redeemTime | datetime | Time when the lead was redeemed (discount or bonus were used). Optional parameter |
campaignFee | varchar (30) | Amount of the YooMoney’s renumeration after the lead was redeemed. Number in rubles or dollars, two characters after the dot. Required parameter |
feeCurrency | CurrencyCode | Currency code of YooMoney’s remuneration.
Optional parameter |
orderAmount | varchar (30) | Amount of the order. Number in rubles or dollars, two characters after the dot. Optional parameter |
orderCurrency | CurrencyCode | Currency code of the order.
Optional parameter |
cashbackAmount | varchar (30) | Amount of cashback. Number in rubles or dollars, two characters after the dot. Optional parameter |
Example of a request body
JSON
{ "campaignFee": 10, "ymCampaignId": 1, "clickId": "615737-1227535-12368", "pinContent": "ab12", "redeemTime": "2017-12-31T23:59:59+03:30", "redeemStatus": "used", "sceneRedeem": "1", "transactionId": "1" }
Request example
cURL
curl -X POST \ --header 'Content-Type: application/json' \ --header 'Accept: application/json;charset=UTF-8' \ --header 'Authorization: Bearer <access token>' -d '{ "campaignFee": 10, "ymCampaignId": 1, "clickId": "615737-1227535-12368", "pinContent": "ab12", "redeemTime": "2017-12-31T23:59:59+03:30", "redeemStatus": "used", "sceneRedeem": "1", "transactionId": "1" }' 'https://yoomoney.ru/api/offerwall/v1/campaigns/redeem'
Response
Status of the operation (in progress or error).