Quick start

Note

This quick start uses Python. If you are using a different programming language, please see the full documentation for information on how to generate LaterPay links.

The easiest way to create a reliable user experience on your website is to prepare paid links for your content server-side and then offer them to users.

For example: Using LaterPay’s Python client, selling an article with the unique ID “1000” for 0.99 EUR, would work like this:

Python

# This example uses the official LaterPay Python client library from pypi.
# You can find it here: https://github.com/laterpay/laterpay-client-python
# To get started quickly, run:
# $ virtualenv example
# $ example/bin/pip install laterpay-client
# $ example/bin/python
#
from laterpay import LaterPayClient, ItemDefinition

# get us a LaterPay client
lpc = LaterPayClient("your merchant-id", "your API key")

i  = ItemDefinition(item_id="1000",
                    pricing="EUR99",
                    url="http://example.com/your-article-1000/",
                    title="Example Article 1000")

# Creates a Dialog URL, which can be used to purchase the item.
url = lpc.get_add_url(i)

HTML

<a href="{{ url }}">Read on for 0.99 EUR and pay later</a>

Please see the interface guide for more information on how to style HTML links and buttons.