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 or campaignType=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
ParameterTypeDescription
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
ParameterTypeDescription
ymCampaignIdintUnique ID of the campaign.
campaignStatusenumCampaign status.
countersobjectCounters for promo codes.
unusedPinCountintNumber of unused promo codes (how many are left).
acceptedPinCountintNumber of promo codes received by users.
redeemedPinCountintNumber of redeemed promo codes. Specified by the store or aggregator in the campaigns/redeem request.
totalPinCountintTotal number of promo codes.
Errors
Error codeValueDescription
incorrectDataIncorrect dataRequest 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
        }
    }
}
© 2024, "YooMoney", NBCO LLC