Skip to content
On this page

Home > Payments > Products and prices

Manage products and prices

Learn how to manage products and prices.

You can create and update products and prices in the Dashboard or through the API.

Some advanced use cases, require you to use the API. If you have a large number of products and prices.

  • Use the Dashboard to create and manage products and prices if you want to avoid writing code or if you only have a few products and prices.
  • Use the API to create and manage products and prices. The API is a direct method that you use for production implementations.

The following API steps use a fictional SaaS collaboration tool (Togethere [Dashboard | API]) as an example, where the basic product is a project management dashboard.

Use the Dashboard

Create a product

Dashboard | API

Create a product and price

You can type “https://account.payske.com/products/create” into the address bar of any browser to jump straight to the Product Editor.

Create a product

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.
  6. (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, and in invoices and receipts.

Create a price for the product

To save a product in the Dashboard, you must also add at least one price. You can create multiple prices for a product. To add a price for your product:

  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.
  5. 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.
  6. (Optional) Enter a Price description. Customers don’t see this description.
  7. (Optional) Click Add another price if you want to create multiple prices for your product.
  8. 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.

Edit a product

Dashboard | API

To modify a product in the Dashboard:

  1. Go to the Products tab.
  2. Find the product you want to modify, click the overflow menu (), then click Edit product.
  3. Make your changes to the product.
  4. Click Save product.

You can also edit products from within the product information page by clicking the overflow menu () or Edit.

Archive a product

If you want to disable a product so that it can’t be added to new invoices or subscriptions, you can archive it. If you archive a product, any existing subscriptions that use the product remain active until they’re canceled and any existing payment links that use the product are deactivated. You can’t delete products that have an associated price, but you can archive them.

Dashboard | API

To archive a product:

  1. Go to the Products tab.
  2. Find the product you want to modify, click the overflow menu (), then click Archive product.

To unarchive a product:

  1. Go to the Archived tab on the Products>Overview page.
  2. Find the product you want to modify, click the overflow menu (), then click Unarchive product.

You can also unarchive a product from the product information page.

Delete a product

You can only delete products that have no prices associated with them. Alternatively, you can archive a product.

Dashboard | API

If a product has a price associated with it, you have to delete or archive the price before you can delete the product. Payske keeps a record of the price and product for historical transactions.

To permanently delete a product:

  1. Go to the Products tab.
  2. Find the product you want to modify, click the overflow menu (), then click Delete product.

Create price

You can create single or multiple prices for a product. For example, Togethere may have a “starter” level offered at 10 USD per month, 100 USD per year, or 9 EUR as a one-time purchase.

After you create a price, you can only update its metadata, nickname, and active fields.

Dashboard | API

To create a price in the Dashboard, you have to create a product first. Then you can 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.
  5. 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.
  6. (Optional) Enter a Price description. Customers don’t see this description.
  7. (Optional) Click Add another price if you want to create multiple prices for your product.
  8. 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.

Set a default price

A product’s default price is the most common price you want to present to customers. For example, a product could have multiple prices for seasonal sales, but the default is the regular (non-sale) price. If your product only has one price, that is its default price. The default price must be an active Price.

Dashboard | API

To change your product’s default price in the Dashboard:

  1. Go to the Products tab.
  2. Find the product you want to modify, click the overflow menu (), then click Edit product.
  3. Under the Price information section, find the price you want to set as the new default price, then click Set as default price.
  4. Click Save product.

To create a new price and make it the new default price in the Dashboard:

  1. Go to the Products tab.
  2. Find the product you want to modify and click on it to open the product information page.
  3. In the Pricing section, click the Add another price button.
  4. Enter your pricing details and select Set as default price. Read more about the fields available when you create a price.
  5. Click Add price.

Lookup keys

Most businesses display pricing information on their website. If these prices are hard-coded and you want to change them, the process is often manual and requires you to deploy new code. To better manage these scenarios, you can use the lookup_key attribute on the Price object. This key allows you to:

  • Render different prices in your frontend.
  • Use the rendered price to bill customers.

You can pass a lookup_key when you create a price:

console
curl https://api.payske.com/v1/prices \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  --data-urlencode product="{{PRODUCT_ID}}" \
  -d unit_amount=1000 \
  -d currency=usd \
  -d "recurring[interval]"=month \
  -d lookup_key=standard_monthly
console
payske prices create  \
  --product="{{PRODUCT_ID}}" \
  --unit-amount=1000 \
  --currency=usd \
  -d "recurring[interval]"=month \
  --lookup-key=standard_monthly
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: 1000,
    currency: 'usd',
    recurring: {interval: 'month'},
    lookup_key: 'standard_monthly',
  },
)
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=1000,
  currency="usd",
  recurring={"interval": "month"},
  lookup_key="standard_monthly",
)
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' => 1000,
    'currency' => 'usd',
    'recurring' => ['interval' => 'month'],
    'lookup_key' => 'standard_monthly',
  ]
);
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(1000L)
    .setCurrency("usd")
    .setRecurring(
      PriceCreateParams.Recurring.builder()
        .setInterval(PriceCreateParams.Recurring.Interval.MONTH)
        .build()
    )
    .setLookupKey("standard_monthly")
    .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: 1000,
  currency: 'usd',
  recurring: {interval: 'month'},
  lookup_key: 'standard_monthly',
});
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(1000),
  Currency: payske.String(string(payske.CurrencyUSD)),
  Recurring: &payske.PriceRecurringParams{
    Interval: payske.String(string(payske.PriceRecurringIntervalMonth)),
  },
  LookupKey: payske.String("standard_monthly"),
};
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 = 1000,
    Currency = "usd",
    Recurring = new PriceRecurringOptions { Interval = "month" },
    LookupKey = "standard_monthly",
};
var service = new PriceService();
service.Create(options);

