💸 Pay to Customer
The Pay to Customer feature allows you to send payments to users directly through a hashed payment link. You define the recipient’s wallet address and amount, and we'll generate a unique checkout link or embeddable iframe to complete the payout.
Once generated, the user can access the checkout interface to receive the funds into their wallet.
⚠️ Admin Approval Required
Before the link becomes active or visible to the customer, your Pay to Customer request must be approved by an admin.
You will receive a notification once it is approved. Only after approval will the payment link function and become accessible to the user.
📋 How It Works
- Go to your 1buy.io dashboard.
- Select "Pay to Customer" from the sidebar.
- Enter:
- Wallet address of the customer (recipient)
- Payout amount
- Submit your request.
- Wait for admin approval.
- Once approved, a unique hashed URL will be generated.
- You can:
- Send the link directly to the user.
- Embed it on your site using an iframe.
🪙 Payouts are made in BSC USDT. Make sure the wallet address provided supports Binance Smart Chain (BEP-20).
⚙️ Pay to Customer URL Parameters
You can generate a Pay-to-Customer link using the following URL format: https://checkout.1buy.io/pay-customer?api_key=YOUR_API_KEY&pay_customer=true
Parameter | Description | Example |
---|---|---|
api_key | Your unique store API key | api_key=YOUR_API_KEY |
pay_customer | Activates pay-to-customer mode | pay_customer=true |
wallet_address | Recipient’s wallet address | wallet=0x123...abc |
amount | Amount to send (in token units) | amount=10 |
custom_id | A custom transaction ID (for internal tracking) | custom_id=payout_001 |
lang | Language for the widget interface | lang=en |
campaignID | A unique campaign ID for analytics | campaignID=promo42 |
redirect_url | URL to redirect after successful payout | redirect_url=https://yourwebsite.com/success |
fail_redirect_url | URL to redirect after failed transaction | fail_redirect_url=https://yourwebsite.com/fail |
redirect_page | Type of redirection: new , self , or parent | redirect_page=new |
wait_time | Wait before redirecting user after transaction: yes or no | wait_time=yes |
custom_time | Custom wait time in seconds (only applies if wait_time=yes ) | custom_time=5 |
webhook_wait | Wait for webhook confirmation before redirecting: yes or no | webhook_wait=no |
💻 iFrame Embed Example
To embed the Pay to Customer widget on your website, use the following HTML snippet:
<iframe
src="https://checkout.1buy.io/pay-customer?api_key=YOUR_API_KEY&pay_customer=true&wallet=0x123...abc&amount=10&token_symbol=USDC"
width="780px"
height="540px"
title="Pay to Customer - 1buy.io"
frameborder="1"
/>
⚠️ Important Notes
Admin Approval Required:
- Payout links are only usable after an admin has reviewed and approved the request.
Immutable once shared: Once the link is generated and shared, the wallet address and amount cannot be changed.
Secure Transmission: Always verify wallet addresses and amounts before sending out the payment link.
Use HTTPS: Only use this in secure environments.
🔑 Generate Hash for Pay to Customer Widget
To securely share your pay to customer checkout page, you can generate a hash using the Hash Widget URL API. This allows you to create one-time or reusable checkout links that can be tracked and controlled.
Step 1: Prepare the URL Data
Build your multi-product widget URL as query parameters, for example: ?api_key=YOUR_API_KEY&pay_customer=true
You can add more parameters as needed (such as lang
, custom_id
, etc.).
Step 2: Make the API Request
Send a POST
request to the Hash Widget URL API endpoint:
Endpoint
- Production:
https://api.1buy.io/api/business/product/hash_widget_url
- Development:
https://api-dev.1buy.io/api/business/product/hash_widget_url
Request Example
{
"urlData": "?api_key=YOUR_API_KEY&pay_customer=true",
"is_one_time": true
}
Set is_one_time to true if you want the link to work only once (recommended for single-use invitations).
Sample curl command
curl -X POST 'https://api.1buy.io/api/business/product/hash_widget_url' \
-H 'api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"urlData": "?api_key=YOUR_API_KEY&pay_customer=true",
"is_one_time": true
}'
Step 3: Use the Returned Hash
<iframe
src="https://checkout.1buy.io/buy-sell/pay_customer?hash=HASH_VALUE"
width="780px"
height="540px"
title="1buy.io"
frameborder="1"
/>