Create a Payment Link
Basic Request
Required Parameters
| Parameter | Type | Description |
|---|---|---|
type | string | Link type: product, amount, or subscription |
name | string | Link name (displayed to customer) |
currency | string | Currency code (XOF, EUR, USD) |
Optional Parameters
| Parameter | Type | Description |
|---|---|---|
description | string | Link description |
slug | string | Custom slug for the URL |
amount | number | Fixed amount (for amount type) |
minAmount | number | Minimum amount (for variable amount) |
maxAmount | number | Maximum amount (for variable amount) |
items | array | Items to sell (for product type) |
expiresAt | string | Expiration date (ISO 8601) |
maxRedemptions | number | Maximum number of uses |
collectBillingAddress | boolean | Collect billing address |
collectShippingAddress | boolean | Collect shipping address |
allowPromotionCodes | boolean | Allow promo codes |
successUrl | string | Redirect URL after payment |
cancelUrl | string | Redirect URL if cancelled |
brandingId | string | Custom branding ID |
metadata | object | Custom data |
Link Types
- Fixed Amount
- Variable Amount
- Products
- Subscription
Item Structure
Forproduct and subscription types, you can define items:
| Field | Type | Description |
|---|---|---|
productId | string | Product ID (prod_xxx) |
priceId | string | Price ID (price_xxx) |
name | string | Custom name (if no product) |
description | string | Custom description |
imageUrl | string | Image URL |
quantity | number | Default quantity (default: 1) |
adjustableQuantity | boolean | Allow customer to modify quantity |
minQuantity | number | Minimum quantity |
maxQuantity | number | Maximum quantity |
isOptional | boolean | Optional item (customer can remove it) |
sortOrder | number | Display order |
Advanced Options
Limit Usage
Collect Addresses
Allow Promo Codes
Custom Redirect URLs
Custom Slug
Create a memorable URL:https://checkout.yabetoo.com/p/donate-2024
Complete Example
Response
Response Fields
| Field | Description |
|---|---|
id | Unique link identifier |
url | Public URL to share |
slug | Slug used in the URL |
isActive | Indicates if the link is active |
redemptionCount | Number of times the link has been used |
items | List of items (for product type) |
Common Operations
Retrieve a Link
Update a Link
Deactivate a Link
Delete a Link
List Links
Webhooks
Receive notifications when a payment is made via a link:Available Events
| Event | Description |
|---|---|
payment_link.created | Link created |
payment_link.updated | Link updated |
payment_link.payment.completed | Successful payment via link |
payment_link.payment.failed | Failed payment |
Best Practices
Security
Security
- Always create links server-side
- Never store API keys client-side
- Use webhooks to verify payments
User Experience
User Experience
- Use memorable slugs for important links
- Add a clear description
- Set a reasonable expiration date
Management
Management
- Use metadata for tracking (campaign, source, etc.)
- Monitor
redemptionCountfor limited offers - Deactivate links rather than deleting them
Next Steps
Share a Link
Learn how to share your links effectively
Webhooks
Configure real-time notifications