Create a Payment Link

Generate a new payment link to accept payments from customers. Supports both fixed and variable payment options.

Overview

Generate payment links to accept payments from customers with flexible configuration options for both fixed and variable amounts.

dollar-sign
Fixed Amounts

Create links with predetermined payment amounts for specific products or services.

edit
Variable Amounts

Allow customers to input their own payment amount for donations or custom services.

tags
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

cogMetadata 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
clockExpiration 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
shield-altSecurity 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

list-altResponse 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.

Body Params
Responses

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json