Early Bird Pricing

Automatically Adjust Pricing Based on Date 

You can set different prices on your form to adjust automatically based on specific dates. This is particularly great for promotional periods, like 'Early Bird' pricing. 

This feature is available for single payments, as well as subscriptions. In order to set it up, we only need to add a few lines of code to the form embed code, to specify the amount, end date, etc.

Important: The naming of the objects and properties should not be changed, only the value.

  1. Single Payments
  2. Subscriptions

Single Payments:

products: [
            {
                name: 'Product 1',
                type: 'single_payment',
                prices: [
                    {endDate: '', amount: 1000}, //default price
                    {endDate: 'Oct 31, 2019', amount: 200},
                    {endDate: 'Nov 30, 2019', amount: 400},
                    {endDate: 'Dec 31, 2019', amount: 800}
                ],
            }
        ]

where:

  •  prices is the object name
  • endDate is the last date for this price
  • amount is the actual price to be charged


Full sample code:

<script src="https://widgets.depositfix.com/v1/app.min.js"></script>
<script type="text/javascript" id="df-script">
    DepositFixForm.init({
        formId: 'dff9b2f7-cb05-46fa-8ba7-8a5d1daca1d1',
        portalId: '4269803',
        products: [
            {
                name: 'Product 1',
                type: 'single_payment',
                prices: [
                    {endDate: '', amount: 1000}, //default price
                    {endDate: 'Oct 31, 2019', amount: 200},
                    {endDate: 'Nov 30, 2019', amount: 400},
                    {endDate: 'Dec 31, 2019', amount: 800}
                ],
            }
        ],
    });
</script>

The above code will do the following:

  • Set the pricing to $200 for any time before November 1st. 
  • Set the pricing to $400  from November to November 30th.
  • Set the pricing to be $800 from December 1st to December 31.
  • Set the pricing to be $1000 from January 1st, 2020 onwards. 


Subscriptions:

For subscriptions, the code is very similar, the only difference is that we need to add the Stripe planID.

Important: The planID should be the payment plan ID in Stripe, NOT the product ID. It is also important to ensure that the amount value matches the value of the payment plan in Stripe.

 Here's an example of what the code should look like:

products: [{
      name: 'Product 1',
      type: 'subscription',
      showQuantity: true,
      subscriptionPrices: [{
          planId: 'annual_600',
          amount: 600,
          endDate: ''
        },
        {
          planId: 'df_subscription_9_99',
          amount: 9.99,
          endDate: 'Feb 25, 2018'
        },
        {
          planId: 'df_subscription_50',
          amount: 50,
          endDate: 'Dec 30, 2019'
        },
        {
          planId: 'df_subscription_100',
          amount: 100,
          endDate: 'Sep 30, 2020'
        },
        {
          planId: 'df_subscription_500',
          amount: 500,
          endDate: 'Nov 30, 2020'
        }
      ]
    }]

where:

  •  subscriptionPrices is the object name
  • planId is the ID of the payment plan from Stripe 
  • endDate is the last date for this price
  • amount is the actual price to be charged


Full Sample Code:

<script src="https://widgets-test.depositfix.com/v1/app.min.js"></script><script type='text/javascript' id='df-script'>
  DepositFixForm.init({
    portalId: '4802805',
    formId: 'dff93604-a80e-4cf0-9691-adb2c983127a',
    settings: {
      currency: 'USD'
    },
    products: [{
      name: 'Product 1',
      type: 'subscription',
      showQuantity: true,
      subscriptionPrices: [{
          planId: 'annual_600',
          amount: 600,
          endDate: ''
        },
        {
          planId: 'df_subscription_9_99',
          amount: 9.99,
          endDate: 'Feb 25, 2018'
        },
        {
          planId: 'df_subscription_50',
          amount: 50,
          endDate: 'Dec 30, 2019'
        },
        {
          planId: 'df_subscription_100',
          amount: 100,
          endDate: 'Sep 30, 2020'
        },
        {
          planId: 'df_subscription_500',
          amount: 500,
          endDate: 'Nov 30, 2020'
        }
      ]
    }]
  });
</script>

The above code will do the following:

  • Set the pricing to $9.9 for any time before Feb 25th. 
  • Set the pricing to $50  from Feb 26th to Dec 30th.
  • Set the pricing to be $100 from December 31st to Sep 30th.
  • Set the pricing to be $500 from Oct 1st to Nov 30th.
  • Set the pricing to be $600 from Nov 30th, onwards. 


Was this article helpful?

Still puzzling over something?

The agent has read this article — and everything around it. Ask a follow-up and it answers in seconds.