Instead of hard-coding text like 10 USD per month on your pricing page and using a price ID on your backend, you can query for the price using the standard_monthly key and then render that in your frontend:

console
curl -G https://api.payske.com/v1/prices \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d "lookup_keys[]"=standard_monthly
console
payske prices list  \
  -d "lookup_keys[0]"=standard_monthly
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({lookup_keys: ['standard_monthly']})
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(lookup_keys=["standard_monthly"])
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(['lookup_keys' => ['standard_monthly']]);
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().addLookupKey("standard_monthly").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({lookup_keys: ['standard_monthly']});
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{
  LookupKeys: []*string{payske.String("standard_monthly")},
};
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
{
    LookupKeys = new List<string> { "standard_monthly" },
};
var service = new PriceService();
PayskeList<Price> prices = service.List(options);

To optimize performance, you might want to add a caching layer to only reload the price occasionally.

When a customer clicks your subscribe or pay button, you pass the price from the GET request above into the Subscriptions API.

Now that you can render different prices, if you decide that you want to start charging new users 20 USD per month rather than 10 USD per month, you only need to create a new price and transfer the lookup key to that new price using transfer_lookup_key=true:

Rounding

Rounding occurs on the line item level of your invoices. For example, if you create a price with unit_amount_decimal = 0.05 and a monthly subscription for that [price] with quantity = 30, rounding occurs after multiplying the quantity by the decimal amount. In this case, the calculated amount for the line item would be 0.05 * 30 = 1.5, which rounds up to 2 cents. If you have multiple line items, each is rounded up before summing up the total amount for the invoice. This ensures that customers are still charged an integer minor unit amount, as decimal amounts only apply for pricing.

console
curl https://api.payske.com/v1/prices \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  --data-urlencode product="{{PRODUCT_ID}}" \
  -d unit_amount=2000 \
  -d currency=usd \
  -d "recurring[interval]"=month \
  -d lookup_key=standard_monthly \
  -d transfer_lookup_key=true
