Promotions

Access to promotions


Parameters

Name In Type Required Description
org_id path string true Organization name
id path string true Subscription Id
body body PostPromotion true ‘none’

Request body - JsonObject

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
{
  "id": 1233094,
  "promotion_id": 76,
  "activation_date": "2017-09-15T22:00:00Z",
  "deactivation_date": "2017-09-15T22:00:00Z",
  "user_name": "test@test.com",
  "value": {
    "value": 8.264463,
    "currency": "euro"
  },
  "terms": {
    "id": 1233094,
    "terms_id": 76,
    "start_date": "2017-09-15T22:00:00Z",
    "end_date": "2017-09-15T22:00:00Z",
    "type": "PermanenceContract",
    "commitment_duration": 1
  }
}
Name Type Required Description
anonymous Promotion false none
Name Type Required Description
anonymous object false none

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

curl -X POST https://subscriptions.masstack.com/v1/orgs/masmovil/subscriptions/3821002/promotions \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
 --data-raw "{
  'id': 1233094,
  'promotion_id': 76,
  'activation_date': '2017-09-15T22:00:00Z',
  'deactivation_date': '2017-09-15T22:00:00Z',
  'user_name': 'test@test.com',
  'value': {
    'value': 8.264463,
    'currency': 'euro'
  },
  'terms': {
    'id': 1233094,
    'terms_id': 76,
    'start_date': '2017-09-15T22:00:00Z',
    'end_date': '2017-09-15T22:00:00Z',
    'type': 'PermanenceContract',
    'commitment_duration': 1
  }
}" 

Responses

Code Meaning Description Schema
201 Created Promotion creation successfully done PostPromotionResponse
400 Bad Request Invalid body ErrorMessage
404 Not Found A subscription with the specified id was not found ErrorMessage
409 Conflict Conflict with the current status ErrorMessage
500 Internal Server Error Unexpected error ErrorMessage

Parameters

Name In Type Required Description
org_id path string true Organization name
id path string true Subscription Id
promotion_id path string true Promotion Id
body body PostPromotionDeactivate true ‘none’

Request body - instance of PostPromotionDeactivate

1
2
3
4
5
{
  "deactivation_date": "2017-09-15T22:00:00Z",
  "user_name": "test@test.com",
  "status_change_reason": "customer request"
}
Name Type Required Description
deactivation_date string(date-time) true promotion deactivation date (Mysim EndDate)
user_name string false user name of the user who deactivates the promotion
status_change_reason string false promotion status change reason

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10

curl -X POST https://subscriptions.masstack.com/v1/orgs/masmovil/subscriptions/3821002/promotions/6736/deactivate \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
 --data-raw "{
  'deactivation_date': '2017-09-15T22:00:00Z',
  'user_name': 'test@test.com',
  'status_change_reason': 'customer request'
}" 

Responses

Code Meaning Description Schema
204 No Content promotion deactivation successfully done None
400 Bad Request Invalid body ErrorMessage
404 Not Found A subscription or promotion with the specified id was not found ErrorMessage
409 Conflict The request could not be completed due to a conflict with the current state of the resource ErrorMessage
500 Internal Server Error Unexpected error ErrorMessage

400 - instance of ErrorMessage

Custom schema example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
  "errors": [
    {
      "code": "XXX_21201",
      "title": "TITLE_OF_THE_DOMAIN_ERROR",
      "ref": "https://developers.masstack.com/en/docs/apis_domain_doc_swagger/2/apioverview/#erro",
      "details": "string"
    }
  ]
}
Name Type Required Description
errors [ErrorMessageItem] true none

Endpoints

AccountBundles

    Apple Watch

      Credit Limits

        Devices

          Fraud Requests

            FreeUnitsPackages

              Promotions

                Segments

                  Subscription Commercial Products

                    Subscriptions

                      Contracts