Generate a new payment link to accept payments from customers. Supports both fixed and variable payment options with comprehensive setup guidance.
Overview
Generate payment links to accept payments from customers with flexible configuration options for both fixed and variable amounts.
Fixed Amounts
Create links with predetermined payment amounts for specific products or services.
Variable Amounts
Allow customers to input their own payment amount for donations or custom services.
Custom Metadata
Add customer details, purpose, and other contextual information to your payment links.
URL Construction
The payment link URL structure depends on whether you have a custom domain configured.
For merchants without a custom domain:
Concatenate the base URL with your merchant website payments token:
https://app.staxpayments.com/#/pay/ + merchant_website_payments_tokenConfiguration Options
Metadata Settings
Custom Metadata: Add optional metadata to personalize links for specific use cases, including:
- Customer identification details
- Payment purpose or description
- Internal tracking references
- Campaign or source attribution
Expiration Controls
Expiration Settings: Configure link expiration to maintain security and control:
- Set specific expiration dates to prevent misuse
- Ensure links have valid timeframes for your business needs
- Consider customer convenience when setting expiration periods
Security Validation
Request Validation: Always validate required attributes in your requests:
- Verify all mandatory fields are present
- Check data formats and constraints
- Implement proper error handling for failed validations
API Response Codes
Response Structure
| Code | Response | Reason |
|---|---|---|
| 201 | Created | The payment link was successfully created. |
| 400 | Bad Request | Missing required parameters. |
| 401 | Unauthorized | Authentication failed. |
| 500 | Internal Server Error | Unexpected server error occurred. |
Best Practices
Important Notes
Custom Domain Partners: Ensure your custom domain is correctly configured when constructing payment link URLs. Incorrect domain setup will result in non-functional payment links.
Dynamic Metadata: Leverage metadata fields to track payment context, add customer-specific details, or integrate with your internal systems for better payment management.
