Subscriptions

Access to subscriptions


Parameters

Name In Type Required Description
orgId path string true organization name
subscriptionId path integer(int64) true subscription identifier
query query Query false Use ‘include’ to get
  • ‘origin’ -> origin of the subscription (new, from portability, from migration, etc.)
  • ‘selldate’ -> date of last change of status
  • ‘historical_status’ -> all status changes over time, including the current one, sorted by time

Request example

1
2
3
4
5

curl -X GET https://customers.sta.masstack.com/v2/orgs/telco/subscriptions/214748364?query={"filter":["string"],"include":["string"]} \
  -H "Accept: application/json" \
  -H "x-auth-roles: API_KEY"

Responses

Code Meaning Description Schema
200 OK successful operation Subscription
400 Bad Request Invalid request body ErrorMessage
404 Not Found Resource not found ErrorMessage
405 Method Not Allowed Method not allowed None

200 - instance of Subscription

Custom schema 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
25
26
27
28
29
30
31
32
33
34
35
{
  "id": 214748364,
  "subscription_status": {
    "id": 1,
    "value": "INSTALADO"
  },
  "sell_date": "2017-09-15T22:00:00Z",
  "activated_date": "2017-09-15T22:00:00Z",
  "end_date": "2017-09-15T22:00:00Z",
  "subscription_type": {
    "id": 1,
    "value": "PRE-PAGO"
  },
  "origin": {
    "id": 214748364,
    "value": "NUEVA"
  },
  "historical_status": [
    {
      "subscription_status": {
        "id": 1,
        "value": "INSTALADO"
      },
      "date": "2017-09-15T22:00:00Z",
      "modified_by": "somebody"
    }
  ],
  "dealer_id": "string",
  "shop_id": "string",
  "path": "string",
  "filename": "string",
  "identification_nr": 12345,
  "imsi": 214035453370793,
  "iccid": 8934011411551283000
}
Name Type Required Description
id integer(int64) false ID of subscription to return
subscription_status Status false none
sell_date string(date-time) false none
activated_date string(date-time) false none
end_date string(date-time) false none
subscription_type SubscriptionType false none
origin Origin false to get origin use in url object query with include = origin. /subscriptions/{id}?query={“include”:[“origin”]}
historical_status [HistoricalStatus] false none
dealer_id string¦null false Dealer id (in some cases this field can be null)
shop_id string¦null false Shop id (in some cases this field can be null)
path string¦null false Contract path (in some cases this field can be null)
filename string¦null false Contract filename (in some cases this field can be null)
identification_nr integer(int32) false Phone number associated to subscription
imsi integer(int64)¦null false IMSI associated to mobile subscription (in some cases this field can be null)
iccid string¦null false Mobile online icc id (in some cases this field can be null)

Parameters

Name In Type Required Description
orgId path string true organization name
subscriptionId path integer(int64) true subscription identifier

Request example

1
2
3
4
5

curl -X GET https://customers.sta.masstack.com/v2/orgs/telco/subscriptions/214748364/devices \
  -H "Accept: application/json" \
  -H "x-auth-roles: API_KEY"

Responses

Code Meaning Description Schema
200 OK returns list of terminals of a subscription SubscriptionDevices
400 Bad Request Invalid request body ErrorMessage
404 Not Found Resource not found ErrorMessage
405 Method Not Allowed Method not allowed None

200 - instance of SubscriptionDevices

