﻿@startuml
autonumber 1


skinparam titleBorderRoundCorner 15
skinparam titleBorderThickness 2
skinparam titleBorderColor red
skinparam titleBackgroundColor  Lightgreen
title Change Plan & Services Part 1
actor API_Partner
'comment: actor boundary control entity
note over API_Partner, APIGEE_Proxy
OAuth 2.0 Token Based Authentication
end note

note over API_Partner
required headers for all APIs
----
Content-Type : application/json
B2b-client : TEST
B2b-org : 7000000999999911111
Authorization : <OAuth2 access_token>
end note

note over API_Partner
(1) Select rate-plans API
---
required path parameters
mobile-number=MjQ4Nzg3MzMyNw
---
required query parameters
org=7000000999999911111
end note

API_Partner->APIGEE_Proxy :  GET /b2b-experience/v1/lines-of-service/MjQ4Nzg3MzMyNw/rate-plans?org=7000000999999911111



APIGEE_Proxy-[#0000FF]>API_Partner: Response {$.status,$.currentRatePlans[].pricePlanCode,$.eligibleRatePlans[].pricePlanCode}

note over APIGEE_Proxy
{
  "status": "SUCCESS",
     ....
  "currentRatePlans": [
    {
      "pricePlanCode": "SCVUTTB1Z",
     ...
    }],
  "eligibleRatePlans": [
    {
      "pricePlanCode": "ZNAUTT1",
    ....
    }
    ]
}
end note


note over API_Partner
(2) Select services API
---
required path parameters
mobile-number=MjQ4Nzg3MzMyNw
---
required query parameters
---
org=7000000999999911111
rateplan={$.eligibleRateplans[].pricePlanCode}
end note

API_Partner -> APIGEE_Proxy : GET /b2b-experience/v1/lines-of-service/MjQ4Nzg3MzMyNw/services?org=7000000999999911111&rateplan={$.eligibleRateplans[].pricePlanCode}

APIGEE_Proxy-[#0000FF]>API_Partner: Response {$.ban,$.currentServices.allServices[].soc, $.eligibleServices.allServices[].soc}
note over APIGEE_Proxy
{  
  "ban": "984512345",
   ....
  "currentServices": {
    "allServices": [
      {
        "soc": "GBBEMLB",
   ....
    }],
  "eligibleServices": {
   "allServices": [
     {
       "soc": "GBIBILLMB",
   ....
   }],
}
end note

note over API_Partner, APIGEE_Proxy
	Error Response On Any Call Will Terminate The Transaction
end note
@enduml