Context
You want to control the offer change and ensure that your customers only upgrade to specific existing custom subscriptions.
Here, the customer does not choose the offer to switch to. They are directly redirected to the subscription of the new specified offer.
Therefore, there is no need to present an offer change grid.
Procedure
Step 1: Retrieve the current subscription Id.
In this case, you need to first retrieve the current subscription Id of the customer through an API call.
You simply need to know the reference of the customer concerned.
Example: Retrieve a Subscription
GET https://api-2.proabono.com/v1/Subscription?ReferenceCustomer={ReferenceCustomer}
Response:
{ "Id": 594627, "IdSegment": 1441, "IdOffer": 9282, "IdCustomer": 786678, "IdCustomerBuyer": 786678, "ReferenceSegment": "1bis", "ReferenceOffer": "2", "ReferenceCustomer": "10381d0a-d1d1-4f6f-a67e-f9d0f0fb5cc9", "ReferenceCustomerBuyer": "10381d0a-d1d1-4f6f-a67e-f9d0f0fb5cc9", "StateSubscription": "Running", "DateStart": "2021-04-23T13:13:14.00Z", "DatePeriodStart": "2022-02-23T13:13:14.00Z", "DatePeriodEnd": "2022-03-23T13:13:14.00Z", "DateTerm": "2022-03-23T13:13:14.00Z", "DateResetConsumption": "2022-03-23T13:13:14.00Z", "StateSubscriptionAfterTerm": "Running", "IsEngaged": false, "IsCustomerBillable": true, "IsPaymentCappingReached": false, "DateNextBilling": "2022-03-23T19:13:14.00Z", "TitleLocalized": "Test 2", "AmountUpFront": 0, "AmountRecurrence": 6000, "DurationRecurrence": 1, "UnitRecurrence": "Month", "DateUpdate": "2022-02-24T11:14:19.91Z", "Links": [ { "rel": "self", "href": "/v1/Subscription/594627" }, { "rel": "hosted-related-subscription", "href": "https://https://sandbox-eur.proabono.com/portal-sub/{Unique-Encrypted-URL1}" }, { "rel": "hosted-upgrade", "href": "https://https://sandbox-eur.proabono.com/upgrades/{Unique-Encrypted-URL2}" } ] }
Step 2a: Perform the upgrade to the target subscription.
Once the Id is retrieved, you can perform the upgrade to the targeted subscription.
To do this, you simply need to make an API call specifying the Id of the chosen subscription to trigger the upgrade to that offer.
This instantly performs the offer change.
Example: Upgrade a Subscription
POST https://api-2.proabono.com/v1/Subscription/{FromIdSubscription}/Upgrade?IdSubscription={ToIdSubscription}
Step 2b: Redirect the customer to the offer change tunnel to the target subscription.
Once the Id is retrieved, you can obtain a unique link to send to your customer to perform the offer change to the targeted subscription.
To do this, simply make a GET API call specifying the Id of the chosen subscription. This retrieves the link called Hosted-Upgrade to redirect the customer to the offer change process.
Example: Upgrade a Subscription to another Subscription
GET https://api-2.proabono.com/v1/Subscription/{IdTargetedSubscription}/?IdSubscriptionToUpgrade={IdCurrentSubscription}
Response:
{ "Id": 812478, "IdSegment": 1441, "IdOffer": 9273, "IdCustomer": 947094, "IdCustomerBuyer": 947094, "ReferenceSegment": "EUR", "ReferenceOffer": "1000000000000000", "ReferenceCustomer": "9fb7ca7d-c3dd-464a-ae17-e4a48a3f89dc", "ReferenceCustomerBuyer": "9fb7ca7d-c3dd-464a-ae17-e4a48a3f89dc", "StateSubscription": "InitiatedAgent", "StateSubscriptionAfterTerm": "InitiatedAgent", "IsEngaged": false, "IsCustomerBillable": true, "IsPaymentCappingReached": false, "TitleLocalized": "Starter", "AmountRecurrence": 35000, "DurationRecurrence": 1, "UnitRecurrence": "Month", "Features": [ { "Id": 8993, "ReferenceFeature": "support-24", "IsVisible": true, "Properties": "None", "TitleLocalized": "24/7 Support", "DescriptionLocalized": "Support is mainly available through the chat bubble at the bottom of the page. However, you can also access support from your email when you leave the Web application.", "PricingLocalized": "optional+10.00 €", "TypeFeature": "OnOff", "IsIncluded": false, "IsEnabled": false }, { "Id": 10503, "ReferenceFeature": "bc23e4e1-bb3c-4f50-a992-b64a30689955", "IsVisible": true, "Properties": "None", "TitleLocalized": "session", "PricingLocalized": "10.00 €/unit", "TypeFeature": "Limitation", "QuantityIncluded": 0, "QuantityCurrent": 0 } ], "Discounts": [ { "Id": 249, "ReferenceDiscount": "3c07bec2-501b-4cbc-9ea0-b532993e66c9", "TargetFee": "All", "ValueOff": 1000, "TypeOff": "PerTenThousand", "Name": "5 periods discount - 10%", "TitleLocalized": "5 periods discount - 10%" } ], "DateUpdate": "2022-11-29T15:44:19.50Z", "Links": [ { "rel": "self", "href": "/v1/Subscription/812478" }, { "rel": "hosted-related-subscription", "href": "https://Gestion-Relance-Commerciale-EUR.proabono.com/portal-sub/8Wc7fbwMVnRzObGlIyd8WmWbnPEmuUPPG61p0i8DtyncuV31V0nzb8rbjcDBN4rreaO-oOH5AVLj6HYT5XlL3PskNV_SjSG5P5bBnt4RTIc" }, { "rel": "hosted-subscribe", "href": "https://Gestion-Relance-Commerciale-EUR.proabono.com/conclude/8Wc7fbwMVnRzObGlIyd8WmWbnPEmuUPPG61p0i8DtyncuV31V0nzb8rbjcDBN4rreaO-oOH5AVLj6HYT5XlL3PskNV_SjSG5P5bBnt4RTIc" }, { "rel": "hosted-register", "href": "https://Gestion-Relance-Commerciale-EUR.proabono.com/register/8Wc7fbwMVnRzObGlIyd8WmWbnPEmuUPPG61p0i8DtyncuV31V0nzb8rbjcDBN4rreaO-oOH5AVLj6HYT5XlL3HMaCI7fV5S9boJBLrLGRKs" }, { "rel": "hosted-upgrade", "href": "https://Gestion-Relance-Commerciale-EUR.proabono.com/upgrade-to-subscription/8Wc7fbwMVnRzObGlIyd8WmWbnPEmuUPPG61p0i8DtyncuV31V0nzb8rbjcDBN4rreaO-oOH5AVLj6HYT5XlL3G-M2wzB1UGxLaVf9XxNgOrL3P7Q7ZLQq3Eo5QfI7bQe" } ] }
“