Skews
Setup the tiers for any tiered billing products.
Introduction
Skews are a way to add multiple pricing tiers to a single product. For example, you may have a product that has a base price of $10, but you also want to offer a $20 tier. You can create a skew for the $20 tier and then add it to the product. When a customer purchases the product, they will be able to choose between the base price and the $20 tier. This can be setup for usage based billing on fields like emails, SMS, or API calls etc.
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the conversation.
- Name
organizationId
- Type
- string
- Description
Unique identifier for the organization.
- Name
productGroupId
- Type
- string
- Description
Unique identifier for the Product
- Name
groupName
- Type
- string
- Description
Name of the group Pro Subscription
- Name
levelName
- Type
- string
- Description
Name of the level (Example: Pro, Enterprise, etc.)
- Name
lower
- Type
- float
- Description
Lower bound of the level (Example: 0, 100, 1000, etc.)
- Name
upper
- Type
- float
- Description
Upper bound of the level (Example: 100, 1000, 10000, etc.)
- Name
price
- Type
- float
- Description
Price of the level USD (Example: 10, 100, 1000, etc.)
- Name
billingCycle
- Type
- string
- Description
Billing Cycle of the level (Example: monthly, yearly, etc.)
- Name
variable
- Type
- string
- Description
Variable of the level (Example: emails, sms, api, etc.)
- Name
startDate
- Type
- datetime
- Description
Start Date of the level (Example: 2021-01-01)
- Name
endDate
- Type
- datetime
- Description
End Date of the level (Example: 2021-12-31)
- Name
pricingId
- Type
- string
- Description
Unique identifier for the Pricing
- Name
skewName
- Type
- string
- Description
Name of the skew (Example: 2022 Pricing, 2023 Pricing, etc.)
- Name
createdAt
- Type
- datetime
- Description
Date and time when the skew was created.
- Name
updatedAt
- Type
- datetime
- Description
Date and time when the skew was updated.
Create Skews
Create Pricing of Leveled Billing and subscriptions
Required attributes
- Name
organizationId
- Type
- string
- Description
Unique identifier for the organization.
- Name
groupId
- Type
- string
- Description
Unique identifier for the Product
- Name
variable
- Type
- string
- Description
Variable for usage based billing
- Name
billingCycyle
- Type
- string
- Description
Billing Cycle of the level (Example: Monthly, Yearly, etc.)
- Name
pricingId
- Type
- string
- Description
Unique identifier for the Pricing
- Name
levels
- Type
- array
- Description
Array of levels
Request
curl --location --request POST 'https://api.bluehillpayments.io/skews/v2/create' \
--header 'Content-Type: application/json' \
--data-raw '{
"organizationId": "{{organizationId}}",
"groupId": "CC50636ACACA451F8482EEEBFE62A611",
"variable": "Abcd",
"billingCycyle": "Monthly",
"pricingId": "00E33C36F8894E10926179C9DCE50555",
"levels" : [
{
"levelName": "Level 1",
"lower": 0,
"upper": 10,
"price": 10.00
},
{
"levelName": "Level 2",
"lower": 10,
"upper": 20,
"price": 20.00
},
{
"levelName": "Level 3",
"lower": 20,
"upper": 30,
"price": 30.00
}
]
}'
Response
{
"status": "success"
}
Update Skews
Update Pricing of Leveled Billing and subscriptions
Required attributes
- Name
organizationId
- Type
- string
- Description
Unique identifier for the organization.
- Name
groupId
- Type
- string
- Description
Unique identifier for the Product
- Name
variable
- Type
- string
- Description
Variable for usage based billing
- Name
billingCycyle
- Type
- string
- Description
Billing Cycle of the level (Example: Monthly, Yearly, etc.)
- Name
pricingId
- Type
- string
- Description
Unique identifier for the Pricing
- Name
levels
- Type
- array
- Description
Array of levels
id
is required inlevels
property to update existing pricing
Request
curl --location --request PUT 'https://api.bluehillpayments.io/skews/v2/update' \
--header 'Content-Type: application/json' \
--data-raw '{
"organizationId": "{{organizationId}}",
"groupId": "CC50636ACACA451F8482EEEBFE62A611",
"variable": "Abcd",
"billingCycyle": "Monthly",
"pricingId": "00E33C36F8894E10926179C9DCE50555",
"levels" : [
{
"id": "0C28A46468814900A22DE40ACBA34BDF",
"levelName": "Level 1121",
"lower": 0,
"upper": 10,
"price": 10.00
}
]
}'
Response
{
"status": "success"
}
Get Skews For Product
Get Pricing Skews for a Product
Request
curl --location --request GET 'https://api.bluehillpayments.io/skews/get/D929195A875044179E26026353C531C1' \
--data-raw ''
Response
{
"data": [
{
"billingCycle": "Years",
"createdAt": "2022-12-09 18:29:07",
"endDate": null,
"groupName": "DV Pro Annual Subscription",
"id": "11ED0BDDE9B24AEDA9A7EEAC01A3BBE6",
"levelName": "0 - 1,000",
"lower": 0.0,
"organizationId": "37E1A66F6C464712B169251195C7F721",
"price": 170.0,
"pricingId": "BE1B337D6A7B4E9F9E7A13A4989CDC4A",
"productGroupId": "D929195A875044179E26026353C531C1",
"skewName": "2022 Pricing",
"startDate": null,
"updateAt": "2022-12-09 18:29:07",
"upper": 1000.0,
"variable": "Constituents"
},
...
],
"status": "success"
}
Get Skews For Pricing
Create Skews within pricing group
Request
curl --location --request GET 'https://api.bluehillpayments.io/skews/v2/get/CC50636ACACA451F8482EEEBFE62A611/00E33C36F8894E10926179C9DCE50555' \
--data-raw ''
Response
{
"data": [
{
"billingCycle": null,
"createdAt": "2023-01-20 19:15:01",
"endDate": null,
"groupName": null,
"id": "0C28A46468814900A22DE40ACBA34BDF",
"levelName": "Level 1121",
"lower": 0.0,
"organizationId": "{{organizationId}}",
"price": 10.0,
"pricingId": "00E33C36F8894E10926179C9DCE50555",
"productGroupId": "CC50636ACACA451F8482EEEBFE62A611",
"skewName": "New Level",
"startDate": null,
"updateAt": "2023-01-20 19:15:01",
"upper": 10.0,
"variable": "Abcd"
},
...
],
"status": "success"
}