curl --request POST \
--url https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns/{campaign}/actions/generate_incremental_codes \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns/{campaign}/actions/generate_incremental_codes"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns/{campaign}/actions/generate_incremental_codes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns/{campaign}/actions/generate_incremental_codes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns/{campaign}/actions/generate_incremental_codes"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns/{campaign}/actions/generate_incremental_codes")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns/{campaign}/actions/generate_incremental_codes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body"{ \"object\": \"List\", \"data\": [ { \"object\": \"CampaignCode\", \"id\": \"-FC97CD6GM3K8JJDX\", \"vid\": \"3bbb0df7e8755b634460ce51190441dc618a1eee\", \"type\": \"Coupon\", \"state\": \"Not Yet Activated\", \"last_chars\": \"JJDX\", \"redemption_count\": 0 }, { \"object\": \"CampaignCode\", \"id\": \"-GHXWNKK4K3GEY7PW\", \"vid\": \"4e83681335c64b380681302ab002f40aee060504\", \"type\": \"Coupon\", \"state\": \"Not Yet Activated\", \"last_chars\": \"Y7PW\", \"redemption_count\": 0 }, { \"object\": \"CampaignCode\", \"id\": \"-FM4PUVCJGX5NUG7N\", \"vid\": \"9d512e1578039e25b4ae187d06d57e72d69600f6\", \"type\": \"Coupon\", \"state\": \"Not Yet Activated\", \"last_chars\": \"UG7N\", \"redemption_count\": 0 }, { \"object\": \"CampaignCode\", \"id\": \"-UVCEMUMXJNSU6YUV\", \"vid\": \"a6ba3886dbd15c4f5e4e49a1e890efbdfe5fda67\", \"type\": \"Coupon\", \"state\": \"Not Yet Activated\", \"last_chars\": \"6YUV\", \"redemption_count\": 0 }, { \"object\": \"CampaignCode\", \"id\": \"-3AKHBAFSDTAPJHN7\", \"vid\": \"aaca8c9c5b893e40c13c80f5dde8232745568b39\", \"type\": \"Coupon\", \"state\": \"Not Yet Activated\", \"last_chars\": \"JHN7\", \"redemption_count\": 0 } ], \"total_count\": 5 }""{ \"object\": \"Error\", \"message\": \"JSON is invalid\" }"{
"code": "<string>",
"message": "<string>"
}"{ \"object\": \"Error\", \"message\": \"This endpoint does not exist. Check our API docs.\" }"Generate Incremental Coupon Codes
Generates additional coupon codes, on demand. Available when the coupon campaign is already active.
- Incremental coupons are only available after the campaign’s original coupons were fully generated and relevant for active coupon campaigns.
- In order to generate incremental coupon codes, on_demand_codes_allowed campaign attribute must be enabled (1) in the Campaign object.
- The response to the call provides a list of the coupon codes for use and redemption by the customers. Incremental codes are not generated in the Subscribe Portal. You may choose to add an additional security step that requires activation of the codes prior to redemption. See coupon_code_requires_activation in the Campaign object.
- The maximal number of codes per generation attempt is 100.
curl --request POST \
--url https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns/{campaign}/actions/generate_incremental_codes \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns/{campaign}/actions/generate_incremental_codes"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns/{campaign}/actions/generate_incremental_codes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns/{campaign}/actions/generate_incremental_codes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns/{campaign}/actions/generate_incremental_codes"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns/{campaign}/actions/generate_incremental_codes")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns/{campaign}/actions/generate_incremental_codes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body"{ \"object\": \"List\", \"data\": [ { \"object\": \"CampaignCode\", \"id\": \"-FC97CD6GM3K8JJDX\", \"vid\": \"3bbb0df7e8755b634460ce51190441dc618a1eee\", \"type\": \"Coupon\", \"state\": \"Not Yet Activated\", \"last_chars\": \"JJDX\", \"redemption_count\": 0 }, { \"object\": \"CampaignCode\", \"id\": \"-GHXWNKK4K3GEY7PW\", \"vid\": \"4e83681335c64b380681302ab002f40aee060504\", \"type\": \"Coupon\", \"state\": \"Not Yet Activated\", \"last_chars\": \"Y7PW\", \"redemption_count\": 0 }, { \"object\": \"CampaignCode\", \"id\": \"-FM4PUVCJGX5NUG7N\", \"vid\": \"9d512e1578039e25b4ae187d06d57e72d69600f6\", \"type\": \"Coupon\", \"state\": \"Not Yet Activated\", \"last_chars\": \"UG7N\", \"redemption_count\": 0 }, { \"object\": \"CampaignCode\", \"id\": \"-UVCEMUMXJNSU6YUV\", \"vid\": \"a6ba3886dbd15c4f5e4e49a1e890efbdfe5fda67\", \"type\": \"Coupon\", \"state\": \"Not Yet Activated\", \"last_chars\": \"6YUV\", \"redemption_count\": 0 }, { \"object\": \"CampaignCode\", \"id\": \"-3AKHBAFSDTAPJHN7\", \"vid\": \"aaca8c9c5b893e40c13c80f5dde8232745568b39\", \"type\": \"Coupon\", \"state\": \"Not Yet Activated\", \"last_chars\": \"JHN7\", \"redemption_count\": 0 } ], \"total_count\": 5 }""{ \"object\": \"Error\", \"message\": \"JSON is invalid\" }"{
"code": "<string>",
"message": "<string>"
}"{ \"object\": \"Error\", \"message\": \"This endpoint does not exist. Check our API docs.\" }"Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
The id or the vid of the associated coupon campaign
Query Parameters
The number of incremental codes required . Maximal number of codes allowed is 100.
Response
JSON - A list array with a data property that contains an array of up to limit campaign codes. Each entry in the array is a full campaign code object.
Also:
"total_count": Integer count of the number of Campaigns objects in the returned list.
Value is "CampaignCode"
Primary redemption string (either a Promotion code or a Coupon code) used for redeeming CampaignCoode
A Globally Unique Identifier (GUID) for this object. Assigned by CashBox
128An array of alternative redemption codes specified on a Promotion Campaign
Type of Campaign associated with this CampaignCode
Promotion, Campaign Campaign associated with the CampaignCode
Show child attributes
Show child attributes
Unique sequence number for the CampaignCode in the parent code set.
State of the CampaignCode
Not Yet Activated, Activated, Redeemed, Expired, Marked Used, Retrieved, Invalidated, Initialized Last characters (typically 4) of the CampaignCode
Number of times the (Coupon) CampaignCode has been redeemed
"{ \"object\": \"List\", \"data\": [ { \"object\": \"CampaignCode\", \"id\": \"-FC97CD6GM3K8JJDX\", \"vid\": \"3bbb0df7e8755b634460ce51190441dc618a1eee\", \"type\": \"Coupon\", \"state\": \"Not Yet Activated\", \"last_chars\": \"JJDX\", \"redemption_count\": 0 }, { \"object\": \"CampaignCode\", \"id\": \"-GHXWNKK4K3GEY7PW\", \"vid\": \"4e83681335c64b380681302ab002f40aee060504\", \"type\": \"Coupon\", \"state\": \"Not Yet Activated\", \"last_chars\": \"Y7PW\", \"redemption_count\": 0 }, { \"object\": \"CampaignCode\", \"id\": \"-FM4PUVCJGX5NUG7N\", \"vid\": \"9d512e1578039e25b4ae187d06d57e72d69600f6\", \"type\": \"Coupon\", \"state\": \"Not Yet Activated\", \"last_chars\": \"UG7N\", \"redemption_count\": 0 }, { \"object\": \"CampaignCode\", \"id\": \"-UVCEMUMXJNSU6YUV\", \"vid\": \"a6ba3886dbd15c4f5e4e49a1e890efbdfe5fda67\", \"type\": \"Coupon\", \"state\": \"Not Yet Activated\", \"last_chars\": \"6YUV\", \"redemption_count\": 0 }, { \"object\": \"CampaignCode\", \"id\": \"-3AKHBAFSDTAPJHN7\", \"vid\": \"aaca8c9c5b893e40c13c80f5dde8232745568b39\", \"type\": \"Coupon\", \"state\": \"Not Yet Activated\", \"last_chars\": \"JHN7\", \"redemption_count\": 0 } ], \"total_count\": 5 }"