console
payske prices create  \
  --product="{{PRODUCT_ID}}" \
  --unit-amount=2000 \
  --currency=usd \
  -d "recurring[interval]"=month \
  --lookup-key=standard_monthly \
  --transfer-lookup-key=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.create(
  {
    product: '{{PRODUCT_ID}}',
    unit_amount: 2000,
    currency: 'usd',
    recurring: {interval: 'month'},
    lookup_key: 'standard_monthly',
    transfer_lookup_key: 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.create(
  product="{{PRODUCT_ID}}",
  unit_amount=2000,
  currency="usd",
  recurring={"interval": "month"},
  lookup_key="standard_monthly",
  transfer_lookup_key=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->create(
  [
    'product' => '{{PRODUCT_ID}}',
    'unit_amount' => 2000,
    'currency' => 'usd',
    'recurring' => ['interval' => 'month'],
    'lookup_key' => 'standard_monthly',
    'transfer_lookup_key' => 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";

PriceCreateParams params =
  PriceCreateParams.builder()
    .setProduct("{{PRODUCT_ID}}")
    .setUnitAmount(2000L)
    .setCurrency("usd")
    .setRecurring(
      PriceCreateParams.Recurring.builder()
        .setInterval(PriceCreateParams.Recurring.Interval.MONTH)
        .build()
    )
    .setLookupKey("standard_monthly")
    .setTransferLookupKey(true)
    .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',
  recurring: {interval: 'month'},
  lookup_key: 'standard_monthly',
  transfer_lookup_key: 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.PriceParams{
  Product: payske.String("{{PRODUCT_ID}}"),
  UnitAmount: payske.Int64(2000),
  Currency: payske.String(string(payske.CurrencyUSD)),
  Recurring: &payske.PriceRecurringParams{
    Interval: payske.String(string(payske.PriceRecurringIntervalMonth)),
  },
  LookupKey: payske.String("standard_monthly"),
  TransferLookupKey: payske.Bool(true),
};
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",
    Recurring = new PriceRecurringOptions { Interval = "month" },
    LookupKey = "standard_monthly",
    TransferLookupKey = true,
};
var service = new PriceService();
service.Create(options);

Edit a price

Multiple properties can be updated on a price, either in the Dashboard or the API. For example, you can change whether the price is active, or modify its metadata.

Note that you can not change a price’s amount in the API. Instead, we recommend creating a new price for the new amount, switch to the new price’s ID, then update the old price to be inactive.

Dashboard | API

To modify a price in the Dashboard:

  1. Go to the Products tab.
  2. Find the product for the price you want to modify, and click on it
  3. Find the price you want to modify, click the overflow menu (), then click Edit price.
  4. Make your changes to the price. You can add another price at this point.
  5. Click Save.

Archive a price

If you want to disable a price so that it can’t be added to new invoices or subscriptions, you can archive it. If you archive a price, any existing subscriptions that use the price remain active until they’re canceled and any existing payment links that use the product are deactivated.

Dashboard | API

To archive a price through the Dashboard:

  1. Go to the Products tab.
  2. Find the product you want to modify, click the overflow menu ().
  3. On the product information page, find the price you want to modify, then click the overflow menu () next to it and click Archive price.

To unarchive a price:

  1. Go to the Products tab.
  2. Find the product you want to modify, click the overflow menu ().
  3. On the product information page, find the price you want to modify, then click the overflow menu () next to it and click Unarchive price.

Delete a price

You can only delete prices that you’ve never used. Otherwise, you can archive them.

Dashboard | API

To permanently delete a price in the Dashboard:

  1. Go to the Products tab.
  2. Find the product you want to modify, click the overflow menu ().
  3. On the product information page, find the price you want to modify, then click the overflow menu () next to it and click Delete price.

Use the API

Create a product

Dashboard | API

To create a single product and price:

console
curl https://api.payske.com/v1/products \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d name="Basic Dashboard" \
  -d "default_price_data[unit_amount]"=1000 \
  -d "default_price_data[currency]"=usd \
  -d "default_price_data[recurring][interval]"=month \
  -d "expand[]"=default_price
console
payske products create  \
  --name="Basic Dashboard" \
  -d "default_price_data[unit_amount]"=1000 \
  -d "default_price_data[currency]"=usd \
  -d "default_price_data[recurring][interval]"=month \
  -d "expand[0]"=default_price
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::Product.create(
  {
    name: 'Basic Dashboard',
    default_price_data: {
      unit_amount: 1000,
      currency: 'usd',
      recurring: {interval: 'month'},
    },
    expand: ['default_price'],
  },
)
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.Product.create(
  name="Basic Dashboard",
  default_price_data={
    "unit_amount": 1000,
    "currency": "usd",
    "recurring": {"interval": "month"},
  },
  expand=["default_price"],
)
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->products->create(
  [
    'name' => 'Basic Dashboard',
    'default_price_data' => [
      'unit_amount' => 1000,
      'currency' => 'usd',
      'recurring' => ['interval' => 'month'],
    ],
    'expand' => ['default_price'],
  ]
);
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";

ProductCreateParams params =
  ProductCreateParams
    .builder()
    .setName("Basic Dashboard")
    .setDefaultPriceData(
      ProductCreateParams.DefaultPriceData
        .builder()
        .setUnitAmount(1000L)
        .setCurrency("usd")
        .setRecurring(
          ProductCreateParams.DefaultPriceData.Recurring
            .builder()
            .setInterval(ProductCreateParams.DefaultPriceData.Recurring.Interval.MONTH)
            .build()
        )
        .build()
    )
    .addExpand("default_price")
    .build();

Product product = Product.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 product = await payske.products.create({
  name: 'Basic Dashboard',
  default_price_data: {
    unit_amount: 1000,
    currency: 'usd',
    recurring: {interval: 'month'},
  },
  expand: ['default_price'],
});
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.ProductParams{
  Name: payske.String("Basic Dashboard"),
  DefaultPriceData: &payske.ProductDefaultPriceDataParams{
    UnitAmount: payske.Int64(1000),
    Currency: payske.String(string(payske.CurrencyUSD)),
    Recurring: &payske.ProductDefaultPriceDataRecurringParams{
      Interval: payske.String("month"),
    },
  },
};
params.AddExpand("default_price")
result, _ := product.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 ProductCreateOptions
{
    Name = "Basic Dashboard",
    DefaultPriceData = new ProductDefaultPriceDataOptions
    {
        UnitAmount = 1000,
        Currency = "usd",
        Recurring = new ProductDefaultPriceDataRecurringOptions { Interval = "month" },
    },
    Expand = new List<string> { "default_price" },
};
var service = new ProductService();
service.Create(options);

When customers first sign up with Togethere, they’re also charged a setup fee.

To create the fee as a product and price, make the same request using a different product name and price data:

console
curl https://api.payske.com/v1/products \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d name="Starter Setup" \
  -d "default_price_data[unit_amount]"=2000 \
  -d "default_price_data[currency]"=usd \
  -d "expand[]"=default_price
console
payske products create  \
  --name="Starter Setup" \
  -d "default_price_data[unit_amount]"=2000 \
  -d "default_price_data[currency]"=usd \
  -d "expand[0]"=default_price
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::Product.create(
  {
    name: 'Starter Setup',
    default_price_data: {unit_amount: 2000, currency: 'usd'},
    expand: ['default_price'],
  },
)
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.Product.create(
  name="Starter Setup",
  default_price_data={"unit_amount": 2000, "currency": "usd"},
  expand=["default_price"],
)
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->products->create(
  [
    'name' => 'Starter Setup',
    'default_price_data' => ['unit_amount' => 2000, 'currency' => 'usd'],
    'expand' => ['default_price'],
  ]
);
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";

ProductCreateParams params =
  ProductCreateParams
    .builder()
    .setName("Starter Setup")
    .setDefaultPriceData(
      ProductCreateParams.DefaultPriceData
        .builder()
        .setUnitAmount(2000L)
        .setCurrency("usd")
        .build()
    )
    .addExpand("default_price")
    .build();

Product product = Product.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 product = await payske.products.create({
  name: 'Starter Setup',
  default_price_data: {unit_amount: 2000, currency: 'usd'},
  expand: ['default_price'],
});
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.ProductParams{
  Name: payske.String("Starter Setup"),
  DefaultPriceData: &payske.ProductDefaultPriceDataParams{
    UnitAmount: payske.Int64(2000),
    Currency: payske.String(string(payske.CurrencyUSD)),
  },
};
params.AddExpand("default_price")
result, _ := product.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 ProductCreateOptions
{
    Name = "Starter Setup",
    DefaultPriceData = new ProductDefaultPriceDataOptions
    {
        UnitAmount = 2000,
        Currency = "usd",
    },
    Expand = new List<string> { "default_price" },
};
var service = new ProductService();
service.Create(options);

Edit a product

Dashboard | API

To modify a product through the API:

console
curl https://api.payske.com/v1/products/id \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d name="Updated Product"
console
payske products update id \
  --name="Updated Product"
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::Product.update('id', {name: 'Updated Product'})
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.Product.modify("id", name="Updated Product")
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->products->update('id', ['name' => 'Updated Product']);
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";

Product resource = Product.retrieve("id");
ProductUpdateParams params =
  ProductUpdateParams.builder().setName("Updated Product").build();

Product product = 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 product = await payske.products.update('id', {name: 'Updated Product'});
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.ProductParams{Name: payske.String("Updated Product")};
result, _ := product.Update("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 ProductUpdateOptions { Name = "Updated Product" };
var service = new ProductService();
service.Update("id", options);

Archive a product

If you want to disable a product so that it can’t be added to new invoices or subscriptions, you can archive it. If you archive a product, any existing subscriptions that use the product remain active until they’re canceled and any existing payment links that use the product are deactivated. You can’t delete products that have an associated price, but you can archive them.

Dashboard | API

To archive a product (that is, to indicate that it’s not available for purchase) through the API, change the active parameter to false.

console
curl https://api.payske.com/v1/products \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d active=false \
  -d name="My product"
console
payske products create  \
  --active=false \
  --name="My product"
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::Product.create({active: false, name: 'My product'})
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.Product.create(active=False, name="My product")
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->products->create(['active' => false, 'name' => 'My product']);
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";

ProductCreateParams params =
  ProductCreateParams.builder().setActive(false).setName("My product").build();

Product product = Product.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 product = await payske.products.create({active: false, name: 'My product'});
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.ProductParams{
  Active: payske.Bool(false),
  Name: payske.String("My product"),
};
result, _ := product.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 ProductCreateOptions { Active = false, Name = "My product" };
var service = new ProductService();
service.Create(options);

To unarchive a product (that is, to indicate that it’s not available for purchase) through the API, change the active parameter to true.

console
curl https://api.payske.com/v1/products/id \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d active=true
console
payske products update 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::Product.update('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.Product.modify("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->products->update('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";

Product resource = Product.retrieve("id");
ProductUpdateParams params = ProductUpdateParams.builder().setActive(true).build();

Product product = 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 product = await payske.products.update('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.ProductParams{Active: payske.Bool(true)};
result, _ := product.Update("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 ProductUpdateOptions { Active = true };
var service = new ProductService();
service.Update("id", options);

Delete a product

You can only delete products that have no prices associated with them. Alternatively, you can archive a product.

Dashboard | API

To permanently delete a product through the API, use delete product.

console
curl -X DELETE https://api.payske.com/v1/products/{{PRODUCT_ID}} \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc:
console
payske products delete {{PRODUCT_ID}}
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::Product.delete('{{PRODUCT_ID}}')
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.Product.delete("{{PRODUCT_ID}}")
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->products->delete('{{PRODUCT_ID}}', []);
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";

Product resource = Product.retrieve("{{PRODUCT_ID}}");

Product product = resource.delete();
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 deleted = await payske.products.del('{{PRODUCT_ID}}');
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.ProductParams{};
result, _ := product.Del("{{PRODUCT_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 service = new ProductService();
service.Delete("{{PRODUCT_ID}}");

Create price

You can create single or multiple prices for a product. For example, Togethere may have a “starter” level offered at 10 USD per month, 100 USD per year, or 9 EUR as a one-time purchase.

After you create a price, you can only update its metadata, nickname, and active fields.

Dashboard | API

To create prices through the API, use create price API.

Togethere wants to charge 10 USD per month for their “starter” service level.

The unit_amount parameter uses the lowest unit of the currency specified for the price. In the case of Togethere, the lowest unit is cents: 10 USD is 1,000 cents, which means their price unit_amount is 1000.

To create the price and assign it to the product, pass the product ID, unit amount, currency, and interval:

console
curl https://api.payske.com/v1/prices \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d product="{{PRODUCT_ID}}" \
  -d unit_amount=1000 \
  -d currency=usd \
  -d "recurring[interval]"=month
console
payske prices create  \
  --product="{{PRODUCT_ID}}" \
  --unit-amount=1000 \
  --currency=usd \
  -d "recurring[interval]"=month
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: 1000,
    currency: 'usd',
    recurring: {interval: 'month'},
  },
)
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=1000,
  currency="usd",
  recurring={"interval": "month"},
)
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' => 1000,
    'currency' => 'usd',
    'recurring' => ['interval' => 'month'],
  ]
);
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(1000L)
    .setCurrency("usd")
    .setRecurring(
      PriceCreateParams.Recurring
        .builder()
        .setInterval(PriceCreateParams.Recurring.Interval.MONTH)
        .build()
    )
    .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: 1000,
  currency: 'usd',
  recurring: {interval: 'month'},
});
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(1000),
  Currency: payske.String(string(payske.CurrencyUSD)),
  Recurring: &payske.PriceRecurringParams{
    Interval: payske.String(string(payske.PriceRecurringIntervalMonth)),
  },
};
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 = 1000,
    Currency = "usd",
    Recurring = new PriceRecurringOptions { Interval = "month" },
};
var service = new PriceService();
service.Create(options);

