Skip to content
On this page

Home > Payments > Products and prices

Get started with products and prices

Start modeling your business on Payske with products and prices.

Products and Prices are core resources for several Payske integrations, including Checkout Sessions, Payment Links and Subscriptions.

First, make sure you understand the overall goals of your integration project-make your design decisions before you start building it.

Next, decide whether you need to create new products and prices in Payske or import an existing product catalog from another system into Payske. Create new products and prices in the Dashboard if your product catalog is small or you don’t want to use code. If you have a very large product catalog, use the Products API to import your catalog programmatically.

Multiple products and prices

You can create as many products as you need to represent your product catalog. You can also create multiple prices for each product. Whether you should create multiple products as opposed to multiple prices depends on several factors. Generally, however, you want to:

  • Create multiple prices for a single product if you’re selling the same item at different price points. For example, if you offer a subscription tier at monthly and yearly rates, create one product for the tier and one price for the monthly rate and another for the yearly rate. See an example of this for a good-better-best flat rate pricing model. (If you’re selling the same item in different currencies, then instead of creating multiple prices, create a single multi-currency Price.)
  • Create multiple products if the items require different provisioning or fulfillment in your application. In the good-better-best model, for example, you would create a different product for each tier. Similarly, if you have different versions of a product, like different colors or sizes of a t-shirt, you would create a product for each version.

Create products and prices

Using the Dashboard is the easiest way to create new products and prices. If you want to use the API, see the guide for managing products and prices; this section only describes the Dashboard steps.

Create a product

You can type “product.new” into the address bar of any browser to jump straight to the Product Editor.

To create a product in the Dashboard:

  1. Go to the Products tab.
  2. Click +Add product.
  3. Enter the Name of your product.
  4. (Optional) Add a Description. The description appears at checkout.
  5. (Optional) Add an Image of your product. Use a JPEG or PNG file that’s smaller than 2MB. The image appears at checkout.
  1. (Optional) Enter a Unit label. This describes how you sell your product. For example, if you charge by the seat, enter “seat” so the line item includes “per seat” for the price. Unit labels appear at checkout.

To save a product in the Dashboard, you must also add at least one price. You can also create multiple prices for a product. See create a price to learn more.

Create a price

To create a price in the Dashboard, you have to create a product first. You can create multiple prices for a product.

To create a price:

  1. Select a Pricing model:

    • Standard pricing: Charge the same price for each unit. If you use this option, select One time or Recurring.

    • Package pricing: Charge by the package, or group of units, like charging 25 USD for every 5 units. Purchases are rounded up by default, so a customer buying 8 units would pay 50 USD.

    • Graduated pricing: Use pricing tiers that may result in a different price for some units in an order. For example, you might charge 10 USD per unit for the first 100 units and then 5 USD per unit for the next 50. If you use this option, select the currency for the price and fill in the tier table.

    • Volume pricing: Charge the same price for each unit based on the total number of units sold. For example, you might charge 10 USD per unit for 50 units, and 7 USD per unit for 100 units. If you use this option, select the currency for the price and fill in the tier table.

    • Customer chooses price: Let the payer decide on the amount to pay for your product, service, or cause. Customer chooses price is only compatible with Checkout and Payment Links.

  2. (Optional) If you’re selling in multiple currencies, click Add more currencies to set how much to charge in each currency.

  3. Select a Billing period for recurring prices. You can add a custom period if none of the drop-down options are what you want.

  4. (Optional) Check the box under Billing period if you’re using metered billing.

  1. Click Set as default price to make this price the default price of your product. It will say This is the default price if this price is already the default price. The first price for the product will automatically be set as the default price.

  2. (Optional) Enter a Price description. Customers don’t see this description.

  3. (Optional) Click Add another price if you want to create multiple prices for your product.

  4. Click Save product to save the product and price. You can edit both later. Click Save and add more if you want to create another product and price.

Import products and prices

If you have a very large product catalog, use the Products API to import your catalog programmatically. If you’re importing your product catalog to Payske, you can use anything as your starting data source, like a product management system or CSV file.

Use the Products API to create a product in Payske for each product in your system. To map products in your system to products in Payske, assign each product that you import a unique id. For each product, use the Prices API to make a corresponding price. Make sure to store the id of the newly created price. You’ll need to pass this id when you use the products and prices in your integration.

Confirm the import by checking the Dashboard or using the API to list all products.

Deleting prices

During development, you might need to run this script multiple times for testing. If you use the same Product ID, you’ll see an error stating that a Product with that ID already exists. If you haven’t used the Product yet, you can delete it using the Payske Dashboard:

  1. Go to the Products Dashboard and find your Product.

  2. In the Pricing section, click the overflow menu (

    ) next to the Price and select Delete Price.

  3. Click the the overflow menu (

    ) at the top of the page, and select Delete Product.

Synchronize products and prices

You’ll likely need to run through an import more than once. You can create a script to test the import and, if you want to, synch your original data source with Payske. To make your script idempotent and resilient to errors, you can safely try to create the product first, then update it if the product already exists.

To keep your product catalog synchronized with Payske, use webhooks or other mechanisms to trigger product updates in Payske. To update a product programmatically, use the following pattern.

First, find the existing price associated with the product with list all prices API to make sure the price still matches your data source. Each product should have exactly one active price.

console
curl -G https://api.payske.com/v1/prices \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  --data-urlencode product="{{PRODUCT_ID}}" \
  -d active=true
console
payske prices list  \
  --product="{{PRODUCT_ID}}" \
  --active=true
ruby
# Set your secret key. Remember to switch to your live secret key in production.
# See your keys here: https://account.payske.com/api/key
Payske.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'