Custom schema 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
  "devices": [
    {
      "subscription_id": 214748364,
      "subscription_terminal_id": 214748364,
      "status": {
        "id": 214748364,
        "value": "ACTIVO"
      },
      "request_detail": {
        "created_date": "2017-09-15T22:00:00Z",
        "request_id": 214748364,
        "request_type": "captacion",
        "user_profile_role": "Generic"
      },
      "device_info": {
        "terminal_id": 214748364,
        "serial_number": 0,
        "device_model": "AIRPODS (2ª GENERACION) CON ESTUCHE DE CARGA BLANCO",
        "financed_by": "XFERA",
        "is_financed": false,
        "value_due_today": 120,
        "reservation_id": "e528d8ec-831f-40e9-8414-8ef7cc99c4e4",
        "paid": false
      },
      "fees": {
        "upfront_fee": 0,
        "installment_plan": {
          "last_installment_fee": 0,
          "monthly_fee": 6,
          "duration": 0,
          "unpaid_installments": 10,
          "financed_by": "XFERA"
        },
        "final_installment_plan": {
          "last_installment_fee": 0,
          "monthly_fee": 6,
          "duration": 0,
          "unpaid_installments": 10,
          "financed_by": "XFERA"
        }
      },
      "permanences": {
        "duration_months": 24,
        "current_duration_days": 120,
        "penalty_amount": 120.5,
        "current_penalty_amount": 120.5
      }
    }
  ]
}
Name Type Required Description
devices [DeviceResponse] false none

Parameters

Name In Type Required Description
orgId path string true organization name
subscriptionId path integer(int64) true subscription identifier
x-ip-address header string(ipv4) false origin ip address
body body AddDeviceToSubscriptionRequest true Add device to subscription

Request body - instance of AddDeviceToSubscriptionRequest

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
{
  "delivery_info": {
    "shipping_price": 999999999.99,
    "pay_in_return": true,
    "contact": {
      "name": "string",
      "phone": "string"
    },
    "address": {
      "address_id": "string",
      "description": "string",
      "street_type": "ACCESS",
      "street_name": "string",
      "number": "string",
      "block": "string",
      "bis": "str",
      "floor": "string",
      "stair": "string",
      "door": "string",
      "letter": "string",
      "hand1": "string",
      "hand2": "string",
      "postal_code": "string",
      "town": "string",
      "province_id": "28",
      "technical_id": "string"
    },
    "delivery_shop_id": "0025",
    "delivery_type": "LOGISTIC"
  },
  "sell": {
    "dealer_id": "C00002",
    "shop_id": "0025",
    "channel_id": 0,
    "category": "Generic",
    "payment": {
      "id": 999999999,
      "credit_card_reference": "string",
      "transaction_id": "9651BHUZ2A3",
      "reference_id": "string",
      "scoring": {
        "scoring_value": 0,
        "id_value": 0,
        "forced_value": 0,
        "up_front": 0.1,
        "credit_limit": 0.1,
        "credit_limit_available": 0.1,
        "app_id": 0
      },
      "platform": "PAYMENTS",
      "payment_link": "string",
      "tax": 21
    }
  },
  "client": {
    "customer_id": "string",
    "account_id": "string",
    "attributes": {
      "document_expiration_date": "1999-01-31",
      "employment": {
        "activity_country_code": "st",
        "company": "string",
        "income": 9999999999999.99,
        "income_source": {
          "id": 999999999,
          "observations": "string"
        },
        "profession": 999999999,
        "professional_area": 999999999,
        "professional_use": true
      }
    }
  },
  "device": {
    "device_details": {
      "id": 0,
      "model_id": "string",
      "cession_price": 999999999.99,
      "imei": "string",
      "pending_imei": true,
      "insured_amount": 0.01,
      "category": "string",
      "logistic_required": true,
      "catalogue_id": "string",
      "amount": 0.01
    },
    "fees": {
      "upfront_fee": 999999999.99,
      "installment_plan": {
        "commission": 999999999.99,
        "tae": 999999999.99,
        "tin": 999999999.99,
        "duration": 1,
        "monthly_fee": 999999999.99,
        "last_installment_fee": 999999999.99,
        "discount_final_payment_value": 999999999.99,
        "is_promotional_renew": true
      }
    },
    "financial_details": {
      "pre_booking": {
        "order_id": "string",
        "authorization_id": "string",
        "financial_entity": "string",
        "status": "Accepted",
        "granted_amount": 999999999,
        "credit_line_amount": 999999999,
        "total_client_financed_value": 999999999.99
      },
      "consents": {
        "commercial": true,
        "gdpr": true
      }
    },
    "campaign_id": 0,
    "terms": {
      "penalty_value": 999999999.99,
      "commitment_duration": 9999
    },
    "reservation_id": "string",
    "signature_process_id": 0,
    "signature_type": "PAPER",
    "old_subscription_terminal_id": 0
  },
  "subscription_offer_segment": "string"
}
Name Type Required Description
delivery_info DeviceDeliveryInfo false none
sell Sell true none
client DeviceClient true none
device Device true none
subscription_offer_segment string true 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
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133

