Add a promo code (campaign/add-pins)
This method adds promo codes to an existing campaign. Available only for campaigns with single-use promo codes:
campaignType=codeOnline
orcampaignType=codeOffline
;- and
pinType=one-off
.
If the campaign status is pin-required (the campaign is suspended after running out of promo codes), then, after you add the promo codes, it will re-start automatically.
Request
Address for sending the request
POST https://yoomoney.ru/api/offerwall/v1/campaigns/add-pins
Parameters
Parameter | Type | Description |
---|---|---|
partnerCampaignId | int | Campaign ID. Returned in the response to the campaigns/create request. Required parameter |
pinList | array of strings | Set of promo codes that will be valid for this campaign. Required parameter |
Example of a request body
JSON
{ "ymCampaignId": 60, "pinList": [ "dykLadno", "storubley", "1234567" ] }
Request example
cURL
curl -X POST \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer: <authorization token>' \ -d '{ "ymCampaignId": 60, "pinList": [ "dykLadno", "storubley", "1234567" ] }' 'https://yoomoney.ru/api/offerwall/v1/campaigns/add-pins'
Response
Parameters
Parameter | Type | Description |
---|---|---|
ymCampaignId | int | Unique ID of the campaign. |
campaignStatus | enum | Campaign status. |
counters | object | Counters for promo codes. |
unusedPinCount | int | Number of unused promo codes (how many are left). |
acceptedPinCount | int | Number of promo codes received by users. |
redeemedPinCount | int | Number of redeemed promo codes. Specified by the store or aggregator in the campaigns/redeem request. |
totalPinCount | int | Total number of promo codes. |
Errors
Error code | Value | Description |
---|---|---|
incorrectData | Incorrect data | Request contained invalid data. |
Example of a response body
JSON
{ "status": "success", "result": { "ymCampaignId": 60, "campaignStatus": "started", "counters": { "unusedPinCount": 7, "acceptedPinCount": 0, "redeemedPinCount": 0, "totalPinCount": 7 } } }