Requires TeraWallet Pro with the Withdrawal module active, and a PayPal Business account with
Payouts enabled. PayPal’s API calls are made server-side, so your site needs working outbound HTTPS.
How it works
- The customer requests a withdrawal; the wallet is debited the requested amount.
- When the request is approved (automatically, or by you), TeraWallet calls the PayPal Payouts API with the amount minus your processing fee.
- If PayPal accepts the batch (status
PENDING,PROCESSING,SUCCESSorNEW), the request moves to Approved. - PayPal later sends a webhook with the final result. On failure, TeraWallet cancels the request and restores the customer’s balance.
Step 1 — Create a PayPal REST app
- Sign in to the PayPal Developer Dashboard.
- Switch the toggle to Sandbox (for testing) or Live (for real payouts).
- Go to Apps & Credentials → Create App, choose type Merchant, and name it (e.g. “TeraWallet Payouts”).
- Open the app and copy the Client ID and Secret key.
- Under Features, tick Payouts and save.
Step 2 — Fund the PayPal account
Payouts are drawn from the PayPal balance of the account that owns the app. Keep enough balance to cover pending withdrawals. In sandbox, add funds to your sandbox Business account from the dashboard under Testing Tools → Sandbox Accounts.Step 3 — Configure TeraWallet
Go to TeraWallet → Settings → Withdrawal. General options
PayPal gateway options
Save your changes.
Step 4 — Register the webhook
Webhooks tell TeraWallet whether a payout actually succeeded or later failed.- In the PayPal app, scroll to Webhooks → Add Webhook.
-
Set the Webhook URL to:
The URL must be public HTTPS. Use the same Sandbox/Live mode as your credentials.
-
Subscribe to these events:
Other event types are acknowledged and ignored.
- Save, then copy the generated Webhook ID into PayPal Webhook ID in TeraWallet and save.
Every webhook is verified against PayPal’s signature-verification API using your Webhook ID and
credentials. If the Webhook ID is empty, or the signature is invalid, the request is rejected and no
withdrawal changes. Cancelled requests have their wallet debit reversed, so the customer is made whole.
Step 5 — What customers need to do
Customers add their PayPal email once, under My Account → Wallet → Withdrawal → Payment Settings (field: PayPal email). If it is missing, the withdrawal form tells them to set it up before they can submit. The payout goes to this email address, so make sure customers use the one tied to their PayPal account.Step 6 — Test in sandbox
- Set Mode to Sandbox / Test and use sandbox credentials and a sandbox webhook.
- In the dashboard, create a sandbox Personal account; use its email as the test customer’s PayPal email.
- As that customer, with a wallet balance, submit a withdrawal.
- In wp-admin, open the withdrawal list and Approve the request (or let Automatic mode do it).
- Check the request: it should be Approved, with log entries showing the PayPal response.
- Use Webhooks → Simulate event in the PayPal dashboard (e.g.
PAYMENT.PAYOUTS-ITEM.SUCCEEDED, then a failure event on a second request) to confirm status changes and notes. - Log in to the sandbox personal account at sandbox.paypal.com to see the received funds.
Go live checklist
- Payouts approved on the live PayPal Business account and enabled on the live app
- Mode switched to Live / Production
- Live Client ID and Secret Key pasted
- A new live webhook created, with its Webhook ID pasted (sandbox IDs do not work live)
- PayPal balance funded
- Enable logging turned off
- One small real withdrawal tested end to end
Duplicate-payment protection
Each withdrawal is sent with a stored unique batch ID (also used as PayPal’sPayPal-Request-Id), so a
retry after a timeout is treated by PayPal as the same request and cannot pay twice.
Troubleshooting
Enable Enable logging, then open the request in the withdrawal list to see its gateway log. Failure reasons are also saved as notes on the request.Developer notes
- The payout uses PayPal Payouts v1, with the recipient type
EMAILand the withdrawal ID as thesender_item_id. - Filter
woo_wallet_paypal_payouts_sync_mode(defaultfalse) switches Payouts to synchronous mode. - Filter
woo_wallet_withdrawal_payout_batch_statuschanges which batch statuses count as accepted (defaultPENDING,PROCESSING,SUCCESS,NEW).