Payment Links API
Payment Links
The Payment Links service (client.paymentLinks) allows you to create payment requests that can be shared with customers. When a customer accesses a payment link, they will be directed to a checkout page where they can complete the payment using SUI or other supported cryptocurrencies.
Create a Payment Link
Create a new payment link using the SDK:
import { PaymentDestinationType } from '@suipay/api';
// Create payment link with POLAR_BALANCE destination
const paymentLink = await client.paymentLinks.create({
amount_usdc: 100,
description: 'Test payment',
destination_type: PaymentDestinationType.POLAR_BALANCE
});
console.log(`Payment URL: ${paymentLink.url}`);Method Signature
client.paymentLinks.create(options: CreatePaymentLinkRequest): Promise<PaymentLink>Request Parameters
amount_usdc
number
Yes
The amount in USDC to be paid
description
string
No
A description of what the payment is for
destination_type
PaymentDestinationType
Yes
Where the funds should be sent after payment
custom_sui_address
string
Conditional
Required when destination_type is CUSTOM_ADDRESS
bank_account_id
string
Conditional
Required when destination_type is BANK_ACCOUNT
Response Type
Usage Examples
List Payment Links
Retrieve all payment links for your account:
Method Signature
Response Type
Get Payment Link
Retrieve details of a specific payment link:
Method Signature
Response Type
Payment Link States and Monitoring
Checking Payment Status
Monitor payment link status and track completion:
Payment Link Fields
id
string
Unique payment link identifier
user_id
string
Associated user identifier
amount_usdc
number
Payment amount in USDC
description
string?
Optional payment description
shopify_payment_session_id
string?
Shopify integration session ID
destination_type
PaymentDestinationType
Where funds are sent after payment
custom_sui_address
string?
Custom SUI address (for CUSTOM_ADDRESS type)
bank_account_id
string?
Bank account ID (for BANK_ACCOUNT type)
enabled
boolean
Whether the payment link is active
off_ramp_status
OffRampStatus
Current off-ramp processing status
sui_usdc_transfer_tx
string?
SUI USDC transfer transaction hash
solana_usdc_transfer_tx
string?
Solana USDC transfer transaction hash
cctp_message_hash
string?
CCTP (Cross-Chain Transfer Protocol) message hash
off_ramp_error
string?
Error message if off-ramp processing failed
off_ramp_started_at
string?
When off-ramp processing started
off_ramp_completed_at
string?
When off-ramp processing completed
bridge_transfer_id
string?
Bridge service transfer identifier
sui_wallet_deposit_address
string?
SUI wallet deposit address used
polar_balance_processed
boolean
Whether funds have been processed to balance
created_at
string
Payment link creation timestamp
expires_at
string?
When the payment link expires
paid
boolean
Whether the payment has been completed
paid_at
string?
When the payment was completed
transaction_digest
string?
The SUI transaction hash of the payment
transaction_payer
string?
The SUI address of the payer
refunded
boolean
Whether the payment has been refunded
refund_digest
string?
The SUI transaction hash of the refund
woocommerce_metadata
any?
WooCommerce integration metadata
Off-ramp Status Enum
Off-ramp Processing Monitoring
Monitor the off-ramp processing status for bank account destinations:
Destination Types
POLAR_BALANCE
Funds are added to your SuiPay balance and can be withdrawn later:
BANK_ACCOUNT
Funds are automatically sent to your connected bank account:
Requirements:
KYC verification must be completed (
user.kyc_complete === true)Bank account must be connected and verified
More complex processing with multiple steps
CUSTOM_ADDRESS
Funds are sent directly to a specified SUI address:
Requirements:
Valid SUI address starting with "0x"
Address format is validated during creation
Error Handling
Handle common errors when working with payment links:
Complete Example
Here's a comprehensive example showing payment link creation and monitoring:
Important Notes
Minimum payment: 0.01 USDC
Expiration: Payment links can have expiration times
Status tracking: Use webhooks or polling to monitor payment status
Off-ramp timing: Bank account destinations take longer due to settlement times
Transaction hashes: Stored for audit trails and verification
Last updated