The setup fee for new customers is 20 USD. Because this charge is separate from the subscription and you only charge it one time, you don’t need to pass the interval:

console
curl https://api.payske.com/v1/prices \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d 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);

Set a default price

A product’s default price is the most common price you want to present to customers. For example, a product could have multiple prices for seasonal sales, but the default is the regular (non-sale) price. If your product only has one price, that is its default price. The default price must be an active Price.

Dashboard | API

console
curl https://api.payske.com/v1/products/{{PRODUCT_ID}} \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d default_price="{{PRICE_ID}}"
console
payske products update {{PRODUCT_ID}} \
  --default-price="{{PRICE_ID}}"
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::Product.update('{{PRODUCT_ID}}', {default_price: '{{PRICE_ID}}'})
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.Product.modify("{{PRODUCT_ID}}", default_price="{{PRICE_ID}}")
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->products->update(
  '{{PRODUCT_ID}}',
  ['default_price' => '{{PRICE_ID}}']
);
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";

Product resource = Product.retrieve("{{PRODUCT_ID}}");
ProductUpdateParams params =
  ProductUpdateParams.builder().setDefaultPrice("{{PRICE_ID}}").build();

Product product = 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 product = await payske.products.update(
  '{{PRODUCT_ID}}',
  {default_price: '{{PRICE_ID}}'}
);
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.ProductParams{DefaultPrice: payske.String("{{PRICE_ID}}")};
result, _ := product.Update("{{PRODUCT_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 ProductUpdateOptions { DefaultPrice = "{{PRICE_ID}}" };
var service = new ProductService();
service.Update("{{PRODUCT_ID}}", options);

Lookup keys

Most businesses display pricing information on their website. If these prices are hard-coded and you want to change them, the process is often manual and requires you to deploy new code. To better manage these scenarios, you can use the lookup_key attribute on the Price object. This key allows you to:

  • Render different prices in your frontend.
  • Use the rendered price to bill customers.

You can pass a lookup_key when you create a price:

console
curl https://api.payske.com/v1/prices \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  --data-urlencode product="{{PRODUCT_ID}}" \
  -d unit_amount=1000 \
  -d currency=usd \
  -d "recurring[interval]"=month \
  -d lookup_key=standard_monthly
console
payske prices create  \
  --product="{{PRODUCT_ID}}" \
  --unit-amount=1000 \
  --currency=usd \
  -d "recurring[interval]"=month \
  --lookup-key=standard_monthly
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: 1000,
    currency: 'usd',
    recurring: {interval: 'month'},
    lookup_key: 'standard_monthly',
  },
)
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=1000,
  currency="usd",
  recurring={"interval": "month"},
  lookup_key="standard_monthly",
)
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' => 1000,
    'currency' => 'usd',
    'recurring' => ['interval' => 'month'],
    'lookup_key' => 'standard_monthly',
  ]
);
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(1000L)
    .setCurrency("usd")
    .setRecurring(
      PriceCreateParams.Recurring.builder()
        .setInterval(PriceCreateParams.Recurring.Interval.MONTH)
        .build()
    )
    .setLookupKey("standard_monthly")
    .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: 1000,
  currency: 'usd',
  recurring: {interval: 'month'},
  lookup_key: 'standard_monthly',
});
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(1000),
  Currency: payske.String(string(payske.CurrencyUSD)),
  Recurring: &payske.PriceRecurringParams{
    Interval: payske.String(string(payske.PriceRecurringIntervalMonth)),
  },
  LookupKey: payske.String("standard_monthly"),
};
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 = 1000,
    Currency = "usd",
    Recurring = new PriceRecurringOptions { Interval = "month" },
    LookupKey = "standard_monthly",
};
var service = new PriceService();
service.Create(options);

