Leepa Africa API

Sections

Theme switcher

Leepa Africa API

Advanced API Structure for Seamless Integration

To enable third-party platforms to integrate Leepa Africa's capabilities, we've meticulously designed a comprehensive and flexible API structure. Our API facilitates easy integration, providing developers with the tools to incorporate blockchain payment solutions into their applications.

Core API Components

  • Secure Authentication: Utilizing API keys we ensure secure and authorized access to our services.
  • Blockchain Interaction: Developers can easily select networks, manage tokens, and authorize transactions, offering unparalleled flexibility across blockchains.
  • Dynamic Payment Processing: Our API supports the creation and management of various payment types, including one-time invoices, recurring subscriptions, and usage-based billing, with built-in support for handling overdue payments.
On this page
  • Leepa Africa API

Accounts, API Keys & Webhooks

Accounts are the basic organizations that use Leepa Africa services. They can be individuals, businesses, or non-profit organizations. They can have one or more users associated with them, and they can be connected to other accounts.

Creating an account through the API will connect that account with your account, enabling you to call the API as that account in the future. This allows a platform account the ability to onboard users, and configure products, and payment agreements for their users.

On this page
  • Accounts, API Keys & Webhooks

Merchant Wallet Transfers

Leepa Africa Merchant Wallets are secure, non-custodial wallets powered by DFNS’s battle-tested wallet infrastructure. Designed with robust key management and WebAuthn-based authentication, these wallets ensure enterprise-grade security without exposing private keys or relying on vulnerable seed phrases. With Merchant Wallets, Leepa Africa merchants don’t need to connect external wallets or manage third-party integrations. Everything is built-in—making on-chain payments, managing funds, and receiving crypto subscriptions frictionless and secure, straight from your Leepa Africa dashboard.

To get started with a merchant platform wallet of your own, sign up at test.leepa.africa (development environment) or app.leepa.africa (production).

On this page
  • Merchant Wallet Transfers

Subscription Products

At Leepa Africa, a product is a digital offer created by a merchant that users can purchase in exchange for access to a service, benefit, or digital experience. While many products are traditional subscriptions, they can also represent one-time access or single-purchase offerings.


Core Aspects of a Leepa Africa Product:

  • Merchant-Defined: Each product is owned and managed by a specific merchant, who determines its pricing, duration, and usage.
  • Descriptive Name: Every product has a clear and user-friendly title that communicates what the offering is.
  • Flexible Pricing Model: Products are priced in U.S. dollars, but payment may be made using crypto. The pricing supports both recurring subscriptions and one-time purchases.
  • Blockchain Integration: Payments are directed to a dedicated blockchain address, enabling secure, on-chain transactions.
  • Lifecycle Status: Products can be marked as active (available for purchase), inactive (temporarily paused), or discontinued (retired), giving merchants control over their offerings.
On this page
  • Subscription Products

Agreements

Payment agreements generate recurring payments through Vantack's payment network based on the pre-defined agreements signed by the customer. The customer is required to agree to any changes to a payment agreement.

On this page
  • Agreements

Payments

Payments in this system represent transactions that merchants receive from their customers. Each payment record contains important information about a transaction, such as:

  • The amount paid
  • The currency used (like USDC)
  • When the payment was made
  • The status of the payment
  • Details about the customer
  • Information about what was purchased
  • Whether it was a one-time purchase or part of a subscription

Merchants can use this service to:

  • View their complete payment history
  • Look up specific payment details
  • Monitor transaction statuses
  • Keep records of customer purchases

This helps merchants keep track of their business transactions and maintain a clear record of all payments they've received through the platform.

On this page
  • Payments

Purchase Sessions

A crypto payment system purchase session is a digital payment request, enabling users to specify and request a cryptocurrency amount from another party. Upon creation, the system generates a unique URL for the session, including details on the payment amount (if specified) and any additional instructions or metadata. This URL can be shared via email, messaging, QR code, or other methods, directing the payer to a secure payment interface to complete the transaction using their crypto wallet. This approach ensures precise payment amounts and offers a clear, trackable way to request and receive crypto payments, making it ideal for businesses, freelancers, and anyone needing a straightforward method for crypto transactions. Purchase sessions securely transmit user information to Leepa Africa upon initialization using a secure backchannel. Sessions can also be set to expire after a certain period, allowing for expirable quotes and adding a layer of security to the payment process.

On this page
  • Purchase Sessions

Purchase Messages

Purchase messages are designed for integrators who want to build and control their own checkout experience. Instead of redirecting customers to a hosted checkout page, integrators request a raw payload from Leepa Africa, which contains all necessary transaction details.

The integrator then signs this payload on the client or server side using their private key, following the EIP-712 structured data signing standard. Once signed, the integrator submits the message back to Leepa Africa's API to finalize the transaction.

This approach gives developers full flexibility over the user interface and transaction flow, while still leveraging Leepa Africa's backend for transaction processing, validation, and reconciliation.

A short demo on how to sign a message using EIP-712 is available here: CodeSandbox EIP-712 Demo

On this page
  • Purchase Messages

Permit Messages

Permit messages enable gasless token approvals by allowing users to sign an off-chain message that authorizes Leepa Africa's smart contract to spend their tokens. Instead of requiring an on-chain approval transaction—which costs gas—users can simply sign a structured message with their wallet. This reduces friction at checkout and makes the payment process faster and more cost-effective.

