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 generate links for email or for your website is using the Laterpay Python Client. Links are good for up to 60 days after you generate them using the method discussed below.

For example: Using LaterPay’s Python client, a contribution for “Spring Fundraising Event for MyOrg” for $5.00 USD, 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",
    api_root="https://api.uselaterpay.com",
    web_root="https://web.uselaterpay.com",
)

i  = ItemDefinition(item_id="spring-fundraising",
                    pricing="USD500",
                    url="http://myorg.net/your-spring-campaign/",
                    title="Spring Fundraising Event for MyOrg",
                    item_type="contribution")

# Creates a dialog URL for a contribution. Historically, these are called
# "buy" instead of "pay now", and "add" instead of "pay later". The
# `is_permalink` option means that the link will not expire -- normally
# LaterPay links expire after a certain amount of time.
pay_now_url = lpc.get_buy_url(i, is_permalink=True)
pay_later_url = lpc.get_add_url(i, is_permalink=True)

HTML

<a href="{{ pay_now_url }}">Contribute Now $5.00</a>

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