Promotions


Parameters

Name In Type Required Description
org path string true Organization name
subscriptionId path string(uuid) true Subscription unique identifier
body body SalePromotionsRequest true ‘none’

Request body - instance of SalePromotionsRequest

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
  "execution_mode": "VALIDATION",
  "validation_id": "123e4567-e89b-12d3-a456-426614174000",
  "requested_promotions": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "catalogue_id": "123",
      "activation_date": "2022-12-01T00:00:00Z",
      "expiration_date": "2022-12-01T00:00:00Z",
      "deactivation_date": "2022-12-01T00:00:00Z"
    }
  ]
}
Name Type Required Description
execution_mode ExecutionMode true Defines whether the operation is simulated or actually performed
validation_id string(uuid) false Identifier of the previously performed sale validation. Required only when execution mode is set to EXECUTION. This identifier expires after a limited time window, after which the sale must be validated again.
requested_promotions PromotionsSet true List of promotions to be applied

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15

curl -X POST https://subscriptions.masstack.com/v2/orgs/yoigo/sale/subscriptions/ce2f20cb-35df-4ffe-bca6-c0ed0c28cb39/promotions \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
 --data-raw "{
  'execution_mode': 'VALIDATION',
  'validation_id': '123e4567-e89b-12d3-a456-426614174000',
  'requested_promotions': [
    {
      'catalogue_id': '123'
    }
  ]
}" 

Responses

Code Meaning Description Schema
200 OK Promotions response SalePromotionsResponse
400 Bad Request Bad request ErrorResponse
403 Forbidden Forbidden access ErrorResponse
500 Internal Server Error Internal server error ErrorResponse
default Default Any client or server error ErrorResponse

Parameters

Name In Type Required Description
org path string true Organization name
bundleId path string(uuid) true Bundle unique identifier
body body SalePromotionsRequest true ‘none’

Request body - instance of SalePromotionsRequest

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
  "execution_mode": "VALIDATION",
  "validation_id": "123e4567-e89b-12d3-a456-426614174000",
  "requested_promotions": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "catalogue_id": "123",
      "activation_date": "2022-12-01T00:00:00Z",
      "expiration_date": "2022-12-01T00:00:00Z",
      "deactivation_date": "2022-12-01T00:00:00Z"
    }
  ]
}
Name Type Required Description
execution_mode ExecutionMode true Defines whether the operation is simulated or actually performed
validation_id string(uuid) false Identifier of the previously performed sale validation. Required only when execution mode is set to EXECUTION. This identifier expires after a limited time window, after which the sale must be validated again.
requested_promotions PromotionsSet true List of promotions to be applied

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15

curl -X POST https://subscriptions.masstack.com/v2/orgs/yoigo/sale/bundles/ce2f20cb-35df-4ffe-bca6-c0ed0c28cb39/subscriptions/promotions \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
 --data-raw "{
  'execution_mode': 'VALIDATION',
  'validation_id': '123e4567-e89b-12d3-a456-426614174000',
  'requested_promotions': [
    {
      'catalogue_id': '123'
    }
  ]
}" 

Responses

Code Meaning Description Schema
200 OK Promotions response SalePromotionsResponse
400 Bad Request Bad request ErrorResponse
403 Forbidden Forbidden access ErrorResponse
500 Internal Server Error Internal server error ErrorResponse
default Default Any client or server error ErrorResponse

Parameters

Name In Type Required Description
org path string true Organization name
subscriptionId path string(uuid) true Subscription unique identifier
promotionId path string(uuid) true Promotion unique identifier
body body TerminateSubscriptionPromotionRequest true ‘none’

Request body - instance of TerminateSubscriptionPromotionRequest

1
2
3
4
{
  "termination_date": "2023-01-01T00:00:00Z",
  "reason": "SUBSCRIPTION_DEACTIVATION"
}
Name Type Required Description
termination_date string(date-time) false Date and time when the termination should take place. Format according to ISO 8601
reason PromotionTerminationReasons true Reason for the termination

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10

curl -X POST https://subscriptions.masstack.com/v2/orgs/yoigo/sale/subscriptions/ce2f20cb-35df-4ffe-bca6-c0ed0c28cb39/promotions/ce2f20cb-35df-4ffe-bca6-c0ed0c28cb39/terminate \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
 --data-raw "{
  'termination_date': '2023-01-01T00:00:00Z',
  'reason': 'SUBSCRIPTION_DEACTIVATION'
}" 

Responses

Code Meaning Description Schema
202 Accepted Termination process started None
400 Bad Request Bad request ErrorResponse
403 Forbidden Forbidden access ErrorResponse
500 Internal Server Error Internal server error ErrorResponse
default Default Any client or server error ErrorResponse

Parameters

Name In Type Required Description
org path string true Organization name
bundleId path string(uuid) true Bundle unique identifier
body body TerminatePromotionInAllBundleSubscriptionsRequest true ‘none’

Request body - instance of TerminatePromotionInAllBundleSubscriptionsRequest

1
2
3
4
5
{
  "termination_date": "2023-01-01T00:00:00Z",
  "reason": "SUBSCRIPTION_DEACTIVATION",
  "catalogue_promotion_id": "123"
}
Name Type Required Description
termination_date string(date-time) false Date and time when the termination should take place. Format according to ISO 8601
reason PromotionTerminationReasons true Reason for the termination
catalogue_promotion_id string true Catalogue promotion ID to be terminated in all applicable subscriptions within the bundle

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11

curl -X POST https://subscriptions.masstack.com/v2/orgs/yoigo/sale/bundles/ce2f20cb-35df-4ffe-bca6-c0ed0c28cb39/subscriptions/promotions/terminate \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
 --data-raw "{
  'termination_date': '2023-01-01T00:00:00Z',
  'reason': 'SUBSCRIPTION_DEACTIVATION',
  'catalogue_promotion_id': '123'
}" 

Responses

Code Meaning Description Schema
202 Accepted Termination process started None
400 Bad Request Bad request ErrorResponse
403 Forbidden Forbidden access ErrorResponse
500 Internal Server Error Internal server error ErrorResponse
default Default Any client or server error ErrorResponse

Endpoints

Promotions