Payment Links Overview
Learn how to create, manage, and track payment links with MyTPE Pay for seamless payment collection.
Guide to Payment Link Types
MyTPE Pay offers three distinct types of payment links to suit different business needs. Whether you are selling a product, billing a client for a service, or hosting an event, there is a link mode designed for you.
The Three Modes
| Link Type | Best Used For | How It Works |
|---|---|---|
| Standard (Reusable) | E-commerce, Donations | This link never expires based on the number of payments. You can share it on social media or your website, and thousands of people can use it to pay you continuously. |
| Single-Use (One-Shot) | Invoices, Custom Quotes | This link works exactly once. As soon as the first person pays successfully, the link automatically closes. This prevents clients from paying the same invoice twice by mistake. |
| Limited (Quota) | Tickets, Flash Sales | You set a specific quantity (e.g., 20 tickets). The link tracks sales and automatically closes when the stock runs out. |
Payment Link Lifecycle
This diagram shows how a payment link behaves when your customers interact with it.
Note on Statuses:
- Active: The link is live and accepting payments.
- Inactive: You manually paused the link. You can resume it anytime.
- Closed: The system stopped the link automatically because the goal was met (invoice paid or sold out).
- Expired: The system auto-closed the link because the configured inactivity window elapsed without a successful payment. Expired is terminal — see Inactivity Expiry below.
Mode 1: Standard Link (Reusable)
Best for: E-commerce products, Donations, Services.
The link has no memory of past transactions. It acts like a permanent product page on a website.
User Journey - Standard Link
Real-World Example: The Online Store
Scenario: Leila runs an online boutique selling handmade jewelry.
Example: Leila's Boutique
Leila creates a link for her "Silver Necklace" (8,000 DZD). She posts it on Instagram. 500 different people click it and pay over the course of a year. The link never closes.
- Benefits:
- Link never expires from use.
- Perfect for products with continuous availability.
- Same link can be shared everywhere.
- Reduces need to create new links constantly.
Mode 2: Single-Use Link (One-Shot)
Best for: Invoices, Custom Quotes, Debt Recovery.
The link works exactly once. As soon as the first payment is successful, the link destroys itself (status becomes closed).
User Journey - Single-Use Link
Real-World Example: The Freelancer
Scenario: Sarah is a graphic designer who finishes a logo for a client.
Example: Sarah's Invoice
Sarah sends "Invoice #101" to a client for 50,000 DA. The client pays. Five minutes later, the client clicks the link again by mistake. The system blocks them.
- Benefits:
- Prevents double payments.
- Perfect accounting (one invoice = one payment).
- Client can't accidentally pay twice.
- No manual link deactivation needed.
Use Cases:
- Client invoices
- Custom service quotes
- One-time consulting fees
- Project milestone payments
Mode 3: Limited Link (Quota)
Best for: Event Tickets, Flash Sales, Limited Editions.
You set a max_payments integer (e.g., 20). The link counts down with every sale. When it hits 0, it closes.
User Journey - Limited Link
Real-World Example: The Workshop Organizer
Scenario: Ahmed hosts a pottery workshop with limited space.
Example: Ahmed's Workshop
Ahmed creates a link with max_payments: 15. The 16th person who tries to click the link sees a "Sold Out" message automatically.
- Benefits:
- Automatic inventory tracking.
- No overselling.
- Creates urgency ("Only 3 left!").
- Can restock and reopen same link.
Use Cases:
- Event tickets
- Limited edition products
- Flash sales
- Pre-orders with quantity limits
Comparison: When to Use Each Mode
Advanced Feature: Restocking Inventory
When using Limited links, you can reopen closed links by adding more inventory.
Example: Ahmed's workshop link closed after 15 sales. He adds 5 chairs, increases the quantity to 20, and the same Instagram link automatically becomes active again for 5 more sales.
Displaying Availability (Limited Links Only)
For Limited links, the system helps create urgency by showing real-time availability:
This automatic counting helps drive sales and keeps customers informed about availability in real-time.
Inactivity Expiry
A one_shot or limited link can also auto-close when no successful payment arrives within a configurable time window. This is independent of the max_payments quota — it's a separate "use it or lose it" policy.
This is useful for:
- Delivery payments that should expire if the customer doesn't pay within a few hours
- Seat / ticket reservations that should release the hold after 30 minutes
- Time-limited promotional links (e.g., 12-hour gamer flash sale)
- Invoices that auto-cancel if not paid within N days
Reusable links are exempt
Inactivity expiry never applies to reusable links. Reusable links are designed for ongoing use and never auto-close.
How the timeout is resolved
Each link's effective timeout is computed via a 2-level fallback chain:
So a merchant can:
- Set one instance default (e.g., 48 hours) on the Mytpe Pay instance, and every link inside that instance inherits it automatically.
- Override the default on specific links that need a different policy (e.g., a 12-hour PC-gamer flash sale link in the same instance).
- Leave both blank → that link never inactivity-expires.
What counts as "activity"
The clock resets only on successful payments (transaction status completed). Pending, failed, and refused transactions do not reset the clock. The clock starts at link creation.
This matches the typical merchant intent: "if no real money lands in 48h, kill the link". Failed gateway attempts shouldn't artificially keep a stale link alive.
When the sweeper runs
A background job runs every 5 minutes and checks every active one_shot/limited link against its effective timeout. Links that crossed the threshold are transitioned to status expired and a pay_link.expired webhook is fired so your backend can react.
Expired is terminal
Once a link is expired, it cannot be reactivated. This is a policy choice — reactivation would create ambiguity around the audit trail and customer expectations. To accept the same payment after expiry, create a new link.
Configuring it
| Where | Field | Endpoint |
|---|---|---|
| Per link (override) | inactivity_timeout_minutes | Create Pay Link / Update Pay Link |
| Per instance (default) | default_inactivity_timeout_minutes | Update Mytpe Pay Instance |
Both fields take an integer in minutes, range 1 to 525600 (= 1 year). For sub-hour precision, use minute values (e.g., 30 = 30 minutes); for longer windows, multiply hours by 60 (e.g., 2880 = 48 hours).
Summary Table
| Feature | Standard | Single-Use | Limited |
|---|---|---|---|
| Max Uses | Unlimited | 1 payment | X payments (you decide) |
| Auto-closes (quota)? | No | Yes (after 1st payment) | Yes (when sold out) |
| Can reopen (quota)? | N/A (always open) | No | Yes (add more stock) |
| Inactivity expiry? | No (exempt) | Yes (configurable) | Yes (configurable) |
| Best for | Ongoing sales | Invoices | Limited inventory |
| Urgency factor | None | None | High (countdown) |
| Risk of overselling | N/A | None | None |