Instead of hard-coding text like 10 USD per month on your pricing page and using a price ID on your backend, you can query for the price using the standard_monthly key and then render that in your frontend:

console
curl -G https://api.payske.com/v1/prices \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d "lookup_keys[]"=standard_monthly
console
payske prices list  \
  -d "lookup_keys[0]"=standard_monthly
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({lookup_keys: ['standard_monthly']})
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(lookup_keys=["standard_monthly"])
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(['lookup_keys' => ['standard_monthly']]);
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().addLookupKey("standard_monthly").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({lookup_keys: ['standard_monthly']});
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{
  LookupKeys: []*string{payske.String("standard_monthly")},
};
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
{
    LookupKeys = new List<string> { "standard_monthly" },
};
var service = new PriceService();
PayskeList<Price> prices = service.List(options);

To optimize performance, you might want to add a caching layer to only reload the price occasionally.

When a customer clicks your subscribe or pay button, you pass the price from the GET request above into the Subscriptions API.

Now that you can render different prices, if you decide that you want to start charging new users 20 USD per month rather than 10 USD per month, you only need to create a new price and transfer the lookup key to that new price using transfer_lookup_key=true:

Rounding

Rounding occurs on the line item level of your invoices. For example, if you create a price with unit_amount_decimal = 0.05 and a monthly subscription for that [price] with quantity = 30, rounding occurs after multiplying the quantity by the decimal amount. In this case, the calculated amount for the line item would be 0.05 * 30 = 1.5, which rounds up to 2 cents. If you have multiple line items, each is rounded up before summing up the total amount for the invoice. This ensures that customers are still charged an integer minor unit amount, as decimal amounts only apply for pricing.