When you submit a signed purchase session, Leepa Africa checks whether the user has already approved token spending. If so, the payment is processed immediately. If not, the response will include a permit message in typed data format. You can present this message to the user for signing. Once signed, submit it to Leepa Africa to complete the approval and proceed with the transaction—all without requiring an additional on-chain approval step.

On this page
  • Permit Messages

Integration Options

This comprehensive guide provides detailed information about integrating Leepa Africa payment processing into your application. Leepa Africa offers four distinct integration methods designed to accommodate different technical requirements and use cases, from simple no-code solutions to advanced API integrations with full customization capabilities.

Option
Integration Level
Customization
Hosted Checkout UI

1. Standard Checkout Link

🔹 No Code

(full control)

2. Button Embed

🔸 Low Code

✅ (button color)

3. iFrame Embed

🔸 Medium Code

✅ (full control)

4. Headless API

🔸 Developer

✅ (fully programmable)


Which Integration Option Should You Use?

Choosing the right integration depends on your technical resources, business model, and how much control you want over the checkout experience.

🔹 Standard Checkout Link – Best for Non-Technical Merchants

Who it's for:

  • Individual creators
  • Small merchants or service providers
  • Teams with no dev resources

Why use it:

  • Zero development required
  • Shareable across any platform (email, social, website)
  • Fastest way to start accepting stablecoin payments

🔸 Button Embed – Best for Low-Code Teams

Who it's for:

  • Marketing teams with light dev help
  • Shopify, WordPress, or Webflow users
  • Sites that need a call-to-action button with minimal backend setup

Why use it:

  • Simple HTML embed
  • Button styling via data-color
  • Redirects to secure hosted checkout

🔸 Modal iFrame – Best for Custom Frontends That Want In-Site UX

Who it's for:

  • Sites with web developers
  • Businesses that care about seamless branding and user experience
  • Publishers, SaaS sites, or gated content platforms

Why use it:

  • Fully embedded experience
  • Controlled modal styling
  • Checkout stays within your UI context

🔸 Headless API – Best for Crypto-Native Platforms & Advanced Teams

Who it's for:

  • Web3 apps, dApps, DeFi platforms
  • Teams already managing wallets or signing flows
  • Platforms needing custom onboarding, wallet UX, or nonstandard product logic

Why use it:

  • Full control over the payment process
  • You manage wallet interaction and signing
  • Suitable for integrations with other on-chain or backend systems
On this page
  • Integration Options

Webhooks

Webhooks allow real-time communication between systems.

Webhooks are used to synchronize disparate systems by publishing automated messages with predefined payloads that can be interpreted by integrated systems. They allow real-time communication between applications, enabling instant updates and data sharing without the need for continuous polling.

Our platform webhooks provide notifications when specific actions occur on your account, such as when a customer subscribes to a product, purchases a one-off product, makes a payment, or cancels a subscription. By setting up webhooks, you can automate processes and keep your systems in sync with our platform in real-time.

On this page
  • Webhooks

Test Customer Demand for Crypto Payments

The Crypto Interest & Engagement Button allows you to measure customer interest in paying with cryptocurrency before launch. By integrating this button, you can collect customer interactions, emails, and waitlist sign-ups—all without processing any payments immediately.


How It Works

  1. Customer clicks “Pay with Crypto” The button records the interaction in our database.
  2. Modal opens A pop-up asks the customer if they want to receive updates via email.
  3. Customer enters email They are added to your “waitlist” for crypto payments.
  4. You get data Track interest, cart sizes, and popular products.

Step 1 – Get Your Merchant ID

  1. Log in to your Leepa Africa Dashboard.
  2. Go to Settings → API Keys.
  3. Copy your Merchant ID.

Step 2 – Add the Script to Your Website

Place the following script anywhere in your HTML:

HTML

Step 3 – Customize Button (Optional)

The button can be fully customized using the data-* attributes. Here’s what each field does. You can customize the look of your buttons to match your website’s style. You can find real code examples here.

Attribute

Required

Description

Example

data-merchant-id

✅ Yes

Your unique Merchant ID.

"b8690aab-2202-4ed5-abf7-02f4661e0925"

data-button-text

⚙️ Optional

Text displayed on the button.

"Subscribe with Crypto ⚡"

data-background-color

⚙️ Optional

Background color of the button block. Accepts HEX or RGB.

"rgb(30,30,30)"

data-button-color

⚙️ Optional

Button color.

"rgb(0,200,200)"

data-button-text-color

⚙️ Optional

Color of the text on the button.

"rgb(255,255,255)"

data-logo-mode

⚙️ Optional

Logo style (dark or white).

"dark"

data-cart-size

⚙️ Optional

The total cart value associated with this product.

99.99

data-merchant-industry

⚙️ Optional

Your business category.

"Fashion"

data-product-metadata

⚙️ Optional

Product details in JSON format.

'{"product_name": "Skirt", "price": 99.99, "category": "clothing"}'


Step 4 – Collect Data & Analyze

For the APIs you can use to collect data about user engagement/interest use the following set of APIs. This feature is currently restricted to the test environment.

On this page
  • Test Customer Demand for Crypto Payments