curl -X POST https://customers.sta.masstack.com/v2/orgs/telco/subscriptions/214748364/devices \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "x-ip-address: 192.168.1.1" \
  -H "x-auth-roles: API_KEY" \
 --data-raw "{
  'delivery_info': {
    'shipping_price': 999999999.99,
    'pay_in_return': true,
    'contact': {
      'name': 'string',
      'phone': 'string'
    },
    'address': {
      'address_id': 'string',
      'description': 'string',
      'street_type': 'ACCESS',
      'street_name': 'string',
      'number': 'string',
      'block': 'string',
      'bis': 'str',
      'floor': 'string',
      'stair': 'string',
      'door': 'string',
      'letter': 'string',
      'hand1': 'string',
      'hand2': 'string',
      'postal_code': 'string',
      'town': 'string',
      'province_id': '28',
      'technical_id': 'string'
    },
    'delivery_shop_id': '0025',
    'delivery_type': 'LOGISTIC'
  },
  'sell': {
    'dealer_id': 'C00002',
    'shop_id': '0025',
    'channel_id': 0,
    'category': 'Generic',
    'payment': {
      'id': 999999999,
      'credit_card_reference': 'string',
      'transaction_id': '9651BHUZ2A3',
      'reference_id': 'string',
      'scoring': {
        'scoring_value': 0,
        'id_value': 0,
        'forced_value': 0,
        'up_front': 0.1,
        'credit_limit': 0.1,
        'credit_limit_available': 0.1,
        'app_id': 0
      },
      'platform': 'PAYMENTS',
      'payment_link': 'string',
      'tax': 21
    }
  },
  'client': {
    'customer_id': 'string',
    'account_id': 'string',
    'attributes': {
      'document_expiration_date': '1999-01-31',
      'employment': {
        'activity_country_code': 'st',
        'company': 'string',
        'income': 9999999999999.99,
        'income_source': {
          'id': 999999999,
          'observations': 'string'
        },
        'profession': 999999999,
        'professional_area': 999999999,
        'professional_use': true
      }
    }
  },
  'device': {
    'device_details': {
      'id': 0,
      'model_id': 'string',
      'cession_price': 999999999.99,
      'imei': 'string',
      'pending_imei': true,
      'insured_amount': 0.01,
      'category': 'string',
      'logistic_required': true,
      'catalogue_id': 'string',
      'amount': 0.01
    },
    'fees': {
      'upfront_fee': 999999999.99,
      'installment_plan': {
        'commission': 999999999.99,
        'tae': 999999999.99,
        'tin': 999999999.99,
        'duration': 1,
        'monthly_fee': 999999999.99,
        'last_installment_fee': 999999999.99,
        'discount_final_payment_value': 999999999.99,
        'is_promotional_renew': true
      }
    },
    'financial_details': {
      'pre_booking': {
        'order_id': 'string',
        'authorization_id': 'string',
        'financial_entity': 'string',
        'status': 'Accepted',
        'granted_amount': 999999999,
        'credit_line_amount': 999999999,
        'total_client_financed_value': 999999999.99
      },
      'consents': {
        'commercial': true,
        'gdpr': true
      }
    },
    'campaign_id': 0,
    'terms': {
      'penalty_value': 999999999.99,
      'commitment_duration': 9999
    },
    'reservation_id': 'string',
    'signature_process_id': 0,
    'signature_type': 'PAPER',
    'old_subscription_terminal_id': 0
  },
  'subscription_offer_segment': 'string'
}" 