console
curl https://api.payske.com/v1/prices \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  --data-urlencode product="{{PRODUCT_ID}}" \
  -d unit_amount=2000 \
  -d currency=usd \
  -d "recurring[interval]"=month \
  -d lookup_key=standard_monthly \
  -d transfer_lookup_key=true
console
payske prices create  \
  --product="{{PRODUCT_ID}}" \
  --unit-amount=2000 \
  --currency=usd \
  -d "recurring[interval]"=month \
  --lookup-key=standard_monthly \
  --transfer-lookup-key=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.create(
  {
    product: '{{PRODUCT_ID}}',
    unit_amount: 2000,
    currency: 'usd',
    recurring: {interval: 'month'},
    lookup_key: 'standard_monthly',
    transfer_lookup_key: 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.create(
  product="{{PRODUCT_ID}}",
  unit_amount=2000,
  currency="usd",
  recurring={"interval": "month"},
  lookup_key="standard_monthly",
  transfer_lookup_key=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->create(
  [
    'product' => '{{PRODUCT_ID}}',
    'unit_amount' => 2000,
    'currency' => 'usd',
    'recurring' => ['interval' => 'month'],
    'lookup_key' => 'standard_monthly',
    'transfer_lookup_key' => 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";

PriceCreateParams params =
  PriceCreateParams.builder()
    .setProduct("{{PRODUCT_ID}}")
    .setUnitAmount(2000L)
    .setCurrency("usd")
    .setRecurring(
      PriceCreateParams.Recurring.builder()
        .setInterval(PriceCreateParams.Recurring.Interval.MONTH)
        .build()
    )
    .setLookupKey("standard_monthly")
    .setTransferLookupKey(true)
    .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',
  recurring: {interval: 'month'},
  lookup_key: 'standard_monthly',
  transfer_lookup_key: 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.PriceParams{
  Product: payske.String("{{PRODUCT_ID}}"),
  UnitAmount: payske.Int64(2000),
  Currency: payske.String(string(payske.CurrencyUSD)),
  Recurring: &payske.PriceRecurringParams{
    Interval: payske.String(string(payske.PriceRecurringIntervalMonth)),
  },
  LookupKey: payske.String("standard_monthly"),
  TransferLookupKey: payske.Bool(true),
};
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",
    Recurring = new PriceRecurringOptions { Interval = "month" },
    LookupKey = "standard_monthly",
    TransferLookupKey = true,
};
var service = new PriceService();
service.Create(options);

Edit a price

Multiple properties can be updated on a price, either in the Dashboard or the API. For example, you can change whether the price is active, or modify its metadata.

Note that you can not change a price’s amount in the API. Instead, we recommend creating a new price for the new amount, switch to the new price’s ID, then update the old price to be inactive.

Dashboard | API

To edit a price through the API, use update price and specify the parameter you want to change. If you don’t specify a parameter, it remains unchanged.

console
curl https://api.payske.com/v1/prices/id \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d lookup_key=MY_LOOKUP_KEY
console
payske prices update id \
  --lookup-key=MY_LOOKUP_KEY
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('id', {lookup_key: 'MY_LOOKUP_KEY'})
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("id", lookup_key="MY_LOOKUP_KEY")
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('id', ['lookup_key' => 'MY_LOOKUP_KEY']);
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("id");
PriceUpdateParams params =
  PriceUpdateParams.builder().setLookupKey("MY_LOOKUP_KEY").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('id', {lookup_key: 'MY_LOOKUP_KEY'});
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{LookupKey: payske.String("MY_LOOKUP_KEY")};
result, _ := price.Update("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 { LookupKey = "MY_LOOKUP_KEY" };
var service = new PriceService();
service.Update("id", options);

Archive a price

If you want to disable a price so that it can’t be added to new invoices or subscriptions, you can archive it. If you archive a price, any existing subscriptions that use the price remain active until they’re canceled and any existing payment links that use the product are deactivated.

Dashboard | API

To use the API to archive a price (that is, to indicate that it can’t be used for new purchases), change the active parameter to false.

console
curl https://api.payske.com/v1/prices/id \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d lookup_key=MY_LOOKUP_KEY \
  -d active=false
console
payske prices update id \
  --lookup-key=MY_LOOKUP_KEY \
  --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('id', {lookup_key: 'MY_LOOKUP_KEY', 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("id", lookup_key="MY_LOOKUP_KEY", 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('id', ['lookup_key' => 'MY_LOOKUP_KEY', '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("id");
PriceUpdateParams params =
  PriceUpdateParams.builder().setLookupKey("MY_LOOKUP_KEY").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(
  'id',
  {lookup_key: 'MY_LOOKUP_KEY', 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{
  LookupKey: payske.String("MY_LOOKUP_KEY"),
  Active: payske.Bool(false),
};
result, _ := price.Update("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 { LookupKey = "MY_LOOKUP_KEY", Active = false };
var service = new PriceService();
service.Update("id", options);

To use the API to unarchive a price (that is, to indicate that it can be used for new purchases), change the active parameter to true.

console
curl https://api.payske.com/v1/prices/id \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d lookup_key=MY_LOOKUP_KEY \
  -d active=true
console
payske prices update id \
  --lookup-key=MY_LOOKUP_KEY \
  --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.update('id', {lookup_key: 'MY_LOOKUP_KEY', 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.modify("id", lookup_key="MY_LOOKUP_KEY", 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->update('id', ['lookup_key' => 'MY_LOOKUP_KEY', '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";

Price resource = Price.retrieve("id");
PriceUpdateParams params =
  PriceUpdateParams.builder().setLookupKey("MY_LOOKUP_KEY").setActive(true).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(
  'id',
  {lookup_key: 'MY_LOOKUP_KEY', 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.PriceParams{
  LookupKey: payske.String("MY_LOOKUP_KEY"),
  Active: payske.Bool(true),
};
result, _ := price.Update("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 { LookupKey = "MY_LOOKUP_KEY", Active = true };
var service = new PriceService();
service.Update("id", options);

Delete a price

You can only delete prices that you’ve never used. Otherwise, you can archive them.

Dashboard | API

You can’t delete a price through the API. You can archive a price to mark it as active=false, which indicates that it’s not available for purchase.