Payske::Price.list({product: '{{PRODUCT_ID}}', active: true})
python
# Set your secret key. Remember to switch to your live secret key in production.
# See your keys here: https://account.payske.com/api/key
import payske
payske.api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"

payske.Price.list(product="{{PRODUCT_ID}}", active=True)
php
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://account.payske.com/api/key
$payske = new \Payske\PayskeClient('sk_test_4eC39HqLyjWDarjtT1zdp7dc');

$payske->prices->all(['product' => '{{PRODUCT_ID}}', 'active' => true]);
java
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://account.payske.com/api/key
Payske.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";

PriceListParams params =
  PriceListParams.builder().setProduct("{{PRODUCT_ID}}").setActive(true).build();

PriceCollection prices = Price.list(params);
typescript
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://account.payske.com/api/key
const payske = require('payske')('sk_test_4eC39HqLyjWDarjtT1zdp7dc');

const prices = await payske.prices.list({product: '{{PRODUCT_ID}}', active: true});
go
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://account.payske.com/api/key
payske.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"

params := &payske.PriceListParams{
  Product: payske.String("{{PRODUCT_ID}}"),
  Active: payske.Bool(true),
};
result := price.List(params);
csharp
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://account.payske.com/api/key
PayskeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";

var options = new PriceListOptions { Product = "{{PRODUCT_ID}}", Active = true };
var service = new PriceService();
PayskeList<Price> prices = service.List(options);

Next, check whether the decimal amount of the price has changed. The unit_amount_decimal field displays the unit amount in cents.

If the amount doesn’t match, you have to create a new price. When you create a new price, specify the product ID of the original product, the currency, and the updated unit_amount price.

console
curl https://api.payske.com/v1/prices \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  --data-urlencode product="{{PRODUCT_ID}}" \
  -d unit_amount=2000 \
  -d currency=usd
console
payske prices create  \
  --product="{{PRODUCT_ID}}" \
  --unit-amount=2000 \
  --currency=usd
ruby
# Set your secret key. Remember to switch to your live secret key in production.
# See your keys here: https://account.payske.com/api/key
Payske.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'

Payske::Price.create(
  {product: '{{PRODUCT_ID}}', unit_amount: 2000, currency: 'usd'},
)
python
# Set your secret key. Remember to switch to your live secret key in production.
# See your keys here: https://account.payske.com/api/key
import payske
payske.api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"

payske.Price.create(product="{{PRODUCT_ID}}", unit_amount=2000, currency="usd")
php
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://account.payske.com/api/key
$payske = new \Payske\PayskeClient('sk_test_4eC39HqLyjWDarjtT1zdp7dc');

$payske->prices->create(
  ['product' => '{{PRODUCT_ID}}', 'unit_amount' => 2000, 'currency' => 'usd']
);
java
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://account.payske.com/api/key
Payske.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";

PriceCreateParams params =
  PriceCreateParams.builder()
    .setProduct("{{PRODUCT_ID}}")
    .setUnitAmount(2000L)
    .setCurrency("usd")
    .build();

Price price = Price.create(params);
typescript
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://account.payske.com/api/key
const payske = require('payske')('sk_test_4eC39HqLyjWDarjtT1zdp7dc');

const price = await payske.prices.create({
  product: '{{PRODUCT_ID}}',
  unit_amount: 2000,
  currency: 'usd',
});
go
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://account.payske.com/api/key
payske.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"

params := &payske.PriceParams{
  Product: payske.String("{{PRODUCT_ID}}"),
  UnitAmount: payske.Int64(2000),
  Currency: payske.String(string(payske.CurrencyUSD)),
};
result, _ := price.New(params);
csharp
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://account.payske.com/api/key
PayskeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";

var options = new PriceCreateOptions
{
    Product = "{{PRODUCT_ID}}",
    UnitAmount = 2000,
    Currency = "usd",
};
var service = new PriceService();
service.Create(options);

Finally, update the old price to mark it as active=false.

console
curl https://api.payske.com/v1/prices/{{PRICE_ID}} \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d active=false
console
payske prices update {{PRICE_ID}} \
  --active=false
ruby
# Set your secret key. Remember to switch to your live secret key in production.
# See your keys here: https://account.payske.com/api/key
Payske.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'

Payske::Price.update('{{PRICE_ID}}', {active: false})
python
# Set your secret key. Remember to switch to your live secret key in production.
# See your keys here: https://account.payske.com/api/key
import payske
payske.api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"

payske.Price.modify("{{PRICE_ID}}", active=False)
php
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://account.payske.com/api/key
$payske = new \Payske\PayskeClient('sk_test_4eC39HqLyjWDarjtT1zdp7dc');

$payske->prices->update('{{PRICE_ID}}', ['active' => false]);
java
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://account.payske.com/api/key
Payske.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";

Price resource = Price.retrieve("{{PRICE_ID}}");
PriceUpdateParams params = PriceUpdateParams.builder().setActive(false).build();

Price price = resource.update(params);
typescript
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://account.payske.com/api/key
const payske = require('payske')('sk_test_4eC39HqLyjWDarjtT1zdp7dc');

const price = await payske.prices.update('{{PRICE_ID}}', {active: false});
go
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://account.payske.com/api/key
payske.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"

params := &payske.PriceParams{Active: payske.Bool(false)};
result, _ := price.Update("{{PRICE_ID}}", params);
csharp
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://account.payske.com/api/key
PayskeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";

var options = new PriceUpdateOptions { Active = false };
var service = new PriceService();
service.Update("{{PRICE_ID}}", options);

Use products and prices

Now that you have products and prices in Payske, you can use them in an integration.

Payske Checkout

Specify the Price ID when you create a Checkout Session.

If you’re using Payment Links, the next step is to select a product to create a payment link.