Skip to main content

💸 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

  1. Go to your 1buy.io dashboard.
  2. Select "Pay to Customer" from the sidebar.
  3. Enter:
    • Wallet address of the customer (recipient)
    • Payout amount
  4. Submit your request.
  5. Wait for admin approval.
  6. Once approved, a unique hashed URL will be generated.
  7. 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).

alt text

⚙️ 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

ParameterDescriptionExample
api_keyYour unique store API keyapi_key=YOUR_API_KEY
pay_customerActivates pay-to-customer modepay_customer=true
wallet_addressRecipient’s wallet addresswallet=0x123...abc
amountAmount to send (in token units)amount=10
custom_idA custom transaction ID (for internal tracking)custom_id=payout_001
langLanguage for the widget interfacelang=en
campaignIDA unique campaign ID for analyticscampaignID=promo42
redirect_urlURL to redirect after successful payoutredirect_url=https://yourwebsite.com/success
fail_redirect_urlURL to redirect after failed transactionfail_redirect_url=https://yourwebsite.com/fail
redirect_pageType of redirection: new, self, or parentredirect_page=new
wait_timeWait before redirecting user after transaction: yes or nowait_time=yes
custom_timeCustom wait time in seconds (only applies if wait_time=yes)custom_time=5
webhook_waitWait for webhook confirmation before redirecting: yes or nowebhook_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

  1. Admin Approval Required:

    • Payout links are only usable after an admin has reviewed and approved the request.
  2. Immutable once shared: Once the link is generated and shared, the wallet address and amount cannot be changed.

  3. Secure Transmission: Always verify wallet addresses and amounts before sending out the payment link.

  4. 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"
/>