Assign a product plan to the customer
1 min
POST
https://app.amberflo.io/customer-portal/pricing-plan
Query Parameters
- sessionTokenstringrequiredDescription
Body Parameters
- bodyamberflo-customer-pricing-request
- endTimeInSecondsintegerDescription
- productIdstringDescriptionDefault1
- productPlanIdstringrequiredDescription
- startTimeInSecondsintegerDescription
Responses
200
- amberflo-customer-pricing-response
- customerIdstring
- endTimeInSecondsinteger
- productIdstring
- productPlanIdstring
- relationIdstringDescription
- createdTimeInSecondsintegerDescription
- startTimeInSecondsintegerDescription
curl
curl --request POST \
--url 'https://app.amberflo.io/customer-portal/pricing-plan?sessionToken=string' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"productId": "1",
"productPlanId": ""
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"productId": "1",
"productPlanId": ""
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://app.amberflo.io/customer-portal/pricing-plan?sessionToken=string", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://app.amberflo.io/customer-portal/pricing-plan?sessionToken=string")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"productId": "1",
"productPlanId": ""
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://app.amberflo.io/customer-portal/pricing-plan?sessionToken=string"
payload = json.dumps({
"productId": "1",
"productPlanId": ""
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Successful response
{
"customerId": "",
"endTimeInSeconds": 0,
"productId": "",
"productPlanId": "",
"relationId": "",
"createdTimeInSeconds": 0,
"startTimeInSeconds": 0
}Use this endpoint to allow a customer to assign himself a plan.
The plan assignment can be scheduled to start at some point in the future by specifying a startTimeInSeconds.
If you'd like to cancel a customer's current plan, you should define a "default" plan and then use this API to assign it to the customer.