curl --request GET \
--url https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns/{campaign}/code/{code}import requests
url = "https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns/{campaign}/code/{code}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns/{campaign}/code/{code}', 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://int-prodtest.m1amdocs.io/slmgw/v1/campaigns/{campaign}/code/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://int-prodtest.m1amdocs.io/slmgw/v1/campaigns/{campaign}/code/{code}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns/{campaign}/code/{code}")
.asString();require 'uri'
require 'net/http'
url = URI("https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns/{campaign}/code/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"object": "<string>",
"id": "<string>",
"vid": "<string>",
"name": "<string>",
"description": "<string>",
"state": "Active",
"offer_start_date": "2023-11-07T05:31:56Z",
"offer_end_date": "2023-11-07T05:31:56Z",
"campaign_discount_method": "<string>",
"type": "<string>",
"percentage_discount": "<string>",
"apply_discount_per_item": "<string>",
"account_level_eligible": "<string>",
"purchase_level_eligible": "<string>",
"eligible_products": {
"object": "Product",
"id": "<string>",
"descriptions": {
"object": "List",
"total_count": 123,
"data": [
{
"object": "ProductDescription",
"language": "<string>",
"description": "<string>"
}
]
},
"status": "Active",
"vid": "<string>",
"created": "<string>",
"tax_classification": "<string>",
"br_tax_category": "Goods",
"default_billing_plan": {
"id": "<string>",
"vid": "<string>",
"object": "BillingPlan",
"created": "<string>",
"description": "<string>",
"status": "Active",
"tax_classification": "<string>",
"br_tax_category": "<string>",
"trial": {
"object": "BillingPlanPeriod",
"type": "Day",
"quantity": 123,
"cycles": 123,
"prices": [
{
"object": "<string>",
"amount": 123,
"currency": "<string>",
"price_list_name": "<string>",
"token_amount": {
"object": "TokenAmount",
"token": {
"object": "Token",
"id": "<string>",
"vid": "<string>",
"description": "<string>"
},
"amount": 123,
"source": "<string>"
}
}
]
},
"periods": [
{
"object": "BillingPlanPeriod",
"type": "Day",
"quantity": 123,
"cycles": 123,
"prices": [
{
"object": "<string>",
"amount": 123,
"currency": "<string>",
"price_list_name": "<string>",
"token_amount": {
"object": "TokenAmount",
"token": {
"object": "Token",
"id": "<string>",
"vid": "<string>",
"description": "<string>"
},
"amount": 123,
"source": "<string>"
}
}
]
}
],
"billing_notification_days": 123,
"trial_end_notification_days": 123,
"skip_initial_billing_notification": true,
"end_of_life": "<string>",
"metadata": {},
"entitlements": [
{
"id": "<string>",
"object": "Entitlement",
"description": "<string>"
}
],
"billing_descriptor": "<string>",
"times_to_run": "<string>",
"entitlements_valid_for": "<string>",
"repeat_every": "<string>",
"season_set": {
"id": "<string>",
"vid": "<string>",
"object": "SeasonSet",
"created": "<string>",
"seasons": [
{
"object": "Season",
"description": "<string>",
"starts": "<string>",
"ends": "<string>"
}
],
"metadata": {}
},
"days_before_season_to_bill": 123,
"days_entitled_before_season": 123,
"days_entitled_after_season": 123,
"entitled_off_season": true,
"used_on_subscriptions": true,
"grace_period_override": 123
},
"default_rate_plan": {
"object": "RatePlan",
"id": "<string>",
"vid": "<string>"
},
"end_of_life": "<string>",
"metadata": {},
"entitlements": {
"object": "List",
"total_count": 123,
"data": [
{
"id": "<string>",
"object": "Entitlement",
"description": "<string>"
}
]
},
"inherited_entitlements": {
"object": "List",
"total_count": 123,
"data": [
{
"id": "<string>",
"object": "Entitlement",
"description": "<string>"
}
]
},
"billing_descriptor": "<string>",
"credit_granted": {
"object": "Credit",
"token_amounts": [
{
"object": "TokenAmount",
"token": {
"object": "Token",
"id": "<string>",
"vid": "<string>",
"description": "<string>"
},
"amount": 123,
"source": "<string>"
}
],
"currency_amounts": [
{
"object": "CurrencyAmount",
"vid": "<string>",
"currency": "<string>",
"amount": 123,
"metadata": {},
"sort_value": 123,
"description": "<string>",
"reason": "<string>",
"granted_by_cashbox": true,
"granted": "<string>",
"account": {
"object": "Account",
"id": "<string>",
"vid": "<string>"
},
"subscription": {
"object": "Subscription",
"id": "<string>",
"vid": "<string>"
}
}
]
},
"prices": {
"object": "List",
"total_count": 123,
"data": [
{
"object": "ProductPrice",
"amount": 123,
"currency": "<string>",
"token": {
"object": "Token",
"id": "<string>",
"vid": "<string>",
"description": "<string>"
}
}
]
},
"bundled_products": "<array>"
},
"eligible_billing_plans": {
"id": "<string>",
"vid": "<string>",
"object": "BillingPlan",
"created": "<string>",
"description": "<string>",
"status": "Active",
"tax_classification": "<string>",
"br_tax_category": "<string>",
"trial": {
"object": "BillingPlanPeriod",
"type": "Day",
"quantity": 123,
"cycles": 123,
"prices": [
{
"object": "<string>",
"amount": 123,
"currency": "<string>",
"price_list_name": "<string>",
"token_amount": {
"object": "TokenAmount",
"token": {
"object": "Token",
"id": "<string>",
"vid": "<string>",
"description": "<string>"
},
"amount": 123,
"source": "<string>"
}
}
]
},
"periods": [
{
"object": "BillingPlanPeriod",
"type": "Day",
"quantity": 123,
"cycles": 123,
"prices": [
{
"object": "<string>",
"amount": 123,
"currency": "<string>",
"price_list_name": "<string>",
"token_amount": {
"object": "TokenAmount",
"token": {
"object": "Token",
"id": "<string>",
"vid": "<string>",
"description": "<string>"
},
"amount": 123,
"source": "<string>"
}
}
]
}
],
"billing_notification_days": 123,
"trial_end_notification_days": 123,
"skip_initial_billing_notification": true,
"end_of_life": "<string>",
"metadata": {},
"entitlements": [
{
"id": "<string>",
"object": "Entitlement",
"description": "<string>"
}
],
"billing_descriptor": "<string>",
"times_to_run": "<string>",
"entitlements_valid_for": "<string>",
"repeat_every": "<string>",
"season_set": {
"id": "<string>",
"vid": "<string>",
"object": "SeasonSet",
"created": "<string>",
"seasons": [
{
"object": "Season",
"description": "<string>",
"starts": "<string>",
"ends": "<string>"
}
],
"metadata": {}
},
"days_before_season_to_bill": 123,
"days_entitled_before_season": 123,
"days_entitled_after_season": 123,
"entitled_off_season": true,
"used_on_subscriptions": true,
"grace_period_override": 123
},
"restrict_to_new_subscription": true,
"expiration_date": "2023-11-07T05:31:56Z",
"number_of_periods": 123,
"period_length": "Day",
"promotion_code": "<string>",
"promotion_code_aliases": {
"object": "List",
"total_count": 123,
"data": [
"<string>"
]
},
"flat_amount_discounts": [
{
"currency": "<string>",
"amount": 123
}
],
"voucher_credit": {
"object": "Credit",
"token_amounts": [
{
"object": "TokenAmount",
"token": {
"object": "Token",
"id": "<string>",
"vid": "<string>",
"description": "<string>"
},
"amount": 123,
"source": "<string>"
}
],
"currency_amounts": [
{
"object": "CurrencyAmount",
"vid": "<string>",
"currency": "<string>",
"amount": 123,
"metadata": {},
"sort_value": 123,
"description": "<string>",
"reason": "<string>",
"granted_by_cashbox": true,
"granted": "<string>",
"account": {
"object": "Account",
"id": "<string>",
"vid": "<string>"
},
"subscription": {
"object": "Subscription",
"id": "<string>",
"vid": "<string>"
}
}
]
},
"coupons": [
{
"object": {},
"id": "<string>",
"index": 123,
"expires": "2023-11-07T05:31:56Z",
"max_redemptions": 123,
"codes_requested": 123,
"codes_generated": 123,
"coupon_prefix": "<string>",
"coupon_code_separator": "<string>",
"requires_activation_before_use": true,
"on_demand_codes_allowed": true
}
],
"item_display_text": "<string>",
"max_redemptions_per_customer": 123,
"max_redemptions_per_autobill": 123,
"apply_voucher_pre_transaction": true
}{
"code": "invalid-request",
"message": "<string>",
"validationErrors": [
{
"code": "<string>",
"message": "<string>"
}
]
}{
"code": "authentication-required",
"message": "<string>"
}{
"code": "not-found",
"message": "<string>"
}{
"code": "server-error",
"message": "<string>"
}Validate a Campaign Code
This method checks if a coupon or promotion can be used.
curl --request GET \
--url https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns/{campaign}/code/{code}import requests
url = "https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns/{campaign}/code/{code}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns/{campaign}/code/{code}', 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://int-prodtest.m1amdocs.io/slmgw/v1/campaigns/{campaign}/code/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://int-prodtest.m1amdocs.io/slmgw/v1/campaigns/{campaign}/code/{code}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns/{campaign}/code/{code}")
.asString();require 'uri'
require 'net/http'
url = URI("https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns/{campaign}/code/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"object": "<string>",
"id": "<string>",
"vid": "<string>",
"name": "<string>",
"description": "<string>",
"state": "Active",
"offer_start_date": "2023-11-07T05:31:56Z",
"offer_end_date": "2023-11-07T05:31:56Z",
"campaign_discount_method": "<string>",
"type": "<string>",
"percentage_discount": "<string>",
"apply_discount_per_item": "<string>",
"account_level_eligible": "<string>",
"purchase_level_eligible": "<string>",
"eligible_products": {
"object": "Product",
"id": "<string>",
"descriptions": {
"object": "List",
"total_count": 123,
"data": [
{
"object": "ProductDescription",
"language": "<string>",
"description": "<string>"
}
]
},
"status": "Active",
"vid": "<string>",
"created": "<string>",
"tax_classification": "<string>",
"br_tax_category": "Goods",
"default_billing_plan": {
"id": "<string>",
"vid": "<string>",
"object": "BillingPlan",
"created": "<string>",
"description": "<string>",
"status": "Active",
"tax_classification": "<string>",
"br_tax_category": "<string>",
"trial": {
"object": "BillingPlanPeriod",
"type": "Day",
"quantity": 123,
"cycles": 123,
"prices": [
{
"object": "<string>",
"amount": 123,
"currency": "<string>",
"price_list_name": "<string>",
"token_amount": {
"object": "TokenAmount",
"token": {
"object": "Token",
"id": "<string>",
"vid": "<string>",
"description": "<string>"
},
"amount": 123,
"source": "<string>"
}
}
]
},
"periods": [
{
"object": "BillingPlanPeriod",
"type": "Day",
"quantity": 123,
"cycles": 123,
"prices": [
{
"object": "<string>",
"amount": 123,
"currency": "<string>",
"price_list_name": "<string>",
"token_amount": {
"object": "TokenAmount",
"token": {
"object": "Token",
"id": "<string>",
"vid": "<string>",
"description": "<string>"
},
"amount": 123,
"source": "<string>"
}
}
]
}
],
"billing_notification_days": 123,
"trial_end_notification_days": 123,
"skip_initial_billing_notification": true,
"end_of_life": "<string>",
"metadata": {},
"entitlements": [
{
"id": "<string>",
"object": "Entitlement",
"description": "<string>"
}
],
"billing_descriptor": "<string>",
"times_to_run": "<string>",
"entitlements_valid_for": "<string>",
"repeat_every": "<string>",
"season_set": {
"id": "<string>",
"vid": "<string>",
"object": "SeasonSet",
"created": "<string>",
"seasons": [
{
"object": "Season",
"description": "<string>",
"starts": "<string>",
"ends": "<string>"
}
],
"metadata": {}
},
"days_before_season_to_bill": 123,
"days_entitled_before_season": 123,
"days_entitled_after_season": 123,
"entitled_off_season": true,
"used_on_subscriptions": true,
"grace_period_override": 123
},
"default_rate_plan": {
"object": "RatePlan",
"id": "<string>",
"vid": "<string>"
},
"end_of_life": "<string>",
"metadata": {},
"entitlements": {
"object": "List",
"total_count": 123,
"data": [
{
"id": "<string>",
"object": "Entitlement",
"description": "<string>"
}
]
},
"inherited_entitlements": {
"object": "List",
"total_count": 123,
"data": [
{
"id": "<string>",
"object": "Entitlement",
"description": "<string>"
}
]
},
"billing_descriptor": "<string>",
"credit_granted": {
"object": "Credit",
"token_amounts": [
{
"object": "TokenAmount",
"token": {
"object": "Token",
"id": "<string>",
"vid": "<string>",
"description": "<string>"
},
"amount": 123,
"source": "<string>"
}
],
"currency_amounts": [
{
"object": "CurrencyAmount",
"vid": "<string>",
"currency": "<string>",
"amount": 123,
"metadata": {},
"sort_value": 123,
"description": "<string>",
"reason": "<string>",
"granted_by_cashbox": true,
"granted": "<string>",
"account": {
"object": "Account",
"id": "<string>",
"vid": "<string>"
},
"subscription": {
"object": "Subscription",
"id": "<string>",
"vid": "<string>"
}
}
]
},
"prices": {
"object": "List",
"total_count": 123,
"data": [
{
"object": "ProductPrice",
"amount": 123,
"currency": "<string>",
"token": {
"object": "Token",
"id": "<string>",
"vid": "<string>",
"description": "<string>"
}
}
]
},
"bundled_products": "<array>"
},
"eligible_billing_plans": {
"id": "<string>",
"vid": "<string>",
"object": "BillingPlan",
"created": "<string>",
"description": "<string>",
"status": "Active",
"tax_classification": "<string>",
"br_tax_category": "<string>",
"trial": {
"object": "BillingPlanPeriod",
"type": "Day",
"quantity": 123,
"cycles": 123,
"prices": [
{
"object": "<string>",
"amount": 123,
"currency": "<string>",
"price_list_name": "<string>",
"token_amount": {
"object": "TokenAmount",
"token": {
"object": "Token",
"id": "<string>",
"vid": "<string>",
"description": "<string>"
},
"amount": 123,
"source": "<string>"
}
}
]
},
"periods": [
{
"object": "BillingPlanPeriod",
"type": "Day",
"quantity": 123,
"cycles": 123,
"prices": [
{
"object": "<string>",
"amount": 123,
"currency": "<string>",
"price_list_name": "<string>",
"token_amount": {
"object": "TokenAmount",
"token": {
"object": "Token",
"id": "<string>",
"vid": "<string>",
"description": "<string>"
},
"amount": 123,
"source": "<string>"
}
}
]
}
],
"billing_notification_days": 123,
"trial_end_notification_days": 123,
"skip_initial_billing_notification": true,
"end_of_life": "<string>",
"metadata": {},
"entitlements": [
{
"id": "<string>",
"object": "Entitlement",
"description": "<string>"
}
],
"billing_descriptor": "<string>",
"times_to_run": "<string>",
"entitlements_valid_for": "<string>",
"repeat_every": "<string>",
"season_set": {
"id": "<string>",
"vid": "<string>",
"object": "SeasonSet",
"created": "<string>",
"seasons": [
{
"object": "Season",
"description": "<string>",
"starts": "<string>",
"ends": "<string>"
}
],
"metadata": {}
},
"days_before_season_to_bill": 123,
"days_entitled_before_season": 123,
"days_entitled_after_season": 123,
"entitled_off_season": true,
"used_on_subscriptions": true,
"grace_period_override": 123
},
"restrict_to_new_subscription": true,
"expiration_date": "2023-11-07T05:31:56Z",
"number_of_periods": 123,
"period_length": "Day",
"promotion_code": "<string>",
"promotion_code_aliases": {
"object": "List",
"total_count": 123,
"data": [
"<string>"
]
},
"flat_amount_discounts": [
{
"currency": "<string>",
"amount": 123
}
],
"voucher_credit": {
"object": "Credit",
"token_amounts": [
{
"object": "TokenAmount",
"token": {
"object": "Token",
"id": "<string>",
"vid": "<string>",
"description": "<string>"
},
"amount": 123,
"source": "<string>"
}
],
"currency_amounts": [
{
"object": "CurrencyAmount",
"vid": "<string>",
"currency": "<string>",
"amount": 123,
"metadata": {},
"sort_value": 123,
"description": "<string>",
"reason": "<string>",
"granted_by_cashbox": true,
"granted": "<string>",
"account": {
"object": "Account",
"id": "<string>",
"vid": "<string>"
},
"subscription": {
"object": "Subscription",
"id": "<string>",
"vid": "<string>"
}
}
]
},
"coupons": [
{
"object": {},
"id": "<string>",
"index": 123,
"expires": "2023-11-07T05:31:56Z",
"max_redemptions": 123,
"codes_requested": 123,
"codes_generated": 123,
"coupon_prefix": "<string>",
"coupon_code_separator": "<string>",
"requires_activation_before_use": true,
"on_demand_codes_allowed": true
}
],
"item_display_text": "<string>",
"max_redemptions_per_customer": 123,
"max_redemptions_per_autobill": 123,
"apply_voucher_pre_transaction": true
}{
"code": "invalid-request",
"message": "<string>",
"validationErrors": [
{
"code": "<string>",
"message": "<string>"
}
]
}{
"code": "authentication-required",
"message": "<string>"
}{
"code": "not-found",
"message": "<string>"
}{
"code": "server-error",
"message": "<string>"
}Path Parameters
The id or the vid of the campaigns to retrieve.
The id or the vid of the campaigns to retrieve.
Response
JSON A full Campaigns object.
Value is “Campaign”
An aggregator-specified unique identifier. If not specified, this object can be identified by its vid
A Globally Unique Identifier (GUID) for this object. Assigned by CashBox
128Name of campaign.
Description of campaign.
Can be Active, Canceled, Complete, Inactive, MatchAnyState, Pending, Undefined
Active, Canceled, Complete, Inactive, MatchAnyState, Undefined, Pending The first date on which the offers may be redeemed.
The last date on which the offers may be redeemed.
Not implemented specifies the discounting method either Compounded or Direct
specifies what type of campaign this is Coupon, Promotion, Voucher (Not implemented), Undefined. Campaign is Active.
Defines the discount as a percentage of the original Product price. Note:- flat_amount_discounts and percentage_discount are mutually exclusive. It can be either or but not both
Not implemented If true, discounts on items will be multiplied by the item quantity.
Not implemented Campaign can be applied to customer Accounts.
Not implemented Campaign can be applied to all items (i.e. subtotal) on a Transaction.
Zero or more eligible Products eligible for this Campaign
Show child attributes
Show child attributes
Zero or more eligible BillingPlans eligible for this Campaign
Show child attributes
Show child attributes
If true, Campaign offer only applies to new subscriptions, not existing ones
Expiration date of a “Fixed” Campaign. “Rolling” Campaigns should leave this blank
Number of times the promotion repeats, e.g. if you want to discount 3 cycles of a biweekly subscription, this would be 3
Can be Day, Week, Month, Year, Hour, BillingCycle
Day, week, Mopnth, year, Hour, BillingCycle The redemption code associated with the Promotion
An array of alternative redemption codes for the Promotion Note:- Setting this array will replace any existing list of aliases; it will not add new values to an existing list.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The Credit object represents a service credit granted to an account or subscription, taking the form of either currency, token, or time amounts.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Name to be placed on ItemDiscounts generated for this Campaign.
Maximum number of Campaign redemptions for any given customer account.
Maximum number of Campaign redemptions for any given subscription
Voucher credits should be applied before the initial Transaction is processed
Was this page helpful?

