Skip to main content

Autofill options for the checkout

Automatically pre-fill discount codes, payments plans, and many more using parameters

Bryan Schoenmaker avatar
Written by Bryan Schoenmaker
Updated over 2 weeks ago

Let's say you have created a checkout page where customers can choose to pay monthly or annually. But now, you want to send a version of the page that is already set to 'pay annually'. Or maybe you would like a discount code to be automatically filled in when someone opens the checkout.

By adding a URL parameter to you checkout URL, you can pre-fill certain fields in advance. in this article, I will show you exactly how to do that step-by-step.


Which parameters can I use?

You can pre-fill the following fields on your checkout page using URL parameters.

  1. ?discount_code=

  2. ?plan=monthly

  3. ?plan=yearly

  4. ?plan=quaterly

  5. ?suggested-plan=monthly

  6. ?suggested-plan=quarterly

  7. ?suggested-plan=yearly

  8. ?firstname=

  9. ?lastname=

  10. ?street=

  11. ?telephone=

  12. ?city=

  13. ?country=

  14. ?zipcode=

  15. ?housenumber=

  16. ?email=

  17. ?company=

  18. ?vat_number=

  19. ?quantity=


Changing the payment plan with URL parameters

A parameter is a small piece of text you add to the end of your checkout URL. For example, to automatically show the annual payment option, use:

?plan=yearly

A parameter always start with a question mark, followed by the field type (plan), and ends with the value you want to pre-fill (in this case, '=yearly').

To preselect the monthly option instead, use:

?plan=monthly

ℹ️ There are no parameters for instalment payments

How do I use this?

Imagine this is your checkout page:

https://checkout.plugandpay.com/checkout/premium

On the checkout page, customers can choose between a monthly or yearly Plug&Pay Premium subscription.

If you want to share this page with the yearly plan pre-selected, simply add the following parameter to the URL: '?plan=yearly':

https://checkout.plugandpay.nl/checkout/premium?plan=yearly

This adjusted link ensures that the yearly subscription is automatically selected when someone opens the checkout.


Sharing a checkout with a pre-filled discount code

You can also automatically apply a discount code by adding a parameter to the URL.

Use the following format: '?discount_code='. Then, add your discount code directly after the '=' symbol.

For example, if your discount code is 'WELCOME10', your URL would look like this:

https://checkout.plugandpay.com/checkout/?discount_code=WELCOME10

As long as the code exists, it will automatically be filled in on the checkout.


Using multiple parameters at once

If you would like to use more than one parameter in the same URL, simply separate them with the '&' symbol.

For example, to pre-select the annual plan and apply the discount code, your link would look like this:

?plan=yearly&discount_code=WELCOME10
Did this answer your question?