curl --request POST \
--url https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns \
--header 'Content-Type: application/json' \
--data '
{
"object": "<string>",
"id": "<string>",
"vid": "<string>",
"name": "<string>",
"description": "<string>",
"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_billing_plans": {
"id": "<string>",
"vid": "<string>",
"object": "BillingPlan",
"created": "<string>",
"description": "<string>",
"tax_classification": "<string>",
"br_tax_category": "<string>",
"trial": {
"object": "BillingPlanPeriod",
"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",
"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,
"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
}
'import requests
url = "https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns"
payload = {
"object": "<string>",
"id": "<string>",
"vid": "<string>",
"name": "<string>",
"description": "<string>",
"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_billing_plans": {
"id": "<string>",
"vid": "<string>",
"object": "BillingPlan",
"created": "<string>",
"description": "<string>",
"tax_classification": "<string>",
"br_tax_category": "<string>",
"trial": {
"object": "BillingPlanPeriod",
"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",
"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,
"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
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
object: '<string>',
id: '<string>',
vid: '<string>',
name: '<string>',
description: '<string>',
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_billing_plans: {
id: '<string>',
vid: '<string>',
object: 'BillingPlan',
created: '<string>',
description: '<string>',
tax_classification: '<string>',
br_tax_category: '<string>',
trial: {
object: 'BillingPlanPeriod',
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',
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,
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
})
};
fetch('https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'object' => '<string>',
'id' => '<string>',
'vid' => '<string>',
'name' => '<string>',
'description' => '<string>',
'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_billing_plans' => [
'id' => '<string>',
'vid' => '<string>',
'object' => 'BillingPlan',
'created' => '<string>',
'description' => '<string>',
'tax_classification' => '<string>',
'br_tax_category' => '<string>',
'trial' => [
'object' => 'BillingPlanPeriod',
'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',
'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,
'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
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns"
payload := strings.NewReader("{\n \"object\": \"<string>\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"offer_start_date\": \"2023-11-07T05:31:56Z\",\n \"offer_end_date\": \"2023-11-07T05:31:56Z\",\n \"campaign_discount_method\": \"<string>\",\n \"type\": \"<string>\",\n \"percentage_discount\": \"<string>\",\n \"apply_discount_per_item\": \"<string>\",\n \"account_level_eligible\": \"<string>\",\n \"purchase_level_eligible\": \"<string>\",\n \"eligible_billing_plans\": {\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"object\": \"BillingPlan\",\n \"created\": \"<string>\",\n \"description\": \"<string>\",\n \"tax_classification\": \"<string>\",\n \"br_tax_category\": \"<string>\",\n \"trial\": {\n \"object\": \"BillingPlanPeriod\",\n \"quantity\": 123,\n \"cycles\": 123,\n \"prices\": [\n {\n \"object\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"price_list_name\": \"<string>\",\n \"token_amount\": {\n \"object\": \"TokenAmount\",\n \"token\": {\n \"object\": \"Token\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"amount\": 123,\n \"source\": \"<string>\"\n }\n }\n ]\n },\n \"periods\": [\n {\n \"object\": \"BillingPlanPeriod\",\n \"quantity\": 123,\n \"cycles\": 123,\n \"prices\": [\n {\n \"object\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"price_list_name\": \"<string>\",\n \"token_amount\": {\n \"object\": \"TokenAmount\",\n \"token\": {\n \"object\": \"Token\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"amount\": 123,\n \"source\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"billing_notification_days\": 123,\n \"trial_end_notification_days\": 123,\n \"skip_initial_billing_notification\": true,\n \"end_of_life\": \"<string>\",\n \"metadata\": {},\n \"entitlements\": [\n {\n \"id\": \"<string>\",\n \"object\": \"Entitlement\",\n \"description\": \"<string>\"\n }\n ],\n \"billing_descriptor\": \"<string>\",\n \"times_to_run\": \"<string>\",\n \"entitlements_valid_for\": \"<string>\",\n \"repeat_every\": \"<string>\",\n \"season_set\": {\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"object\": \"SeasonSet\",\n \"created\": \"<string>\",\n \"seasons\": [\n {\n \"object\": \"Season\",\n \"description\": \"<string>\",\n \"starts\": \"<string>\",\n \"ends\": \"<string>\"\n }\n ],\n \"metadata\": {}\n },\n \"days_before_season_to_bill\": 123,\n \"days_entitled_before_season\": 123,\n \"days_entitled_after_season\": 123,\n \"entitled_off_season\": true,\n \"used_on_subscriptions\": true,\n \"grace_period_override\": 123\n },\n \"restrict_to_new_subscription\": true,\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"number_of_periods\": 123,\n \"promotion_code\": \"<string>\",\n \"promotion_code_aliases\": {\n \"object\": \"List\",\n \"total_count\": 123,\n \"data\": [\n \"<string>\"\n ]\n },\n \"flat_amount_discounts\": [\n {\n \"currency\": \"<string>\",\n \"amount\": 123\n }\n ],\n \"voucher_credit\": {\n \"object\": \"Credit\",\n \"token_amounts\": [\n {\n \"object\": \"TokenAmount\",\n \"token\": {\n \"object\": \"Token\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"amount\": 123,\n \"source\": \"<string>\"\n }\n ],\n \"currency_amounts\": [\n {\n \"object\": \"CurrencyAmount\",\n \"vid\": \"<string>\",\n \"currency\": \"<string>\",\n \"amount\": 123,\n \"metadata\": {},\n \"sort_value\": 123,\n \"description\": \"<string>\",\n \"reason\": \"<string>\",\n \"granted_by_cashbox\": true,\n \"granted\": \"<string>\",\n \"account\": {\n \"object\": \"Account\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\"\n },\n \"subscription\": {\n \"object\": \"Subscription\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\"\n }\n }\n ]\n },\n \"coupons\": [\n {\n \"object\": {},\n \"id\": \"<string>\",\n \"index\": 123,\n \"expires\": \"2023-11-07T05:31:56Z\",\n \"max_redemptions\": 123,\n \"codes_requested\": 123,\n \"codes_generated\": 123,\n \"coupon_prefix\": \"<string>\",\n \"coupon_code_separator\": \"<string>\",\n \"requires_activation_before_use\": true,\n \"on_demand_codes_allowed\": true\n }\n ],\n \"item_display_text\": \"<string>\",\n \"max_redemptions_per_customer\": 123,\n \"max_redemptions_per_autobill\": 123,\n \"apply_voucher_pre_transaction\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns")
.header("Content-Type", "application/json")
.body("{\n \"object\": \"<string>\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"offer_start_date\": \"2023-11-07T05:31:56Z\",\n \"offer_end_date\": \"2023-11-07T05:31:56Z\",\n \"campaign_discount_method\": \"<string>\",\n \"type\": \"<string>\",\n \"percentage_discount\": \"<string>\",\n \"apply_discount_per_item\": \"<string>\",\n \"account_level_eligible\": \"<string>\",\n \"purchase_level_eligible\": \"<string>\",\n \"eligible_billing_plans\": {\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"object\": \"BillingPlan\",\n \"created\": \"<string>\",\n \"description\": \"<string>\",\n \"tax_classification\": \"<string>\",\n \"br_tax_category\": \"<string>\",\n \"trial\": {\n \"object\": \"BillingPlanPeriod\",\n \"quantity\": 123,\n \"cycles\": 123,\n \"prices\": [\n {\n \"object\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"price_list_name\": \"<string>\",\n \"token_amount\": {\n \"object\": \"TokenAmount\",\n \"token\": {\n \"object\": \"Token\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"amount\": 123,\n \"source\": \"<string>\"\n }\n }\n ]\n },\n \"periods\": [\n {\n \"object\": \"BillingPlanPeriod\",\n \"quantity\": 123,\n \"cycles\": 123,\n \"prices\": [\n {\n \"object\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"price_list_name\": \"<string>\",\n \"token_amount\": {\n \"object\": \"TokenAmount\",\n \"token\": {\n \"object\": \"Token\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"amount\": 123,\n \"source\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"billing_notification_days\": 123,\n \"trial_end_notification_days\": 123,\n \"skip_initial_billing_notification\": true,\n \"end_of_life\": \"<string>\",\n \"metadata\": {},\n \"entitlements\": [\n {\n \"id\": \"<string>\",\n \"object\": \"Entitlement\",\n \"description\": \"<string>\"\n }\n ],\n \"billing_descriptor\": \"<string>\",\n \"times_to_run\": \"<string>\",\n \"entitlements_valid_for\": \"<string>\",\n \"repeat_every\": \"<string>\",\n \"season_set\": {\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"object\": \"SeasonSet\",\n \"created\": \"<string>\",\n \"seasons\": [\n {\n \"object\": \"Season\",\n \"description\": \"<string>\",\n \"starts\": \"<string>\",\n \"ends\": \"<string>\"\n }\n ],\n \"metadata\": {}\n },\n \"days_before_season_to_bill\": 123,\n \"days_entitled_before_season\": 123,\n \"days_entitled_after_season\": 123,\n \"entitled_off_season\": true,\n \"used_on_subscriptions\": true,\n \"grace_period_override\": 123\n },\n \"restrict_to_new_subscription\": true,\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"number_of_periods\": 123,\n \"promotion_code\": \"<string>\",\n \"promotion_code_aliases\": {\n \"object\": \"List\",\n \"total_count\": 123,\n \"data\": [\n \"<string>\"\n ]\n },\n \"flat_amount_discounts\": [\n {\n \"currency\": \"<string>\",\n \"amount\": 123\n }\n ],\n \"voucher_credit\": {\n \"object\": \"Credit\",\n \"token_amounts\": [\n {\n \"object\": \"TokenAmount\",\n \"token\": {\n \"object\": \"Token\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"amount\": 123,\n \"source\": \"<string>\"\n }\n ],\n \"currency_amounts\": [\n {\n \"object\": \"CurrencyAmount\",\n \"vid\": \"<string>\",\n \"currency\": \"<string>\",\n \"amount\": 123,\n \"metadata\": {},\n \"sort_value\": 123,\n \"description\": \"<string>\",\n \"reason\": \"<string>\",\n \"granted_by_cashbox\": true,\n \"granted\": \"<string>\",\n \"account\": {\n \"object\": \"Account\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\"\n },\n \"subscription\": {\n \"object\": \"Subscription\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\"\n }\n }\n ]\n },\n \"coupons\": [\n {\n \"object\": {},\n \"id\": \"<string>\",\n \"index\": 123,\n \"expires\": \"2023-11-07T05:31:56Z\",\n \"max_redemptions\": 123,\n \"codes_requested\": 123,\n \"codes_generated\": 123,\n \"coupon_prefix\": \"<string>\",\n \"coupon_code_separator\": \"<string>\",\n \"requires_activation_before_use\": true,\n \"on_demand_codes_allowed\": true\n }\n ],\n \"item_display_text\": \"<string>\",\n \"max_redemptions_per_customer\": 123,\n \"max_redemptions_per_autobill\": 123,\n \"apply_voucher_pre_transaction\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"object\": \"<string>\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"offer_start_date\": \"2023-11-07T05:31:56Z\",\n \"offer_end_date\": \"2023-11-07T05:31:56Z\",\n \"campaign_discount_method\": \"<string>\",\n \"type\": \"<string>\",\n \"percentage_discount\": \"<string>\",\n \"apply_discount_per_item\": \"<string>\",\n \"account_level_eligible\": \"<string>\",\n \"purchase_level_eligible\": \"<string>\",\n \"eligible_billing_plans\": {\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"object\": \"BillingPlan\",\n \"created\": \"<string>\",\n \"description\": \"<string>\",\n \"tax_classification\": \"<string>\",\n \"br_tax_category\": \"<string>\",\n \"trial\": {\n \"object\": \"BillingPlanPeriod\",\n \"quantity\": 123,\n \"cycles\": 123,\n \"prices\": [\n {\n \"object\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"price_list_name\": \"<string>\",\n \"token_amount\": {\n \"object\": \"TokenAmount\",\n \"token\": {\n \"object\": \"Token\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"amount\": 123,\n \"source\": \"<string>\"\n }\n }\n ]\n },\n \"periods\": [\n {\n \"object\": \"BillingPlanPeriod\",\n \"quantity\": 123,\n \"cycles\": 123,\n \"prices\": [\n {\n \"object\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"price_list_name\": \"<string>\",\n \"token_amount\": {\n \"object\": \"TokenAmount\",\n \"token\": {\n \"object\": \"Token\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"amount\": 123,\n \"source\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"billing_notification_days\": 123,\n \"trial_end_notification_days\": 123,\n \"skip_initial_billing_notification\": true,\n \"end_of_life\": \"<string>\",\n \"metadata\": {},\n \"entitlements\": [\n {\n \"id\": \"<string>\",\n \"object\": \"Entitlement\",\n \"description\": \"<string>\"\n }\n ],\n \"billing_descriptor\": \"<string>\",\n \"times_to_run\": \"<string>\",\n \"entitlements_valid_for\": \"<string>\",\n \"repeat_every\": \"<string>\",\n \"season_set\": {\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"object\": \"SeasonSet\",\n \"created\": \"<string>\",\n \"seasons\": [\n {\n \"object\": \"Season\",\n \"description\": \"<string>\",\n \"starts\": \"<string>\",\n \"ends\": \"<string>\"\n }\n ],\n \"metadata\": {}\n },\n \"days_before_season_to_bill\": 123,\n \"days_entitled_before_season\": 123,\n \"days_entitled_after_season\": 123,\n \"entitled_off_season\": true,\n \"used_on_subscriptions\": true,\n \"grace_period_override\": 123\n },\n \"restrict_to_new_subscription\": true,\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"number_of_periods\": 123,\n \"promotion_code\": \"<string>\",\n \"promotion_code_aliases\": {\n \"object\": \"List\",\n \"total_count\": 123,\n \"data\": [\n \"<string>\"\n ]\n },\n \"flat_amount_discounts\": [\n {\n \"currency\": \"<string>\",\n \"amount\": 123\n }\n ],\n \"voucher_credit\": {\n \"object\": \"Credit\",\n \"token_amounts\": [\n {\n \"object\": \"TokenAmount\",\n \"token\": {\n \"object\": \"Token\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"amount\": 123,\n \"source\": \"<string>\"\n }\n ],\n \"currency_amounts\": [\n {\n \"object\": \"CurrencyAmount\",\n \"vid\": \"<string>\",\n \"currency\": \"<string>\",\n \"amount\": 123,\n \"metadata\": {},\n \"sort_value\": 123,\n \"description\": \"<string>\",\n \"reason\": \"<string>\",\n \"granted_by_cashbox\": true,\n \"granted\": \"<string>\",\n \"account\": {\n \"object\": \"Account\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\"\n },\n \"subscription\": {\n \"object\": \"Subscription\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\"\n }\n }\n ]\n },\n \"coupons\": [\n {\n \"object\": {},\n \"id\": \"<string>\",\n \"index\": 123,\n \"expires\": \"2023-11-07T05:31:56Z\",\n \"max_redemptions\": 123,\n \"codes_requested\": 123,\n \"codes_generated\": 123,\n \"coupon_prefix\": \"<string>\",\n \"coupon_code_separator\": \"<string>\",\n \"requires_activation_before_use\": true,\n \"on_demand_codes_allowed\": true\n }\n ],\n \"item_display_text\": \"<string>\",\n \"max_redemptions_per_customer\": 123,\n \"max_redemptions_per_autobill\": 123,\n \"apply_voucher_pre_transaction\": true\n}"
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>"
}create a campaign
Creates a new Campaign.
curl --request POST \
--url https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns \
--header 'Content-Type: application/json' \
--data '
{
"object": "<string>",
"id": "<string>",
"vid": "<string>",
"name": "<string>",
"description": "<string>",
"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_billing_plans": {
"id": "<string>",
"vid": "<string>",
"object": "BillingPlan",
"created": "<string>",
"description": "<string>",
"tax_classification": "<string>",
"br_tax_category": "<string>",
"trial": {
"object": "BillingPlanPeriod",
"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",
"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,
"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
}
'import requests
url = "https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns"
payload = {
"object": "<string>",
"id": "<string>",
"vid": "<string>",
"name": "<string>",
"description": "<string>",
"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_billing_plans": {
"id": "<string>",
"vid": "<string>",
"object": "BillingPlan",
"created": "<string>",
"description": "<string>",
"tax_classification": "<string>",
"br_tax_category": "<string>",
"trial": {
"object": "BillingPlanPeriod",
"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",
"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,
"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
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
object: '<string>',
id: '<string>',
vid: '<string>',
name: '<string>',
description: '<string>',
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_billing_plans: {
id: '<string>',
vid: '<string>',
object: 'BillingPlan',
created: '<string>',
description: '<string>',
tax_classification: '<string>',
br_tax_category: '<string>',
trial: {
object: 'BillingPlanPeriod',
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',
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,
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
})
};
fetch('https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'object' => '<string>',
'id' => '<string>',
'vid' => '<string>',
'name' => '<string>',
'description' => '<string>',
'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_billing_plans' => [
'id' => '<string>',
'vid' => '<string>',
'object' => 'BillingPlan',
'created' => '<string>',
'description' => '<string>',
'tax_classification' => '<string>',
'br_tax_category' => '<string>',
'trial' => [
'object' => 'BillingPlanPeriod',
'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',
'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,
'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
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns"
payload := strings.NewReader("{\n \"object\": \"<string>\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"offer_start_date\": \"2023-11-07T05:31:56Z\",\n \"offer_end_date\": \"2023-11-07T05:31:56Z\",\n \"campaign_discount_method\": \"<string>\",\n \"type\": \"<string>\",\n \"percentage_discount\": \"<string>\",\n \"apply_discount_per_item\": \"<string>\",\n \"account_level_eligible\": \"<string>\",\n \"purchase_level_eligible\": \"<string>\",\n \"eligible_billing_plans\": {\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"object\": \"BillingPlan\",\n \"created\": \"<string>\",\n \"description\": \"<string>\",\n \"tax_classification\": \"<string>\",\n \"br_tax_category\": \"<string>\",\n \"trial\": {\n \"object\": \"BillingPlanPeriod\",\n \"quantity\": 123,\n \"cycles\": 123,\n \"prices\": [\n {\n \"object\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"price_list_name\": \"<string>\",\n \"token_amount\": {\n \"object\": \"TokenAmount\",\n \"token\": {\n \"object\": \"Token\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"amount\": 123,\n \"source\": \"<string>\"\n }\n }\n ]\n },\n \"periods\": [\n {\n \"object\": \"BillingPlanPeriod\",\n \"quantity\": 123,\n \"cycles\": 123,\n \"prices\": [\n {\n \"object\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"price_list_name\": \"<string>\",\n \"token_amount\": {\n \"object\": \"TokenAmount\",\n \"token\": {\n \"object\": \"Token\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"amount\": 123,\n \"source\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"billing_notification_days\": 123,\n \"trial_end_notification_days\": 123,\n \"skip_initial_billing_notification\": true,\n \"end_of_life\": \"<string>\",\n \"metadata\": {},\n \"entitlements\": [\n {\n \"id\": \"<string>\",\n \"object\": \"Entitlement\",\n \"description\": \"<string>\"\n }\n ],\n \"billing_descriptor\": \"<string>\",\n \"times_to_run\": \"<string>\",\n \"entitlements_valid_for\": \"<string>\",\n \"repeat_every\": \"<string>\",\n \"season_set\": {\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"object\": \"SeasonSet\",\n \"created\": \"<string>\",\n \"seasons\": [\n {\n \"object\": \"Season\",\n \"description\": \"<string>\",\n \"starts\": \"<string>\",\n \"ends\": \"<string>\"\n }\n ],\n \"metadata\": {}\n },\n \"days_before_season_to_bill\": 123,\n \"days_entitled_before_season\": 123,\n \"days_entitled_after_season\": 123,\n \"entitled_off_season\": true,\n \"used_on_subscriptions\": true,\n \"grace_period_override\": 123\n },\n \"restrict_to_new_subscription\": true,\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"number_of_periods\": 123,\n \"promotion_code\": \"<string>\",\n \"promotion_code_aliases\": {\n \"object\": \"List\",\n \"total_count\": 123,\n \"data\": [\n \"<string>\"\n ]\n },\n \"flat_amount_discounts\": [\n {\n \"currency\": \"<string>\",\n \"amount\": 123\n }\n ],\n \"voucher_credit\": {\n \"object\": \"Credit\",\n \"token_amounts\": [\n {\n \"object\": \"TokenAmount\",\n \"token\": {\n \"object\": \"Token\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"amount\": 123,\n \"source\": \"<string>\"\n }\n ],\n \"currency_amounts\": [\n {\n \"object\": \"CurrencyAmount\",\n \"vid\": \"<string>\",\n \"currency\": \"<string>\",\n \"amount\": 123,\n \"metadata\": {},\n \"sort_value\": 123,\n \"description\": \"<string>\",\n \"reason\": \"<string>\",\n \"granted_by_cashbox\": true,\n \"granted\": \"<string>\",\n \"account\": {\n \"object\": \"Account\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\"\n },\n \"subscription\": {\n \"object\": \"Subscription\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\"\n }\n }\n ]\n },\n \"coupons\": [\n {\n \"object\": {},\n \"id\": \"<string>\",\n \"index\": 123,\n \"expires\": \"2023-11-07T05:31:56Z\",\n \"max_redemptions\": 123,\n \"codes_requested\": 123,\n \"codes_generated\": 123,\n \"coupon_prefix\": \"<string>\",\n \"coupon_code_separator\": \"<string>\",\n \"requires_activation_before_use\": true,\n \"on_demand_codes_allowed\": true\n }\n ],\n \"item_display_text\": \"<string>\",\n \"max_redemptions_per_customer\": 123,\n \"max_redemptions_per_autobill\": 123,\n \"apply_voucher_pre_transaction\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns")
.header("Content-Type", "application/json")
.body("{\n \"object\": \"<string>\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"offer_start_date\": \"2023-11-07T05:31:56Z\",\n \"offer_end_date\": \"2023-11-07T05:31:56Z\",\n \"campaign_discount_method\": \"<string>\",\n \"type\": \"<string>\",\n \"percentage_discount\": \"<string>\",\n \"apply_discount_per_item\": \"<string>\",\n \"account_level_eligible\": \"<string>\",\n \"purchase_level_eligible\": \"<string>\",\n \"eligible_billing_plans\": {\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"object\": \"BillingPlan\",\n \"created\": \"<string>\",\n \"description\": \"<string>\",\n \"tax_classification\": \"<string>\",\n \"br_tax_category\": \"<string>\",\n \"trial\": {\n \"object\": \"BillingPlanPeriod\",\n \"quantity\": 123,\n \"cycles\": 123,\n \"prices\": [\n {\n \"object\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"price_list_name\": \"<string>\",\n \"token_amount\": {\n \"object\": \"TokenAmount\",\n \"token\": {\n \"object\": \"Token\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"amount\": 123,\n \"source\": \"<string>\"\n }\n }\n ]\n },\n \"periods\": [\n {\n \"object\": \"BillingPlanPeriod\",\n \"quantity\": 123,\n \"cycles\": 123,\n \"prices\": [\n {\n \"object\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"price_list_name\": \"<string>\",\n \"token_amount\": {\n \"object\": \"TokenAmount\",\n \"token\": {\n \"object\": \"Token\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"amount\": 123,\n \"source\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"billing_notification_days\": 123,\n \"trial_end_notification_days\": 123,\n \"skip_initial_billing_notification\": true,\n \"end_of_life\": \"<string>\",\n \"metadata\": {},\n \"entitlements\": [\n {\n \"id\": \"<string>\",\n \"object\": \"Entitlement\",\n \"description\": \"<string>\"\n }\n ],\n \"billing_descriptor\": \"<string>\",\n \"times_to_run\": \"<string>\",\n \"entitlements_valid_for\": \"<string>\",\n \"repeat_every\": \"<string>\",\n \"season_set\": {\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"object\": \"SeasonSet\",\n \"created\": \"<string>\",\n \"seasons\": [\n {\n \"object\": \"Season\",\n \"description\": \"<string>\",\n \"starts\": \"<string>\",\n \"ends\": \"<string>\"\n }\n ],\n \"metadata\": {}\n },\n \"days_before_season_to_bill\": 123,\n \"days_entitled_before_season\": 123,\n \"days_entitled_after_season\": 123,\n \"entitled_off_season\": true,\n \"used_on_subscriptions\": true,\n \"grace_period_override\": 123\n },\n \"restrict_to_new_subscription\": true,\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"number_of_periods\": 123,\n \"promotion_code\": \"<string>\",\n \"promotion_code_aliases\": {\n \"object\": \"List\",\n \"total_count\": 123,\n \"data\": [\n \"<string>\"\n ]\n },\n \"flat_amount_discounts\": [\n {\n \"currency\": \"<string>\",\n \"amount\": 123\n }\n ],\n \"voucher_credit\": {\n \"object\": \"Credit\",\n \"token_amounts\": [\n {\n \"object\": \"TokenAmount\",\n \"token\": {\n \"object\": \"Token\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"amount\": 123,\n \"source\": \"<string>\"\n }\n ],\n \"currency_amounts\": [\n {\n \"object\": \"CurrencyAmount\",\n \"vid\": \"<string>\",\n \"currency\": \"<string>\",\n \"amount\": 123,\n \"metadata\": {},\n \"sort_value\": 123,\n \"description\": \"<string>\",\n \"reason\": \"<string>\",\n \"granted_by_cashbox\": true,\n \"granted\": \"<string>\",\n \"account\": {\n \"object\": \"Account\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\"\n },\n \"subscription\": {\n \"object\": \"Subscription\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\"\n }\n }\n ]\n },\n \"coupons\": [\n {\n \"object\": {},\n \"id\": \"<string>\",\n \"index\": 123,\n \"expires\": \"2023-11-07T05:31:56Z\",\n \"max_redemptions\": 123,\n \"codes_requested\": 123,\n \"codes_generated\": 123,\n \"coupon_prefix\": \"<string>\",\n \"coupon_code_separator\": \"<string>\",\n \"requires_activation_before_use\": true,\n \"on_demand_codes_allowed\": true\n }\n ],\n \"item_display_text\": \"<string>\",\n \"max_redemptions_per_customer\": 123,\n \"max_redemptions_per_autobill\": 123,\n \"apply_voucher_pre_transaction\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://int-prodtest.m1amdocs.io/slmgw/v1/campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"object\": \"<string>\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"offer_start_date\": \"2023-11-07T05:31:56Z\",\n \"offer_end_date\": \"2023-11-07T05:31:56Z\",\n \"campaign_discount_method\": \"<string>\",\n \"type\": \"<string>\",\n \"percentage_discount\": \"<string>\",\n \"apply_discount_per_item\": \"<string>\",\n \"account_level_eligible\": \"<string>\",\n \"purchase_level_eligible\": \"<string>\",\n \"eligible_billing_plans\": {\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"object\": \"BillingPlan\",\n \"created\": \"<string>\",\n \"description\": \"<string>\",\n \"tax_classification\": \"<string>\",\n \"br_tax_category\": \"<string>\",\n \"trial\": {\n \"object\": \"BillingPlanPeriod\",\n \"quantity\": 123,\n \"cycles\": 123,\n \"prices\": [\n {\n \"object\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"price_list_name\": \"<string>\",\n \"token_amount\": {\n \"object\": \"TokenAmount\",\n \"token\": {\n \"object\": \"Token\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"amount\": 123,\n \"source\": \"<string>\"\n }\n }\n ]\n },\n \"periods\": [\n {\n \"object\": \"BillingPlanPeriod\",\n \"quantity\": 123,\n \"cycles\": 123,\n \"prices\": [\n {\n \"object\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"price_list_name\": \"<string>\",\n \"token_amount\": {\n \"object\": \"TokenAmount\",\n \"token\": {\n \"object\": \"Token\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"amount\": 123,\n \"source\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"billing_notification_days\": 123,\n \"trial_end_notification_days\": 123,\n \"skip_initial_billing_notification\": true,\n \"end_of_life\": \"<string>\",\n \"metadata\": {},\n \"entitlements\": [\n {\n \"id\": \"<string>\",\n \"object\": \"Entitlement\",\n \"description\": \"<string>\"\n }\n ],\n \"billing_descriptor\": \"<string>\",\n \"times_to_run\": \"<string>\",\n \"entitlements_valid_for\": \"<string>\",\n \"repeat_every\": \"<string>\",\n \"season_set\": {\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"object\": \"SeasonSet\",\n \"created\": \"<string>\",\n \"seasons\": [\n {\n \"object\": \"Season\",\n \"description\": \"<string>\",\n \"starts\": \"<string>\",\n \"ends\": \"<string>\"\n }\n ],\n \"metadata\": {}\n },\n \"days_before_season_to_bill\": 123,\n \"days_entitled_before_season\": 123,\n \"days_entitled_after_season\": 123,\n \"entitled_off_season\": true,\n \"used_on_subscriptions\": true,\n \"grace_period_override\": 123\n },\n \"restrict_to_new_subscription\": true,\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"number_of_periods\": 123,\n \"promotion_code\": \"<string>\",\n \"promotion_code_aliases\": {\n \"object\": \"List\",\n \"total_count\": 123,\n \"data\": [\n \"<string>\"\n ]\n },\n \"flat_amount_discounts\": [\n {\n \"currency\": \"<string>\",\n \"amount\": 123\n }\n ],\n \"voucher_credit\": {\n \"object\": \"Credit\",\n \"token_amounts\": [\n {\n \"object\": \"TokenAmount\",\n \"token\": {\n \"object\": \"Token\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"amount\": 123,\n \"source\": \"<string>\"\n }\n ],\n \"currency_amounts\": [\n {\n \"object\": \"CurrencyAmount\",\n \"vid\": \"<string>\",\n \"currency\": \"<string>\",\n \"amount\": 123,\n \"metadata\": {},\n \"sort_value\": 123,\n \"description\": \"<string>\",\n \"reason\": \"<string>\",\n \"granted_by_cashbox\": true,\n \"granted\": \"<string>\",\n \"account\": {\n \"object\": \"Account\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\"\n },\n \"subscription\": {\n \"object\": \"Subscription\",\n \"id\": \"<string>\",\n \"vid\": \"<string>\"\n }\n }\n ]\n },\n \"coupons\": [\n {\n \"object\": {},\n \"id\": \"<string>\",\n \"index\": 123,\n \"expires\": \"2023-11-07T05:31:56Z\",\n \"max_redemptions\": 123,\n \"codes_requested\": 123,\n \"codes_generated\": 123,\n \"coupon_prefix\": \"<string>\",\n \"coupon_code_separator\": \"<string>\",\n \"requires_activation_before_use\": true,\n \"on_demand_codes_allowed\": true\n }\n ],\n \"item_display_text\": \"<string>\",\n \"max_redemptions_per_customer\": 123,\n \"max_redemptions_per_autobill\": 123,\n \"apply_voucher_pre_transaction\": true\n}"
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>"
}Body
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
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?

