Products and prices
Learn how to use products and prices in Pluto to model your business.
Products and prices allow you to model your business within Pluto. Products define what you're selling, while prices define how much and how often to charge the user.
You can create products and prices via the Pluto API. Once you've created a price, you can use it to create Payment Intents, Invoices, Subscriptions, Payment Links, and more.
What is a product?
Products define the good or service you're selling. They include basic information, such as the name, description, and image of the product you're offering your customers. Once you've created a product, you can use that product's ID to create a price.
What is a price?
Prices define how much and how often to charge the user for your products. You might want to charge your users a one-time fee, or a recurring SaaS fee. Once you've created a price, you can use that price's ID to create Payment Intents, Invoices, Subscriptions, and Payment Links via the Pluto API.
Crypto pricing
Many crypto businesses charge their users a fixed amount in crypto. For example, you might want to charge your users 0.1 ETH/mo. for access to a Discord server.
const { Pluto } = require('@plutohq/pluto-node');
const pluto = new Pluto(process.env.PLUTO_SECRET_KEY);
const price = await pluto.prices.create({
currency: 'eth',
chain: 'eth',
product: 'prod_NIfj309nc24ofwKOemctF',
amount: 0.1,
});
Fiat pricing
Alternatively, you might want to charge your users a fixed fiat price. For example, you might want to charge your users $30/mo. in ETH for your NFT analytics tool. In this case, you can pass the base_price
property when creating your price. The base_price
property allows you to set the price in a fiat currency. You can currently set a base price in USD, EUR, GBP, AUD, MXN, MYR, CAD, SGD, JPY, CZK, and PLN.
Fiat amounts
Since Pluto stores fiat amounts as integers, make sure to multiply the amount by 100 when passing it to
base_price
(e.g. $10 USD would be represented as 1000).
const { Pluto } = require('@plutohq/pluto-node');
const pluto = new Pluto(process.env.PLUTO_SECRET_KEY);
const price = await pluto.prices.create({
currency: 'eth',
chain: 'eth',
product: 'prod_NIfj309nc24ofwKOemctF',
base_price: {
amount: 3000,
currency: 'usd',
},
});
Adjustable pricing
Adjustable prices allow customers to set the unit cost of a product at the time of payment. Donations are an example of a use-case where it is easiest to specify a range as opposed to a single amount. To create an adjustable price, use custom_amount
to set a minimum, maximum, and default (optional).
const { Pluto } = require('@plutohq/pluto-node');
const pluto = new Pluto(process.env.PLUTO_SECRET_KEY);
const price = await pluto.prices.create({
currency: 'eth',
chain: 'eth',
product: 'prod_NIfj309nc24ofwKOemctF',
custom_amount: {
minimum: 0.5,
maximum: 2,
},
});
If we create a payment link using this price, the customer will be allowed to pay anywhere between 0.5 and 2 ETH at checkout. Adjustable pricing can also be used in combination with fiat pricing. For example, if you want to let customers pay between $10 USD and $100 USD, simply pass the custom_amount
object to base_price
.
const { Pluto } = require('@plutohq/pluto-node');
const pluto = new Pluto(process.env.PLUTO_SECRET_KEY);
const price = await pluto.prices.create({
currency: 'eth',
chain: 'eth',
product: 'prod_NIfj309nc24ofwKOemctF',
base_price: {
currency: 'usd',
custom_amount: {
minimum: 1000,
maximum: 10000,
},
},
});
Updated 6 months ago