Create a Payment Link

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_token

Configuration 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
CodeResponseReason
201CreatedThe payment link was successfully created.
400Bad RequestMissing required parameters.
401UnauthorizedAuthentication failed.
500Internal Server ErrorUnexpected server error occurred.

Best Practices

Testing & Validation

  • Always verify newly created payment links
  • Test links in different environments
  • Ensure proper redirection to payment pages
  • Validate metadata transmission

Security Considerations

  • Use appropriate expiration dates
  • Implement request validation
  • Monitor for suspicious activity
  • Keep domain configurations secure

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.

Language
Credentials
OAuth2
Click Try It! to start a request and see the response here!