Skip to content

Promotions Campaigns

Operations Summary

Method Endpoint Description
Core CRUD
GET /api/promotions-campaigns/ List Promotions Campaigns
GET /api/promotions-campaigns/{uuid}/ Retrieve
POST /api/promotions-campaigns/ Create
PUT /api/promotions-campaigns/{uuid}/ Update
DELETE /api/promotions-campaigns/{uuid}/ Delete
Other Actions
GET /api/promotions-campaigns/{uuid}/orders/ Return a list of orders for which the campaign is applied
GET /api/promotions-campaigns/{uuid}/resources/ Return a list of resources for which the campaign is applied
POST /api/promotions-campaigns/{uuid}/activate/ Activate campaign
POST /api/promotions-campaigns/{uuid}/terminate/ Terminate campaign

Core CRUD

List Promotions Campaigns

1
2
3
4
http \
  GET \
  https://api.example.com/api/promotions-campaigns/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.campaign_o_enum import CampaignOEnum # (1)
from waldur_api_client.models.campaign_state_enum import CampaignStateEnum # (2)
from waldur_api_client.api.promotions_campaigns import promotions_campaigns_list # (3)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = promotions_campaigns_list.sync(client=client)

for item in response:
    print(item)
  1. Model Source: CampaignOEnum
  2. Model Source: CampaignStateEnum
  3. API Source: promotions_campaigns_list
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import { promotionsCampaignsList } from 'waldur-js-client';

