Use case: After completing sign-up, the pricing table is displayed for the user can select a plan and subscribe.
This is achieved with a single API call and a few lines of script.
Step 1 – Add the customer
Just after the user account creation process is complete, declare a new Customer using the API.
POST https://api-42.proabono.com/v1/Customer
{
"ReferenceSegment": "demo-eur",
"ReferenceCustomer": "cust-42",
"Name": "John Doe",
"Language": "en"
}
More information and additional parameters in the API Reference.
Step 2 – Display the pricing table
Install the pricing table the same way you installed the Customer Portal with the customer_ref parameter.
Add the JS library in the <head> tag of your page.
<script type="text/javascript" src="https://portal.proabono.com/Get/portal.js"></script>
Place a <div> in the page where you want to pricing table to show up.
<div id="proabono_portal">loading...</div>
Then load the pricing table.
<script type="text/javascript">
ProAbonoPortal.open({
business_id: 42,
segment_ref: "demo-eur",
customer_ref: "cust-42",
customer_lang: "en",
hash: "..." // optional in sandbox
});
</script>
That’s it. The pricing table will show up and the customer will be able to select a plan and subscribe.