Responses

Code Meaning Description Schema
201 Created successful operation AddDeviceToSubscriptionResponse
202 Accepted check risk decision AddDeviceToSubscriptionResponse
400 Bad Request Invalid request body ErrorMessage
404 Not Found Resource not found ErrorMessage
405 Method Not Allowed Method not allowed None

201 - instance of AddDeviceToSubscriptionResponse

Custom schema example

1
2
3
4
{
  "risk_decision": "string",
  "subscription_terminal_id": 0
}
Name Type Required Description
risk_decision string false none
subscription_terminal_id number(int64) false none

Parameters

Name In Type Required Description
orgId path string true organization name
subscriptionId path integer(int64) true subscription identifier
x-ip-address header string(ipv4) false origin ip address
body body SimReplacement true Contains dealer id, shop id (if present), offline/online value and new icc

Request body - instance of SimReplacement

1
2
3
4
5
6
{
  "dealer_id": "string",
  "shop_id": "string",
  "logistic": true,
  "new_icc": "string"
}
Name Type Required Description
dealer_id string true Dealer ID
shop_id string false Shop ID
logistic boolean true Online/offline operation
new_icc string false New icc

Request example

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

curl -X PATCH https://customers.sta.masstack.com/v2/orgs/telco/subscriptions/214748364/sim-replacement \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "x-ip-address: 192.168.1.1" \
  -H "x-auth-roles: API_KEY" \
 --data-raw "{
  'dealer_id': 'string',
  'shop_id': 'string',
  'logistic': true,
  'new_icc': 'string'
}" 

Responses

Code Meaning Description Schema
201 Created successful operation SimReplacementResponse
202 Accepted successful operation SimReplacementResponse
400 Bad Request Invalid request body ErrorMessage
404 Not Found Resource not found ErrorMessage
405 Method Not Allowed Method not allowed None

201 - instance of SimReplacementResponse

Custom schema example

1
2
3
{
  "risk_decision": "string"
}
Name Type Required Description
risk_decision string false none

Parameters

Name In Type Required Description
orgId path string true organization name
subscriptionId path integer(int64) true subscription identifier
start_date query string(date) false start date query with format yyyy-mm-dd
end_date query string(date) false end date query with format yyyy-mm-dd

Request example

1
2
3
4
5

curl -X GET https://customers.sta.masstack.com/v2/orgs/telco/subscriptions/214748364/recharge/detail?start_date='1970-01-01'&end_date='1970-01-01' \
  -H "Accept: application/json" \
  -H "x-auth-roles: API_KEY"

Responses

Code Meaning Description Schema
200 OK successful operation SubscriptionDetailRecharge
400 Bad Request Invalid request body ErrorMessage
404 Not Found Resource not found ErrorMessage
405 Method Not Allowed Method not allowed None

200 - instance of SubscriptionDetailRecharge

Custom schema example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
{
  "subscription_id": 214748364,
  "identification_nr": 12345,
  "period_date": {
    "start_date": "2020-05-01",
    "end_date": "2020-05-27"
  },
  "recharges": [
    {
      "recharge_id": 214748364,
      "date": "2020-05-17T12:13:11Z",
      "movement_type_id": 214748364,
      "origin_id": 214748364,
      "amount": 0
    }
  ]
}
Name Type Required Description
subscription_id integer(int64) false identification subscription
identification_nr integer(int32) false number of identification
period_date PeriodDate false none
recharges [DetailRechargeEvent] false [recharge detail record]

Endpoints

Signups

    Users

      Accounts

        Invoices

          Terms

            Payment info

              Account migrations

                Subscriptions

                  Products

                    Services

                      Bonuses

                        Promotions

                          Barrings

                            Consumption

                              Workorders

                                Penalties