try {
  const response = await promotionsCampaignsList({
  auth: "Token YOUR_API_TOKEN"
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Description
discount_type string
end_date string (date)
o array Ordering

offering string (uri) Offering
offering_uuid string (uuid)
page integer A page number within the paginated result set.
page_size integer Number of results to return per page.
query string Search by name or coupon code
service_provider_uuid string (uuid)
start_date string (date)
state array

200 -

The response body is an array of objects, where each object has the following structure:

Field Type Description
uuid string (uuid)
name string
url string (uri)
start_date string (date) Starting from this date, the campaign is active.
end_date string (date) The last day the campaign is active.
coupon string If coupon is empty, campaign is available to all users.
discount_type string
Enum: discount, special_price
discount integer
stock integer
description string
months integer How many months in a row should the related service (when activated) get special deal (0 for indefinitely until active)
auto_apply boolean
state string
service_provider string (uri)
offerings array of objects
offerings.uuid string (uuid)
offerings.name string
required_offerings array of string (uuid)s

Retrieve

1
2
3
4
http \
  GET \
  https://api.example.com/api/promotions-campaigns/a1b2c3d4-e5f6-7890-abcd-ef1234567890/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.promotions_campaigns import promotions_campaigns_retrieve # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = promotions_campaigns_retrieve.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client
)

print(response)
  1. API Source: promotions_campaigns_retrieve
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { promotionsCampaignsRetrieve } from 'waldur-js-client';

try {
  const response = await promotionsCampaignsRetrieve({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid) ✓

200 -

Field Type Description
uuid string (uuid)
name string
url string (uri)
start_date string (date) Starting from this date, the campaign is active.
end_date string (date) The last day the campaign is active.
coupon string If coupon is empty, campaign is available to all users.
discount_type string
Enum: discount, special_price
discount integer
stock integer
description string
months integer How many months in a row should the related service (when activated) get special deal (0 for indefinitely until active)
auto_apply boolean
state string
service_provider string (uri)
offerings array of objects
offerings.uuid string (uuid)
offerings.name string
required_offerings array of string (uuid)s

Create

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
http \
  POST \
  https://api.example.com/api/promotions-campaigns/ \
  Authorization:"Token YOUR_API_TOKEN" \
  name="my-awesome-promotions-campaign" \
  start_date="2023-10-01" \
  end_date="2023-10-01" \
  discount_type="discount" \
  discount=123 \
  service_provider="https://api.example.com/api/service-provider/a1b2c3d4-e5f6-7890-abcd-ef1234567890/" \
  offerings:='[]'
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.campaign_request import CampaignRequest # (1)
from waldur_api_client.api.promotions_campaigns import promotions_campaigns_create # (2)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)

body_data = CampaignRequest(
    name="my-awesome-promotions-campaign",
    start_date="2023-10-01",
    end_date="2023-10-01",
    discount_type="discount",
    discount=123,
    service_provider="https://api.example.com/api/service-provider/a1b2c3d4-e5f6-7890-abcd-ef1234567890/",
    offerings=[]
)
response = promotions_campaigns_create.sync(
    client=client,
    body=body_data
)

print(response)
  1. Model Source: CampaignRequest
  2. API Source: promotions_campaigns_create
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
import { promotionsCampaignsCreate } from 'waldur-js-client';

try {
  const response = await promotionsCampaignsCreate({
  auth: "Token YOUR_API_TOKEN",
  body: {
    "name": "my-awesome-promotions-campaign",
    "start_date": "2023-10-01",
    "end_date": "2023-10-01",
    "discount_type": "discount",
    "discount": 123,
    "service_provider": "https://api.example.com/api/service-provider/a1b2c3d4-e5f6-7890-abcd-ef1234567890/",
    "offerings": []
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Field Type Required Description
name string ✓
start_date string (date) ✓ Starting from this date, the campaign is active.
end_date string (date) ✓ The last day the campaign is active.
coupon string If coupon is empty, campaign is available to all users.
discount_type string ✓
Enum: discount, special_price
discount integer ✓
stock integer
description string
months integer How many months in a row should the related service (when activated) get special deal (0 for indefinitely until active)
auto_apply boolean
service_provider string (uri) ✓
offerings array of string (uuid)s ✓
Constraints: write-only
required_offerings array of string (uuid)s

201 -

Field Type Description
uuid string (uuid)
name string
url string (uri)
start_date string (date) Starting from this date, the campaign is active.
end_date string (date) The last day the campaign is active.
coupon string If coupon is empty, campaign is available to all users.
discount_type string
Enum: discount, special_price
discount integer
stock integer
description string
months integer How many months in a row should the related service (when activated) get special deal (0 for indefinitely until active)
auto_apply boolean
state string
service_provider string (uri)
offerings array of objects
offerings.uuid string (uuid)
offerings.name string
required_offerings array of string (uuid)s

Update

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
http \
  PUT \
  https://api.example.com/api/promotions-campaigns/a1b2c3d4-e5f6-7890-abcd-ef1234567890/ \
  Authorization:"Token YOUR_API_TOKEN" \
  name="my-awesome-promotions-campaign" \
  start_date="2023-10-01" \
  end_date="2023-10-01" \
  discount_type="discount" \
  discount=123 \
  service_provider="https://api.example.com/api/service-provider/a1b2c3d4-e5f6-7890-abcd-ef1234567890/" \
  offerings:='[]'
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.campaign_request import CampaignRequest # (1)
from waldur_api_client.api.promotions_campaigns import promotions_campaigns_update # (2)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)

body_data = CampaignRequest(
    name="my-awesome-promotions-campaign",
    start_date="2023-10-01",
    end_date="2023-10-01",
    discount_type="discount",
    discount=123,
    service_provider="https://api.example.com/api/service-provider/a1b2c3d4-e5f6-7890-abcd-ef1234567890/",
    offerings=[]
)
response = promotions_campaigns_update.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client,
    body=body_data
)

print(response)
  1. Model Source: CampaignRequest
  2. API Source: promotions_campaigns_update
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { promotionsCampaignsUpdate } from 'waldur-js-client';

try {
  const response = await promotionsCampaignsUpdate({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  },
  body: {
    "name": "my-awesome-promotions-campaign",
    "start_date": "2023-10-01",
    "end_date": "2023-10-01",
    "discount_type": "discount",
    "discount": 123,
    "service_provider": "https://api.example.com/api/service-provider/a1b2c3d4-e5f6-7890-abcd-ef1234567890/",
    "offerings": []
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid) ✓
Field Type Required Description
name string ✓
start_date string (date) ✓ Starting from this date, the campaign is active.
end_date string (date) ✓ The last day the campaign is active.
coupon string If coupon is empty, campaign is available to all users.
discount_type string ✓
Enum: discount, special_price
discount integer ✓
stock integer
description string
months integer How many months in a row should the related service (when activated) get special deal (0 for indefinitely until active)
auto_apply boolean
service_provider string (uri) ✓
offerings array of string (uuid)s ✓
Constraints: write-only
required_offerings array of string (uuid)s

200 -

Field Type Description
uuid string (uuid)
name string
url string (uri)
start_date string (date) Starting from this date, the campaign is active.
end_date string (date) The last day the campaign is active.
coupon string If coupon is empty, campaign is available to all users.
discount_type string
Enum: discount, special_price
discount integer
stock integer
description string
months integer How many months in a row should the related service (when activated) get special deal (0 for indefinitely until active)
auto_apply boolean
state string
service_provider string (uri)
offerings array of objects
offerings.uuid string (uuid)
offerings.name string
required_offerings array of string (uuid)s

Delete

1
2
3
4
http \
  DELETE \
  https://api.example.com/api/promotions-campaigns/a1b2c3d4-e5f6-7890-abcd-ef1234567890/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.promotions_campaigns import promotions_campaigns_destroy # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = promotions_campaigns_destroy.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client
)

print(response)
  1. API Source: promotions_campaigns_destroy
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { promotionsCampaignsDestroy } from 'waldur-js-client';

try {
  const response = await promotionsCampaignsDestroy({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid) ✓

204 - No response body


Other Actions

Return a list of orders for which the campaign is applied

Return a list of orders for which the campaign is applied.

1
2
3
4
http \
  GET \
  https://api.example.com/api/promotions-campaigns/a1b2c3d4-e5f6-7890-abcd-ef1234567890/orders/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.order_details_field_enum import OrderDetailsFieldEnum # (1)
from waldur_api_client.api.promotions_campaigns import promotions_campaigns_orders_list # (2)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = promotions_campaigns_orders_list.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client
)

for item in response:
    print(item)
  1. Model Source: OrderDetailsFieldEnum
  2. API Source: promotions_campaigns_orders_list
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { promotionsCampaignsOrdersList } from 'waldur-js-client';

try {
  const response = await promotionsCampaignsOrdersList({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid) ✓
Name Type Description
field array
page integer A page number within the paginated result set.
page_size integer Number of results to return per page.

200 -

The response body is an array of objects, where each object has the following structure:

Field Type Description
offering string (uri)
offering_name string
offering_uuid string (uuid)
offering_description string
offering_image string (uri)
offering_thumbnail string (uri)
offering_type string
offering_shared boolean Accessible to all customers.
offering_billable boolean Purchase and usage is invoiced.
offering_plugin_options object (free-form) Public data used by specific plugin, such as storage mode for OpenStack.
provider_name string
provider_uuid string (uuid)
provider_slug string
provider_description string
category_title string
category_uuid string (uuid)
category_icon string (uri)
plan string (uri)
plan_unit any
plan_name string
plan_uuid string (uuid)
plan_description string
attributes object (free-form)
limits object (free-form)
uuid string (uuid)
created string (date-time)
modified string (date-time)
resource_uuid string (uuid)
resource_type string
resource_name string
resource_end_date string (date)
cost string (decimal)
state any
output string
output_updated_at string (date-time)
marketplace_resource_uuid string (uuid)
error_message string
error_traceback string
error_updated_at string (date-time)
callback_url string (uri)
completed_at string (date-time)
request_comment string
attachment string (uri)
type any
start_date string (date) Enables delayed processing of resource provisioning order.
slug string
url string (uri)
consumer_reviewed_by string Required. 128 characters or fewer. Lowercase letters, numbers and @/./+/-/_ characters
consumer_reviewed_by_full_name string
consumer_reviewed_by_username string Required. 128 characters or fewer. Lowercase letters, numbers and @/./+/-/_ characters
consumer_reviewed_at string (date-time)
provider_reviewed_by string Required. 128 characters or fewer. Lowercase letters, numbers and @/./+/-/_ characters
provider_reviewed_by_full_name string
provider_reviewed_by_username string Required. 128 characters or fewer. Lowercase letters, numbers and @/./+/-/_ characters
provider_reviewed_at string (date-time)
created_by_username string Required. 128 characters or fewer. Lowercase letters, numbers and @/./+/-/_ characters
created_by_full_name string
created_by_civil_number string
created_by_email string (email)
created_by_organization string
created_by_organization_country string
created_by_organization_registry_code string Company registration code of the user's organization, if known
created_by_organization_vat_code string VAT code of the user's organization
created_by_organization_address string Postal address of the user's organization
customer_name string
customer_uuid string (uuid)
customer_slug string
project_name string
project_uuid string (uuid)
project_description string
project_slug string
old_plan_name string
new_plan_name string
old_plan_uuid string (uuid)
new_plan_uuid string (uuid)
old_plan_billing_mode string
new_plan_billing_mode string
old_cost_estimate number (double) The old-limits estimate, snapshotted by init_cost() at creation. Must not recompute live: _compute_old_cost_estimate() prices from "today", which keeps advancing on every read while cost stays fixed from creation -- the shown cost change would grow the longer an order sits unread. Orders that predate this field have no snapshot, so they fall back to the live computation rather than a wrong zero.
new_cost_estimate string (decimal)
can_terminate boolean
fixed_price number (double)
activation_price number (double)
termination_comment string
backend_id string
order_subtype string
provider_message string
provider_message_url string (uri)
provider_message_attachment string (uri)
provider_message_updated_at string (date-time)
consumer_message string
consumer_message_attachment string (uri)
consumer_message_updated_at string (date-time)
consumer_rejection_comment string
provider_rejection_comment string
auto_approved boolean
auto_approved_by_rule_uuid string (uuid)
auto_approved_cost_limit_snapshot string (decimal)
issue any

Return a list of resources for which the campaign is applied

Return a list of resources for which the campaign is applied.

1
2
3
4
http \
  GET \
  https://api.example.com/api/promotions-campaigns/a1b2c3d4-e5f6-7890-abcd-ef1234567890/resources/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.models.resource_field_enum import ResourceFieldEnum # (1)
from waldur_api_client.api.promotions_campaigns import promotions_campaigns_resources_list # (2)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = promotions_campaigns_resources_list.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client
)

for item in response:
    print(item)
  1. Model Source: ResourceFieldEnum
  2. API Source: promotions_campaigns_resources_list
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { promotionsCampaignsResourcesList } from 'waldur-js-client';

try {
  const response = await promotionsCampaignsResourcesList({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid) ✓
Name Type Description
field array
page integer A page number within the paginated result set.
page_size integer Number of results to return per page.

200 -

The response body is an array of objects, where each object has the following structure:

Field Type Description
offering string (uri)
offering_name string
offering_uuid string (uuid)
offering_description string
offering_image string (uri)
offering_thumbnail string (uri)
offering_type string
offering_shared boolean Accessible to all customers.
offering_billable boolean Purchase and usage is invoiced.
offering_plugin_options object (free-form) Public data used by specific plugin, such as storage mode for OpenStack.
provider_name string
provider_uuid string (uuid)
provider_slug string
provider_description string
category_title string
category_uuid string (uuid)
category_icon string (uri)
plan string (uri)
plan_unit any
plan_name string
plan_uuid string (uuid)
plan_description string
attributes object (free-form)
limits object (free-form)
uuid string (uuid)
created string (date-time)
modified string (date-time)
url string (uri)
scope string
description string
state any
resource_uuid string (uuid)
backend_id string
effective_id string
resource_type string
project string (uri)
project_uuid string (uuid)
project_name string
project_description string
project_start_date string (date)
project_end_date string (date) The date is inclusive. Once reached, all project resource will be scheduled for termination.
project_effective_end_date string (date) Effective project end date including grace period. After this date, resources are terminated, except resources of offerings that disable the grace period — those are terminated on the raw project end date.
resource_effective_end_date string (date) The date this resource is scheduled to terminate: the earliest of its own end date and the project-driven termination date (the raw project end date if the offering disables the grace period, otherwise the effective with-grace end date).
project_is_in_grace_period boolean True if the project is past its end date but still within the grace period.
project_end_date_requested_by string (uri)
customer_uuid string (uuid)
customer_name string
offering_slug string
parent_offering_uuid string (uuid)
parent_offering_name string
parent_offering_slug string
offering_backend_id string
parent_uuid string (uuid)
parent_name string
backend_metadata any
is_usage_based boolean Returns True if the resource bills any component by usage under its plan.
is_limit_based boolean Returns True if the resource bills any component on user-adjustable limits under its plan.
name string
slug string URL-friendly identifier. Only editable by staff users.
current_usages object (free-form) Dictionary mapping component types to their latest reported usage amounts.
can_terminate boolean
report array of objects
report.header string Section header text
report.body string Section body content
end_date string (date) The date is inclusive. Once reached, a resource will be scheduled for termination.
end_date_requested_by string (uri)
end_date_updated_at string (date-time) Timestamp of the last end_date change.
username string
limit_usage object (free-form) Dictionary mapping limit-based component types to their consumed usage. Sums the ComponentUsage rows of the component's current period (the monthly billing period unless the component defines a longer limit_period), i.e. the period's high-watermark rather than the instantaneous current_usages value.
downscaled boolean
restrict_member_access boolean
paused boolean
usage_limit_restriction any Which restriction (paused or downscaled) was automatically applied because reported usage reached a component limit. Empty when no such restriction is active. Used so the automatic lift never clears a restriction that was set for another reason.
endpoints array of objects
endpoints.uuid string (uuid)
endpoints.name string
endpoints.url string URL of the access endpoint
error_message string
error_traceback string
options object (free-form)
available_actions array of strings
last_sync string (date-time)
order_in_progress any
creation_order any
service_settings_uuid string (uuid)
project_slug string
customer_slug string
user_requires_reconsent boolean Check if the current user needs to re-consent for this resource's offering.
renewal_date object (free-form)
offering_state any
offering_components array of objects
offering_components.uuid string (uuid)
offering_components.offering_uuid string (uuid)
offering_components.billing_type string
Enum: fixed, usage, limit, one, few
offering_components.type string Unique internal name of the measured unit, for example floating_ip.
offering_components.name string Display name for the measured unit, for example, Floating IP.
offering_components.description string
offering_components.measured_unit string Unit of measurement, for example, GB.
offering_components.unit_factor integer The conversion factor from backend units to measured_unit
offering_components.limit_period any
offering_components.limit_amount number (double)
offering_components.limit_decimal_places integer Number of decimal places accepted for this component's limit. 0 keeps the limit integer-only.
offering_components.article_code string
offering_components.max_value number (double)
offering_components.min_value number (double)
offering_components.max_available_limit number (double)
offering_components.is_boolean boolean
offering_components.default_limit number (double)
offering_components.factor integer
offering_components.is_builtin boolean The API's older name for billed_per_plan. It used to ask the plugin registry whether this component's type is one the plugin declares, which left out the OpenStack per-volume-type quotas: they are created by the volume type sync rather than declared, so the API called them provider components while the billing resolver treated them as builtin. Reading the stored flag makes the two agree.
offering_components.is_prepaid boolean
offering_components.overage_component string (uuid)
offering_components.min_prepaid_duration integer
offering_components.max_prepaid_duration integer
offering_components.prepaid_duration_step integer Step size in months for the initial prepaid duration at order creation. If set, only multiples of this value (starting from min_prepaid_duration) are valid. Defaults to 1 (any value between min and max).
offering_components.min_renewal_duration integer Minimum number of months allowed for a renewal.
offering_components.max_renewal_duration integer Maximum number of months allowed for a renewal.
offering_components.renewal_duration_step integer Step size in months for renewal. Only multiples of this value (starting from min_renewal_duration) are valid. Defaults to 1.
has_api_keys boolean Whether the resource owns any API keys, so the portal can offer key management without knowing which backend serves the resource.
offering_account_settings any

Activate campaign

Activate campaign.

1
2
3
4
http \
  POST \
  https://api.example.com/api/promotions-campaigns/a1b2c3d4-e5f6-7890-abcd-ef1234567890/activate/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.promotions_campaigns import promotions_campaigns_activate # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = promotions_campaigns_activate.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client
)

print(response)
  1. API Source: promotions_campaigns_activate
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { promotionsCampaignsActivate } from 'waldur-js-client';

try {
  const response = await promotionsCampaignsActivate({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid) ✓

200 - No response body


409 - No response body


Terminate campaign

Terminate campaign.

1
2
3
4
http \
  POST \
  https://api.example.com/api/promotions-campaigns/a1b2c3d4-e5f6-7890-abcd-ef1234567890/terminate/ \
  Authorization:"Token YOUR_API_TOKEN"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.promotions_campaigns import promotions_campaigns_terminate # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = promotions_campaigns_terminate.sync(
    uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    client=client
)

print(response)
  1. API Source: promotions_campaigns_terminate
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import { promotionsCampaignsTerminate } from 'waldur-js-client';

try {
  const response = await promotionsCampaignsTerminate({
  auth: "Token YOUR_API_TOKEN",
  path: {
    "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}
Name Type Required
uuid string (uuid) ✓

200 - No response body


409 - No response body